Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2016-01-02 22:36:05 +01:00
commit a1ee429b92
7 changed files with 234 additions and 222 deletions

View file

@ -304,9 +304,6 @@ void CFontManager::computeStringInfo ( const ucstring &s,
// *************************************************************************** // ***************************************************************************
string CFontManager::getCacheInformation() const string CFontManager::getCacheInformation() const
{ {
// stringstream ss;
// ss << "MaxMemory: " << (uint) _MaxMemory << " MemSize: " << (uint) _MemSize << " NbChar: " << (uint) _NbChar;
// return ss.str();
string str; string str;
str = "MaxMemory: " + NLMISC::toString(_MaxMemory) + " MemSize: " + NLMISC::toString(_MemSize) + " NbChar: " + NLMISC::toString(_NbChar); str = "MaxMemory: " + NLMISC::toString(_MaxMemory) + " MemSize: " + NLMISC::toString(_MemSize) + " NbChar: " + NLMISC::toString(_NbChar);
return str; return str;

View file

@ -2163,13 +2163,11 @@ uint8 CBitmap::readTGA( NLMISC::IStream &f)
// Determining whether file is in Original or New TGA format // Determining whether file is in Original or New TGA format
bool newTgaFormat;
uint32 extAreaOffset; uint32 extAreaOffset;
uint32 devDirectoryOffset; uint32 devDirectoryOffset;
char signature[16]; char signature[16];
f.seek (0, f.end); f.seek (0, f.end);
newTgaFormat = false;
if (f.getPos() >= 26) if (f.getPos() >= 26)
{ {
f.seek (-26, f.end); f.seek (-26, f.end);
@ -2179,8 +2177,6 @@ uint8 CBitmap::readTGA( NLMISC::IStream &f)
{ {
f.serial(signature[i]); f.serial(signature[i]);
} }
if(strncmp(signature,"TRUEVISION-XFILE",16)==0)
newTgaFormat = true;
} }

View file

@ -37,11 +37,10 @@ SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${CRASHREPORT_MOC_SRC})
SOURCE_GROUP("source files" FILES ${CRASHREPORT_SRC}) SOURCE_GROUP("source files" FILES ${CRASHREPORT_SRC})
SOURCE_GROUP("header files" FILES ${CRASHREPORT_HDR}) SOURCE_GROUP("header files" FILES ${CRASHREPORT_HDR})
ADD_EXECUTABLE(crash_report WIN32 MACOSX_BUNDLE ${CRASHREPORT_SRC} ${CRASHREPORT_HDR} ${CRASHREPORT_MOC_SRC} ${CRASHREPORT_UI_HDR}) ADD_EXECUTABLE(crash_report WIN32 ${CRASHREPORT_SRC} ${CRASHREPORT_HDR} ${CRASHREPORT_MOC_SRC} ${CRASHREPORT_UI_HDR})
TARGET_LINK_LIBRARIES(crash_report ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(crash_report ${QT_LIBRARIES})
NL_DEFAULT_PROPS(crash_report "NeL, Tools, Misc: Crash Report") NL_DEFAULT_PROPS(crash_report "NeL, Tools, Misc: Crash Report")
NL_ADD_RUNTIME_FLAGS(crash_report) NL_ADD_RUNTIME_FLAGS(crash_report)
INSTALL(TARGETS crash_report RUNTIME DESTINATION ${NL_BIN_PREFIX}) INSTALL(TARGETS crash_report RUNTIME DESTINATION ${NL_BIN_PREFIX})

View file

@ -2,7 +2,6 @@
ADD_SUBDIRECTORY(client_sheets) ADD_SUBDIRECTORY(client_sheets)
IF(WITH_RYZOM_CLIENT) IF(WITH_RYZOM_CLIENT)
# These are Windows/MFC apps # These are Windows/MFC apps
SET(SEVENZIP_LIBRARY "ryzom_sevenzip") SET(SEVENZIP_LIBRARY "ryzom_sevenzip")
@ -172,5 +171,4 @@ IF(WITH_PCH AND (NOT MINGW OR NOT WITH_SYMBOLS))
ENDIF() ENDIF()
INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications)
ENDIF() ENDIF()

View file

@ -254,6 +254,43 @@ extern NL3D::UDriver *Driver;
extern CRyzomTime RT; extern CRyzomTime RT;
extern string Cookie; extern string Cookie;
extern string FSAddr; extern string FSAddr;
extern uint64 Debug_OldCPUMask;
extern uint64 Debug_NewCPUMask;
// For multi cpu, active only one CPU for the main thread
void setCPUMask(uint64 userCPUMask)
{
uint64 cpuMask = IProcess::getCurrentProcess()->getCPUMask();
Debug_OldCPUMask = cpuMask;
// if user CPU mask is valid
if (cpuMask & userCPUMask)
{
// use it
IProcess::getCurrentProcess ()->setCPUMask(cpuMask & userCPUMask);
}
else
{
// else get first available CPU
// get the processor to allow process
uint i = 0;
while ((i < 64) && ((cpuMask & (UINT64_CONSTANT(1) << i)) == 0))
i++;
// Set the CPU mask
if (i < 64)
{
IProcess::getCurrentProcess ()->setCPUMask(UINT64_CONSTANT(1) << i);
}
}
// check
cpuMask = IProcess::getCurrentProcess ()->getCPUMask();
Debug_NewCPUMask = cpuMask;
}
#endif #endif
///////////// /////////////
@ -1663,6 +1700,22 @@ void CClientConfig::setValues()
SetPriorityClass (GetCurrentProcess(), priority[index]); SetPriorityClass (GetCurrentProcess(), priority[index]);
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
sint cpuMask;
if (ClientCfg.CPUMask < 1)
{
CTime::CTimerInfo timerInfo;
NLMISC::CTime::probeTimerInfo(timerInfo);
cpuMask = timerInfo.RequiresSingleCore ? 1:0;
}
else
{
cpuMask = ClientCfg.CPUMask;
}
if (cpuMask) setCPUMask(cpuMask);
// Init Verbose Modes (at the beginning to be able to display them as soon as possible). // Init Verbose Modes (at the beginning to be able to display them as soon as possible).
::VerboseVP = ClientCfg.VerboseVP; ::VerboseVP = ClientCfg.VerboseVP;
::VerboseAnimUser = ClientCfg.VerboseAnimUser; ::VerboseAnimUser = ClientCfg.VerboseAnimUser;

View file

@ -374,30 +374,8 @@ void outOfMemory()
nlstopex (("OUT OF MEMORY")); nlstopex (("OUT OF MEMORY"));
} }
// For multi cpu, active only one CPU for the main thread
uint64 Debug_OldCPUMask = 0; uint64 Debug_OldCPUMask = 0;
uint64 Debug_NewCPUMask = 0; uint64 Debug_NewCPUMask = 0;
void setCPUMask ()
{
uint64 cpuMask = IProcess::getCurrentProcess ()->getCPUMask();
Debug_OldCPUMask= cpuMask;
// get the processor to allow process
uint i = 0;
while ((i<64) && ((cpuMask&(SINT64_CONSTANT(1)<<i)) == 0))
i++;
// Set the CPU mask
if (i<64)
{
IProcess::getCurrentProcess ()->setCPUMask(1<<i);
//IThread::getCurrentThread ()->setCPUMask (1<<i);
}
// check
cpuMask = IProcess::getCurrentProcess ()->getCPUMask();
Debug_NewCPUMask= cpuMask;
}
void displayCPUInfo() void displayCPUInfo()
{ {
@ -791,14 +769,25 @@ void prelogInit()
{ {
try try
{ {
H_AUTO ( RZ_Client_Init );
// Assert if no more memory // Assert if no more memory
// NLMEMORY::SetOutOfMemoryHook(outOfMemory); set_new_handler(outOfMemory);
NLMISC_REGISTER_CLASS(CStage);
NLMISC_REGISTER_CLASS(CStageSet);
NLMISC_REGISTER_CLASS(CEntityManager);
NLMISC_REGISTER_CLASS(CCharacterCL);
NLMISC_REGISTER_CLASS(CPlayerCL);
NLMISC_REGISTER_CLASS(CUserEntity);
NLMISC_REGISTER_CLASS(CFxCL);
NLMISC_REGISTER_CLASS(CItemCL);
NLMISC_REGISTER_CLASS(CNamedEntityPositionState);
NLMISC_REGISTER_CLASS(CAnimalPositionState);
// Progress bar for init() and connection() // Progress bar for init() and connection()
ProgressBar.reset (BAR_STEP_INIT_CONNECTION); ProgressBar.reset (BAR_STEP_INIT_CONNECTION);
set_new_handler(outOfMemory);
// save screen saver state and disable it // save screen saver state and disable it
LastScreenSaverEnabled = CSystemUtils::isScreensaverEnabled(); LastScreenSaverEnabled = CSystemUtils::isScreensaverEnabled();
@ -813,37 +802,16 @@ void prelogInit()
_control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM); _control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM);
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
CTime::CTimerInfo timerInfo;
NLMISC::CTime::probeTimerInfo(timerInfo);
if (timerInfo.RequiresSingleCore) // TODO: Also have a FV configuration value to force single core.
setCPUMask();
FPU_CHECKER_ONCE FPU_CHECKER_ONCE
NLMISC::TTime initStart = ryzomGetLocalTime (); NLMISC::TTime initStart = ryzomGetLocalTime ();
H_AUTO ( RZ_Client_Init );
NLMISC_REGISTER_CLASS(CStage);
NLMISC_REGISTER_CLASS(CStageSet);
NLMISC_REGISTER_CLASS(CEntityManager);
NLMISC_REGISTER_CLASS(CCharacterCL);
NLMISC_REGISTER_CLASS(CPlayerCL);
NLMISC_REGISTER_CLASS(CUserEntity);
NLMISC_REGISTER_CLASS(CFxCL);
NLMISC_REGISTER_CLASS(CItemCL);
NLMISC_REGISTER_CLASS(CNamedEntityPositionState);
NLMISC_REGISTER_CLASS(CAnimalPositionState);
// _CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF ); // _CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF );
// Init XML Lib allocator // Init XML Lib allocator
// Due to Bug #906, we disable the stl xml allocation // Due to Bug #906, we disable the stl xml allocation
// nlverify (xmlMemSetup (XmlFree4NeL, XmlMalloc4NeL, XmlRealloc4NeL, XmlStrdup4NeL) == 0); // nlverify (xmlMemSetup (XmlFree4NeL, XmlMalloc4NeL, XmlRealloc4NeL, XmlStrdup4NeL) == 0);
// Init the debug memory
initDebugMemory();
// Add a displayer for Debug Infos. // Add a displayer for Debug Infos.
createDebug(); createDebug();
@ -856,14 +824,24 @@ void prelogInit()
ErrorLog->addDisplayer (ClientLogDisplayer); ErrorLog->addDisplayer (ClientLogDisplayer);
AssertLog->addDisplayer (ClientLogDisplayer); AssertLog->addDisplayer (ClientLogDisplayer);
// Display the client version.
nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str());
// Init the debug memory
initDebugMemory();
// Load the application configuration.
ucstring nmsg("Loading config file...");
ProgressBar.newMessage (nmsg);
ClientCfg.init(ConfigFileName);
CLoginProgressPostThread::getInstance().init(ClientCfg.ConfigFile);
setCrashCallback(crashCallback); setCrashCallback(crashCallback);
// Display Some Info On CPU // Display Some Info On CPU
displayCPUInfo(); displayCPUInfo();
// Display the client version.
nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str());
FPU_CHECKER_ONCE FPU_CHECKER_ONCE
// Set default email value for reporting error // Set default email value for reporting error
@ -881,14 +859,6 @@ void prelogInit()
//ICommand::execute("iFileAccessLogStart",*NLMISC::InfoLog); //ICommand::execute("iFileAccessLogStart",*NLMISC::InfoLog);
#endif #endif
// Load the application configuration.
ucstring nmsg("Loading config file...");
ProgressBar.newMessage (nmsg);
ClientCfg.init(ConfigFileName);
CLoginProgressPostThread::getInstance().init(ClientCfg.ConfigFile);
// check "BuildName" in ClientCfg // check "BuildName" in ClientCfg
//nlassert(!ClientCfg.BuildName.empty()); // TMP comment by nico do not commit //nlassert(!ClientCfg.BuildName.empty()); // TMP comment by nico do not commit

View file

@ -58,7 +58,7 @@ SOURCE_GROUP("Forms" FILES ${CLIENT_CONFIG_UIS})
SOURCE_GROUP("Generated Files" FILES ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_MOC_SRC}) SOURCE_GROUP("Generated Files" FILES ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_MOC_SRC})
SOURCE_GROUP("Translation Files" FILES ${CLIENT_CONFIG_TRANS} ) SOURCE_GROUP("Translation Files" FILES ${CLIENT_CONFIG_TRANS} )
ADD_EXECUTABLE(ryzom_configuration_qt WIN32 MACOSX_BUNDLE ${SRC} ${CLIENT_CONFIG_MOC_SRC} ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_RC_SRCS} ${CLIENT_CONFIG_TRANS} ${CLIENT_CONFIG_QM}) ADD_EXECUTABLE(ryzom_configuration_qt WIN32 ${SRC} ${CLIENT_CONFIG_MOC_SRC} ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_RC_SRCS} ${CLIENT_CONFIG_TRANS} ${CLIENT_CONFIG_QM})
NL_DEFAULT_PROPS(ryzom_configuration_qt "Ryzom, Tools: Ryzom Configuration Qt" ) NL_DEFAULT_PROPS(ryzom_configuration_qt "Ryzom, Tools: Ryzom Configuration Qt" )
NL_ADD_RUNTIME_FLAGS( ryzom_configuration_qt ) NL_ADD_RUNTIME_FLAGS( ryzom_configuration_qt )
NL_ADD_LIB_SUFFIX( ryzom_configuration_qt ) NL_ADD_LIB_SUFFIX( ryzom_configuration_qt )
@ -68,5 +68,4 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(ryzom_configuration_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_configuration_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF() ENDIF()
INSTALL(TARGETS ryzom_configuration_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) INSTALL(TARGETS ryzom_configuration_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client)