Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2015-11-06 15:49:55 +01:00
commit f095121991
10 changed files with 130 additions and 77 deletions

View file

@ -366,7 +366,7 @@ namespace NLGUI
bool _Connecting;
double _TimeoutValue; // the timeout in seconds
double _ConnectingTimeout;
uint32 _RedirectsRemaining;
sint _RedirectsRemaining;
// minimal embeded lua script support
// Note : any embeded script is executed immediately after the closing

View file

@ -1781,13 +1781,19 @@ void registerGlExtensions(CGlExtensions &ext)
// GPU_MEMORY_INFO_EVICTED_MEMORY_NVX;
GLint nDedicatedMemoryInKB = 0;
#ifdef GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &nDedicatedMemoryInKB);
#endif
GLint nTotalMemoryInKB = 0;
#ifdef GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &nTotalMemoryInKB);
#endif
GLint nCurAvailMemoryInKB = 0;
#ifdef GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &nCurAvailMemoryInKB);
#endif
nlinfo("Memory: total: %d available: %d dedicated: %d", nTotalMemoryInKB, nCurAvailMemoryInKB, nDedicatedMemoryInKB);
}

View file

@ -1961,6 +1961,7 @@ namespace NLGUI
}
while (cb);
}
// Check if screen size changed
uint32 w, h;
CViewRenderer::getInstance()->checkNewScreenSize ();
@ -1983,6 +1984,7 @@ namespace NLGUI
_BProp = CDBManager::getInstance()->getDbProp("UI:SAVE:COLOR:B");
_AProp = CDBManager::getInstance()->getDbProp("UI:SAVE:COLOR:A");
}
setGlobalColor(NLMISC::CRGBA(
(uint8)_RProp->getValue32(),
(uint8)_GProp->getValue32(),

View file

@ -49,7 +49,7 @@ void xmlCheckNodeName (xmlNodePtr &node, const char *nodeName)
// Make an error message
char tmp[512];
smprintf (tmp, 512, "LogicStateMachine STATE_MACHINE XML Syntax error in block line %d, node %s should be %s",
(int)node->line, node->name, nodeName);
node ? (int)node->line:-1, node->name, nodeName);
nlinfo (tmp);
nlstop;

View file

@ -700,6 +700,9 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m
# endif
abort();
break;
default:
break;
}
// no more sent mail for crash

View file

