diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 83c58a924..f2ac5f69b 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -63,25 +63,6 @@ SET(RYZOM_VERSION_MAJOR 3) SET(RYZOM_VERSION_MINOR 6) SET(RYZOM_VERSION_PATCH 0) -SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Create Account URL") -SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Edit Account URL") -SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Forget Password URL") -SET(RYZOM_CLIENT_PATCH_URL "https://cdn.ryzom.dev/open/patch/" CACHE STRING "Ryzom Client Patch URL") - -SET(RYZOM_WEBIG_MAIN_URL "https://open.ryzom.dev/" CACHE STRING "Ryzom Client WebIG Main URL") -SET(RYZOM_WEBIG_TRUSTED_DOMAIN "open.ryzom.dev" CACHE STRING "Ryzom Client WebIG Trusted Domain") - -# urls when compiling ryzom live client -IF(WITH_RYZOM_LIVE) - SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://account.ryzom.com/signup/from_client.php") - SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://account.ryzom.com/payment_profile/index.php") - SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://account.ryzom.com/payment_profile/lost_secure_password.php") - SET(RYZOM_CLIENT_PATCH_URL "http://dl.ryzom.com/patch_live") - - SET(RYZOM_WEBIG_MAIN_URL "https://app.ryzom.com/") - SET(RYZOM_WEBIG_TRUSTED_DOMAIN "app.ryzom.com") -ENDIF() - #----------------------------------------------------------------------------- # Redirect output files SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -115,6 +96,29 @@ NL_SETUP_BUILD_FLAGS() NL_SETUP_PREFIX_PATHS() RYZOM_SETUP_PREFIX_PATHS() +#----------------------------------------------------------------------------- +# Default values for URL's +SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Create Account URL") +SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Edit Account URL") +SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Forget Password URL") +SET(RYZOM_CLIENT_PATCH_URL "https://cdn.ryzom.dev/open/patch/" CACHE STRING "Ryzom Client Patch URL") + +SET(RYZOM_WEBIG_MAIN_URL "https://open.ryzom.dev/" CACHE STRING "Ryzom Client WebIG Main URL") +SET(RYZOM_WEBIG_TRUSTED_DOMAIN "open.ryzom.dev" CACHE STRING "Ryzom Client WebIG Trusted Domain") + +#----------------------------------------------------------------------------- +# urls when compiling ryzom live client +IF(WITH_RYZOM_LIVE) + MESSAGE("Using RYZOM_LIVE urls") + SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://account.ryzom.com/signup/from_client.php") + SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://account.ryzom.com/payment_profile/index.php") + SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://account.ryzom.com/payment_profile/lost_secure_password.php") + SET(RYZOM_CLIENT_PATCH_URL "http://dl.ryzom.com/patch_live") + + SET(RYZOM_WEBIG_MAIN_URL "https://app.ryzom.com/") + SET(RYZOM_WEBIG_TRUSTED_DOMAIN "app.ryzom.com") +ENDIF() + #----------------------------------------------------------------------------- #Platform specifics diff --git a/code/nel/include/nel/3d/texture_bump.h b/code/nel/include/nel/3d/texture_bump.h index 1fb6152de..1c1f2a245 100644 --- a/code/nel/include/nel/3d/texture_bump.h +++ b/code/nel/include/nel/3d/texture_bump.h @@ -84,14 +84,6 @@ protected: float *_NormalizationFactor; bool _DisableSharing; bool _ForceNormalize; - // Map that give the normalization factor for each map from its sharename. This avoid to generate several time the maps to get the normalization factor if a bumpmap is shared by severals CTextureBump instances; - struct CNormalizationInfo - { - uint NumRefs; - float NormalizationFactor; - }; - typedef std::map TNameToNI; // sharename to the normalization factor - static TNameToNI _NameToNF; // name to normalization factor private: /// we don't allow for mipmap for bump so we redefine this to prevent the user from doing this on the base class Itexture virtual void setFilterMode(TMagFilter magf, TMinFilter minf); diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index fa32e6b96..a8c23eced 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -368,7 +368,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); // removed because we always check assert (even in release mode) #if defined(NL_DEBUG) -#if defined(_MSC_VER) && _MSC_VER >= 1900 +#if defined(_MSC_VER) && _MSC_VER >= 1500 #define nlassume(exp) do { __analysis_assume(exp); } while (0) // __analysis_assume doesn't evaluate the expression at runtime #else #define nlassume(exp) do { } while (0) @@ -500,6 +500,15 @@ do { \ #endif // NL_NO_DEBUG +// Same as nlassert and nlverify, but only in DEV build +#if !FINAL_VERSION +#define nlassertverbose(exp) nlassert(exp) +#define nlverifyverbose(exp) nlverify(exp) +#else +#define nlassertverbose(exp) nlassume(exp) +#define nlverifyverbose(exp) do { exp; nlassume(exp); } while (0) +#endif + #define nlunreferenced(identifier) (void)identifier #define nlstop \ diff --git a/code/nel/src/3d/texture_bump.cpp b/code/nel/src/3d/texture_bump.cpp index 3707476b2..7705a58fa 100644 --- a/code/nel/src/3d/texture_bump.cpp +++ b/code/nel/src/3d/texture_bump.cpp @@ -26,9 +26,31 @@ namespace NL3D { +namespace /* anonymous */ { -CTextureBump::TNameToNI CTextureBump::_NameToNF; +// Map that give the normalization factor for each map from its sharename. This avoid to generate several time the maps to get the normalization factor if a bumpmap is shared by severals CTextureBump instances; +struct CNormalizationInfo +{ + uint NumRefs; + float NormalizationFactor; +}; +typedef std::map TNameToNI; // sharename to the normalization factor +class CNameToNFStatic { +public: + TNameToNI Map; + bool Initialized; + CNameToNFStatic() : Initialized(true) + { + + } + ~CNameToNFStatic() + { + Initialized = false; + } +}; +CNameToNFStatic s_NameToNF; +} /* anonymous namespace */ #define GET_HGT(x, y) ((sint) ((src[(uint) (x) % width + ((uint) (y) % height) * width] & 0x00ff00) >> 8)) /// create a DsDt texture from a height map (red component of a rgba bitmap) @@ -242,14 +264,15 @@ void CTextureBump::doGenerate(bool async) } // create entry in the map for the normalization factor std::string shareName = getShareName(); - TNameToNI::iterator it = _NameToNF.find(shareName); - if (it == _NameToNF.end()) + nlassertverbose(s_NameToNF.Initialized); + TNameToNI::iterator it = s_NameToNF.Map.find(shareName); + if (it == s_NameToNF.Map.end()) { // create a new entry CNormalizationInfo ni; ni.NumRefs = 1; ni.NormalizationFactor = normalizationFactor; - std::pair pb = _NameToNF.insert(TNameToNI::value_type(shareName, ni)); + std::pair pb = s_NameToNF.Map.insert(TNameToNI::value_type(shareName, ni)); _NormalizationFactor = &(pb.first->second.NormalizationFactor); } else @@ -303,8 +326,9 @@ float CTextureBump::getNormalizationFactor() if (!_HeightMap) return 1.f; // not computed yet, see if another map has computed it std::string shareName = getShareName(); - TNameToNI::iterator it = _NameToNF.find(shareName); - if (it != _NameToNF.end()) + nlassertverbose(s_NameToNF.Initialized); + TNameToNI::iterator it = s_NameToNF.Map.find(shareName); + if (it != s_NameToNF.Map.end()) { _NormalizationFactor = &(it->second.NormalizationFactor); ++(it->second.NumRefs); @@ -320,16 +344,16 @@ float CTextureBump::getNormalizationFactor() ///============================================================================================== CTextureBump::~CTextureBump() { - if (_NormalizationFactor && !_NameToNF.empty()) + if (s_NameToNF.Initialized && _NormalizationFactor && !s_NameToNF.Map.empty()) { // find normalization factor from its name - TNameToNI::iterator it = _NameToNF.find(getShareName()); + TNameToNI::iterator it = s_NameToNF.Map.find(getShareName()); // if found - if (it != _NameToNF.end()) + if (it != s_NameToNF.Map.end()) { // we can delete it only if it's not used anymore - if (--(it->second.NumRefs) == 0) _NameToNF.erase(it); + if (--(it->second.NumRefs) == 0) s_NameToNF.Map.erase(it); } } } diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 1deacd146..efc137ee6 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -697,7 +697,8 @@ static void addPaths(IProgressCallback &progress, const std::vector if (CFile::isDirectory(getRyzomSharePrefix())) directoryPrefixes.push_back(CPath::standardizePath(getRyzomSharePrefix())); #endif - std::map directoriesToProcess; + std::set directoriesToProcessSet; + std::vector directoriesToProcess; // first pass, build a map with all existing directories to process in second pass for (uint j = 0; j < directoryPrefixes.size(); j++) @@ -710,36 +711,29 @@ static void addPaths(IProgressCallback &progress, const std::vector // only prepend prefix if path is relative if (!directory.empty() && !directoryPrefix.empty() && !CPath::isAbsolutePath(directory)) - directory = directoryPrefix + directory; + directory = directoryPrefix + directory; // only process existing directories if (CFile::isExists(directory)) - directoriesToProcess[directory] = 1; + { + if (directoriesToProcessSet.find(directory) == directoriesToProcessSet.end()) + { + directoriesToProcessSet.insert(directory); + directoriesToProcess.push_back(directory); + } + } } } - uint total = (uint)directoriesToProcess.size(); - uint current = 0, next = 0; - - std::map::const_iterator it = directoriesToProcess.begin(), iend = directoriesToProcess.end(); - // second pass, add search paths - while (it != iend) + for (size_t i = 0; i < directoriesToProcess.size(); ++i) { - // update next progress value - ++next; - - progress.progress((float)current/(float)total); - progress.pushCropedValues((float)current/(float)total, (float)next/(float)total); + progress.progress((float)i / (float)directoriesToProcess.size()); + progress.pushCropedValues((float)i / (float)directoriesToProcess.size(), (float)(i + 1) / (float)directoriesToProcess.size()); - // next is current value - current = next; - - CPath::addSearchPath(it->first, recurse, false, &progress); + CPath::addSearchPath(directoriesToProcess[i], recurse, false, &progress); progress.popCropedValues(); - - ++it; } } diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index e97cbf4a5..457cee562 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -243,7 +243,13 @@ void CDynamicMapClientEventForwarder::nodeMoved( void CDynamicMapClientEventForwarder::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialActIndex) { //H_AUTO(R2_CDynamicMapClientEventForwarder_scenarioUpdated) - if (getEditor().getMode() != CEditor::EditionMode) return; + if (getEditor().getMode() != CEditor::EditionMode + && getEditor().getMode() != CEditor::GoingToEditionMode /* New scenario */ + && getEditor().getMode() != CEditor::AnimationModeLoading /* Loading animation scenario from terminal */) + { + nldebug("Scenario update received, but not in edition mode"); + return; + } getEditor().scenarioUpdated(highLevel, willTP, initialActIndex); } @@ -5708,6 +5714,7 @@ void CEditor::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialAct if (_WaitScenarioScreenActive) { // defer scenario update to the end of the wait screen + nlassert(!_NewScenario); _NewScenario = highLevel ? highLevel->clone() : NULL; _NewScenarioInitialAct = initialActIndex; _PostponeScenarioUpdated = true;