Merge branch 'develop' into ryzomclassic-develop

ryzomclassic-develop
kaetemi 4 years ago
commit 505e13cd1e

@ -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);

@ -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)

@ -179,7 +179,6 @@
#else
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/sysctl.h>
# include <fcntl.h>
# include <unistd.h>
# include <cerrno>

@ -191,8 +191,11 @@ bool CCurlHttpClient::receive(string &res, bool verbose)
// ***************************************************************************
void CCurlHttpClient::disconnect()
{
if (_CurlStruct)
{
curl_easy_cleanup(_Curl);
_CurlStruct = NULL;
}
curl_global_cleanup();
}

@ -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()
{
if (_ShadowMap)
{
delete _ShadowMap;
_ShadowMap = NULL;
}
}
// ****************************************************************************
@ -527,7 +533,12 @@ void CDecal::render(NL3D::UDriver &/* drv */,
//
float tileNear = Landscape->getTileNear();
//
if (!_ShadowMap)
{
_ShadowMap = new CShadowMap(&(((CSceneUser *) Scene)->getScene().getRenderTrav().getShadowMapManager()));
nlassert(_ShadowMap);
}
_ShadowMap->LocalClipPlanes.resize(4);
CVector corners[4] =
{

@ -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 <MAX_NUM_MODES)
{
CInterfaceManager *pIM= CInterfaceManager::getInstance();
const string procNames[MAX_NUM_MODES] = { "tb_setexp", "tb_setinfo", "tb_setlab", "tb_setkeys" };
const string dbNames[MAX_NUM_MODES] = { "", "UI:SAVE:CURRENT_INFO_MODE", "UI:SAVE:CURRENT_LAB_MODE", "UI:SAVE:CURRENT_KEY_MODE" };
string sValue;
CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(dbNames[desktop], false);
if (pNL != NULL)
sValue = NLMISC::toString((sint32)pNL->getValue64());
vector<string> 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<CGroupContainer*>(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<string> 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<string> vecStr;
vecStr.push_back("tb_setdesktop");
vecStr.push_back(Params);
CWidgetManager::getInstance()->runProcedure("tb_setdesktop", NULL, vecStr);
}
}
private:
bool _FirstTime;

@ -2418,7 +2418,8 @@ void CGroupMap::updateMatchedLandmarks()
std::vector<std::pair<string,string> > params;
params.clear();
params.push_back(std::pair<string,string>("id", toString("lm%d", k)));
params.push_back(std::pair<string,string>("tooltip", _MatchedLandmarks[k].Title.toUtf8()));
// ctrl base expects utf8 string to start with "u:"
params.push_back(std::pair<string,string>("tooltip", "u:" + _MatchedLandmarks[k].Title.toUtf8()));
params.push_back(std::pair<string,string>("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

Loading…
Cancel
Save