@ -784,7 +784,7 @@ bool NLPACS::CGlobalRetriever::buildInstance(const string &id, const NLMISC::C
const CRetrieverInstance &instance = makeInstance(retrieverId, 0, CVector(position));
// check make instance success
if (&instance == NULL || instance.getInstanceId() == -1 || instance.getRetrieverId() != retrieverId)
if (instance.getInstanceId() == -1 || instance.getRetrieverId() != retrieverId)
return false;
// links new instance to its neighbors

View file

@ -1950,8 +1950,14 @@ void CInterfaceManager::drawViews(NL3D::UCamera camera)
nlctassert(CHARACTERISTICS::NUM_CHARACTERISTICS==8);
for (uint i=0; i<CHARACTERISTICS::NUM_CHARACTERISTICS; ++i)
{
NLMISC::CCDBNodeLeaf *node = _CurrentPlayerCharacLeaf[i] ? &*_CurrentPlayerCharacLeaf[i]
: &*(_CurrentPlayerCharacLeaf[i] = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:CHARACTER_INFO:CHARACTERISTICS%d:VALUE", i), false));
if (!_CurrentPlayerCharacLeaf[i])
_CurrentPlayerCharacLeaf[i] = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:CHARACTER_INFO:CHARACTERISTICS%d:VALUE", i), false);
NLMISC::CCDBNodeLeaf *node = NULL;
if (_CurrentPlayerCharacLeaf[i])
node = &*_CurrentPlayerCharacLeaf[i];
_CurrentPlayerCharac[i] = node ? node->getValue32() : 0;
}

View file

@ -3883,32 +3883,69 @@ bool CNetManager::update()
CInterfaceManager *im = CInterfaceManager::getInstance();
if (im)
{
CCDBNodeLeaf *node = m_PingLeaf ? &*m_PingLeaf
: &*(m_PingLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PING", false));
CCDBNodeLeaf *node = NULL;
if (!m_PingLeaf)
m_PingLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PING", false);
if (m_PingLeaf)
{
node = &*m_PingLeaf;
if (node)
node->setValue32(getPing());
node = m_UploadLeaf ? &*m_UploadLeaf
: &*(m_UploadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:UPLOAD", false));
}
if (!m_UploadLeaf)
m_UploadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:UPLOAD", false);
if (m_UploadLeaf)
{
node = &*m_UploadLeaf;
if (node)
node->setValue32((sint32)(getMeanUpload()*1024.f/8.f));
node = m_DownloadLeaf ? &*m_DownloadLeaf
: &*(m_DownloadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:DOWNLOAD", false));
}
if (!m_DownloadLeaf)
m_DownloadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:DOWNLOAD", false);
if (m_DownloadLeaf)
{
node = &*m_DownloadLeaf;
if (node)
node->setValue32((sint32)(getMeanDownload()*1024.f/8.f));
node = m_PacketLostLeaf ? &* m_PacketLostLeaf
: &*(m_PacketLostLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PACKETLOST", false));
}
if (!m_PacketLostLeaf)
m_PacketLostLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PACKETLOST", false);
if (m_PacketLostLeaf)
{
node = &*m_PacketLostLeaf;
if (node)
node->setValue32((sint32)getMeanPacketLoss());
node = m_ServerStateLeaf ? &*m_ServerStateLeaf
: &*(m_ServerStateLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SERVERSTATE", false));
}
if (!m_ServerStateLeaf)
m_ServerStateLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SERVERSTATE", false);
if (m_ServerStateLeaf)
{
node = &*m_ServerStateLeaf;
if (node)
node->setValue32((sint32)getConnectionState());
node = m_ConnectionQualityLeaf ? &*m_ConnectionQualityLeaf
: &*(m_ConnectionQualityLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CONNECTION_QUALITY", false));
}
if (!m_ConnectionQualityLeaf)
m_ConnectionQualityLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CONNECTION_QUALITY", false);
if (m_ConnectionQualityLeaf)
{
node = &*m_ConnectionQualityLeaf;
if (node)
node->setValue32((sint32)getConnectionQuality());
}
}
}
// Return 'true' if data were sent/received.
return result;

View file

@ -396,7 +396,7 @@ bool CSkyObject::setup(const CClientDate &date, const CClientDate &animationDate
for(uint k = 0; k < SKY_MAX_NUM_STAGE; ++k)
{
if (TexPanner[k].U != 0.f || TexPanner[k].V != 0.f ||
OffsetUBitmap != NULL || OffsetVBitmap != NULL )
OffsetUBitmap[k] != NULL || OffsetVBitmap[k] != NULL )
{
//nlinfo("global date = %f", animTime);
// there's tex panning for that stage

View file

@ -425,7 +425,8 @@ inline void CCallStackSingleton::setTopStackEntry(ICallStackEntry* newEntry)
inline void CCallStackSingleton::display(NLMISC::CLog *log)
{
nlassert(log!=NULL);
getTopStackEntry()->displayStack(*log);
ICallStackEntry *entry = getTopStackEntry();
if (entry) entry->displayStack(*log);
log->displayNL("");
}
@ -468,15 +469,13 @@ inline ICallStackEntry::~ICallStackEntry()
inline void ICallStackEntry::displayStack(NLMISC::CLog& log) const
{
// stop recursing when we reach a NULL object
// (this is implemented in this way in order to ximplify call code)
if (this==NULL)
return;
// (this is implemented in this way in order to simplify call code)
// display this entry
displayEntry(log);
// recurse through call stack
_Next->displayStack(log);
if (_Next) _Next->displayStack(log);
}