diff --git a/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index c81ab9e1e..0b8c4a458 100644 --- a/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -1584,6 +1584,14 @@ void registerGlExtensions(CGlExtensions &ext) { H_AUTO_OGL(registerGlExtensions); +#ifdef NL_OS_MAC + CGLContextObj ctx = CGLGetCurrentContext(); + if (ctx == NULL) + { + nlerror("No OpenGL context set"); + } +#endif + // OpenGL 1.2 ?? const char *nglVersion = (const char *)glGetString (GL_VERSION); diff --git a/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 293cb28bb..f04ad304e 100644 --- a/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -1072,6 +1072,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re [_ctx flushBuffer]; [_glView display]; + // Set context as thread context + CGLSetCurrentContext((CGLContextObj)[_ctx CGLContextObj]); + _EventEmitter.init(this, _glView, _DestroyWindow); #elif defined(NL_OS_UNIX) diff --git a/nel/src/misc/system_info.cpp b/nel/src/misc/system_info.cpp index 1f5039de5..5dc70182c 100644 --- a/nel/src/misc/system_info.cpp +++ b/nel/src/misc/system_info.cpp @@ -179,7 +179,6 @@ #else # include # include -# include # include # include # include diff --git a/nel/src/web/http_client_curl.cpp b/nel/src/web/http_client_curl.cpp index e61baa89f..10bb0776c 100644 --- a/nel/src/web/http_client_curl.cpp +++ b/nel/src/web/http_client_curl.cpp @@ -191,8 +191,11 @@ bool CCurlHttpClient::receive(string &res, bool verbose) // *************************************************************************** void CCurlHttpClient::disconnect() { - curl_easy_cleanup(_Curl); - _CurlStruct = NULL; + if (_CurlStruct) + { + curl_easy_cleanup(_Curl); + _CurlStruct = NULL; + } curl_global_cleanup(); } diff --git a/ryzom/client/src/decal.cpp b/ryzom/client/src/decal.cpp index e270a7c29..a16cb93bf 100644 --- a/ryzom/client/src/decal.cpp +++ b/ryzom/client/src/decal.cpp @@ -162,7 +162,9 @@ CDecal::CDecal() { DecalAttenuationVertexProgram = new CVertexProgramDecalAttenuation(); } - _ShadowMap = new CShadowMap(&(((CSceneUser *) Scene)->getScene().getRenderTrav().getShadowMapManager())); + + // initialized in render() as depends on scene + _ShadowMap = NULL; _Material.initUnlit(); _Diffuse = CRGBA::White; _Emissive = CRGBA::Black; @@ -251,7 +253,11 @@ CRGBA CDecal::getDiffuse() const // **************************************************************************** CDecal::~CDecal() { - delete _ShadowMap; + if (_ShadowMap) + { + delete _ShadowMap; + _ShadowMap = NULL; + } } // **************************************************************************** @@ -527,7 +533,12 @@ void CDecal::render(NL3D::UDriver &/* drv */, // float tileNear = Landscape->getTileNear(); // - nlassert(_ShadowMap); + if (!_ShadowMap) + { + _ShadowMap = new CShadowMap(&(((CSceneUser *) Scene)->getScene().getRenderTrav().getShadowMapManager())); + nlassert(_ShadowMap); + } + _ShadowMap->LocalClipPlanes.resize(4); CVector corners[4] = { diff --git a/ryzom/client/src/interface_v3/action_handler_game.cpp b/ryzom/client/src/interface_v3/action_handler_game.cpp index b4237cf88..1c42b5eea 100644 --- a/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -2819,24 +2819,6 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { - /* // Previous version (multiple pressed on a desktop change a central window - uint desktop; - fromString(Params, desktop); - if (desktop getDbProp(dbNames[desktop], false); - if (pNL != NULL) - sValue = NLMISC::toString((sint32)pNL->getValue64()); - vector vecStr; - vecStr.push_back(procNames[desktop]); - vecStr.push_back(sValue); - CWidgetManager::getInstance()->runProcedure(procNames[desktop], NULL, vecStr); - }*/ - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:gestion_windows")); if (pGC == NULL) @@ -2847,11 +2829,14 @@ public: CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId("ui:interface:gestion_windows:close"); if (pIE != NULL) pIE->setActive(false); + bool switchDesktop = false; + CActionsManager *pAM = &Actions; if (!pAM->valide(CAction::CName("set_desktop",Params.c_str()))) { pGC->setActive(false); _FirstTime = true; + switchDesktop = true; } else // Key is down { @@ -2859,11 +2844,7 @@ public: if (_FirstTime) { _FirstTime = false; - - vector vecStr; - vecStr.push_back("tb_setdesktop"); - vecStr.push_back(Params); - CWidgetManager::getInstance()->runProcedure("tb_setdesktop", NULL, vecStr); + switchDesktop = true; } else // Not the first time { @@ -2873,6 +2854,13 @@ public: CWidgetManager::getInstance()->setTopWindow(pGC); } } + if (switchDesktop) + { + vector vecStr; + vecStr.push_back("tb_setdesktop"); + vecStr.push_back(Params); + CWidgetManager::getInstance()->runProcedure("tb_setdesktop", NULL, vecStr); + } } private: bool _FirstTime; diff --git a/ryzom/client/src/interface_v3/group_map.cpp b/ryzom/client/src/interface_v3/group_map.cpp index a279f84da..4b08b6e4b 100644 --- a/ryzom/client/src/interface_v3/group_map.cpp +++ b/ryzom/client/src/interface_v3/group_map.cpp @@ -2418,7 +2418,8 @@ void CGroupMap::updateMatchedLandmarks() std::vector > params; params.clear(); params.push_back(std::pair("id", toString("lm%d", k))); - params.push_back(std::pair("tooltip", _MatchedLandmarks[k].Title.toUtf8())); + // ctrl base expects utf8 string to start with "u:" + params.push_back(std::pair("tooltip", "u:" + _MatchedLandmarks[k].Title.toUtf8())); params.push_back(std::pair("index", toString(k))); CInterfaceGroup *g = CWidgetManager::getInstance()->getParser()->createGroupInstance("lm_search_result", pL->getId(), params); @@ -2611,7 +2612,7 @@ void CGroupMap::setLandmarkFilter(const std::string &s) if (!s.empty()) { ucstring ucs; ucs.fromUtf8(s); - splitUCString(toLower(s), ucstring(" "), _LandmarkFilter); + splitUCString(toLower(ucs), ucstring(" "), _LandmarkFilter); } // recreate landmarks