Merge branch 'develop' into merge-into-atys

fix-media-player
Nimetu 5 years ago
commit 2d86c5377d

@ -63,25 +63,6 @@ SET(RYZOM_VERSION_MAJOR 3)
SET(RYZOM_VERSION_MINOR 6) SET(RYZOM_VERSION_MINOR 6)
SET(RYZOM_VERSION_PATCH 0) 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 # Redirect output files
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@ -115,6 +96,29 @@ NL_SETUP_BUILD_FLAGS()
NL_SETUP_PREFIX_PATHS() NL_SETUP_PREFIX_PATHS()
RYZOM_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 #Platform specifics

@ -84,14 +84,6 @@ protected:
float *_NormalizationFactor; float *_NormalizationFactor;
bool _DisableSharing; bool _DisableSharing;
bool _ForceNormalize; 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<std::string, CNormalizationInfo> TNameToNI; // sharename to the normalization factor
static TNameToNI _NameToNF; // name to normalization factor
private: 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 /// 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); virtual void setFilterMode(TMagFilter magf, TMinFilter minf);

@ -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) // 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 #define nlassume(exp) do { __analysis_assume(exp); } while (0) // __analysis_assume doesn't evaluate the expression at runtime
#else #else
#define nlassume(exp) do { } while (0) #define nlassume(exp) do { } while (0)
@ -500,6 +500,15 @@ do { \
#endif // NL_NO_DEBUG #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 nlunreferenced(identifier) (void)identifier
#define nlstop \ #define nlstop \

@ -26,9 +26,31 @@
namespace NL3D { 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<std::string, CNormalizationInfo> 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)) #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) /// 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 // create entry in the map for the normalization factor
std::string shareName = getShareName(); std::string shareName = getShareName();
TNameToNI::iterator it = _NameToNF.find(shareName); nlassertverbose(s_NameToNF.Initialized);
if (it == _NameToNF.end()) TNameToNI::iterator it = s_NameToNF.Map.find(shareName);
if (it == s_NameToNF.Map.end())
{ {
// create a new entry // create a new entry
CNormalizationInfo ni; CNormalizationInfo ni;
ni.NumRefs = 1; ni.NumRefs = 1;
ni.NormalizationFactor = normalizationFactor; ni.NormalizationFactor = normalizationFactor;
std::pair<TNameToNI::iterator, bool> pb = _NameToNF.insert(TNameToNI::value_type(shareName, ni)); std::pair<TNameToNI::iterator, bool> pb = s_NameToNF.Map.insert(TNameToNI::value_type(shareName, ni));
_NormalizationFactor = &(pb.first->second.NormalizationFactor); _NormalizationFactor = &(pb.first->second.NormalizationFactor);
} }
else else
@ -303,8 +326,9 @@ float CTextureBump::getNormalizationFactor()
if (!_HeightMap) return 1.f; if (!_HeightMap) return 1.f;
// not computed yet, see if another map has computed it // not computed yet, see if another map has computed it
std::string shareName = getShareName(); std::string shareName = getShareName();
TNameToNI::iterator it = _NameToNF.find(shareName); nlassertverbose(s_NameToNF.Initialized);
if (it != _NameToNF.end()) TNameToNI::iterator it = s_NameToNF.Map.find(shareName);
if (it != s_NameToNF.Map.end())
{ {
_NormalizationFactor = &(it->second.NormalizationFactor); _NormalizationFactor = &(it->second.NormalizationFactor);
++(it->second.NumRefs); ++(it->second.NumRefs);
@ -320,16 +344,16 @@ float CTextureBump::getNormalizationFactor()
///============================================================================================== ///==============================================================================================
CTextureBump::~CTextureBump() CTextureBump::~CTextureBump()
{ {
if (_NormalizationFactor && !_NameToNF.empty()) if (s_NameToNF.Initialized && _NormalizationFactor && !s_NameToNF.Map.empty())
{ {
// find normalization factor from its name // find normalization factor from its name
TNameToNI::iterator it = _NameToNF.find(getShareName()); TNameToNI::iterator it = s_NameToNF.Map.find(getShareName());
// if found // if found
if (it != _NameToNF.end()) if (it != s_NameToNF.Map.end())
{ {
// we can delete it only if it's not used anymore // 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);
} }
} }
} }

@ -697,7 +697,8 @@ static void addPaths(IProgressCallback &progress, const std::vector<std::string>
if (CFile::isDirectory(getRyzomSharePrefix())) directoryPrefixes.push_back(CPath::standardizePath(getRyzomSharePrefix())); if (CFile::isDirectory(getRyzomSharePrefix())) directoryPrefixes.push_back(CPath::standardizePath(getRyzomSharePrefix()));
#endif #endif
std::map<std::string, sint> directoriesToProcess; std::set<std::string> directoriesToProcessSet;
std::vector<std::string> directoriesToProcess;
// first pass, build a map with all existing directories to process in second pass // first pass, build a map with all existing directories to process in second pass
for (uint j = 0; j < directoryPrefixes.size(); j++) for (uint j = 0; j < directoryPrefixes.size(); j++)
@ -710,36 +711,29 @@ static void addPaths(IProgressCallback &progress, const std::vector<std::string>
// only prepend prefix if path is relative // only prepend prefix if path is relative
if (!directory.empty() && !directoryPrefix.empty() && !CPath::isAbsolutePath(directory)) if (!directory.empty() && !directoryPrefix.empty() && !CPath::isAbsolutePath(directory))
directory = directoryPrefix + directory; directory = directoryPrefix + directory;
// only process existing directories // only process existing directories
if (CFile::isExists(directory)) 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<std::string, sint>::const_iterator it = directoriesToProcess.begin(), iend = directoriesToProcess.end();
// second pass, add search paths // second pass, add search paths
while (it != iend) for (size_t i = 0; i < directoriesToProcess.size(); ++i)
{ {
// update next progress value progress.progress((float)i / (float)directoriesToProcess.size());
++next; progress.pushCropedValues((float)i / (float)directoriesToProcess.size(), (float)(i + 1) / (float)directoriesToProcess.size());
progress.progress((float)current/(float)total);
progress.pushCropedValues((float)current/(float)total, (float)next/(float)total);
// next is current value CPath::addSearchPath(directoriesToProcess[i], recurse, false, &progress);
current = next;
CPath::addSearchPath(it->first, recurse, false, &progress);
progress.popCropedValues(); progress.popCropedValues();
++it;
} }
} }

@ -243,7 +243,13 @@ void CDynamicMapClientEventForwarder::nodeMoved(
void CDynamicMapClientEventForwarder::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialActIndex) void CDynamicMapClientEventForwarder::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialActIndex)
{ {
//H_AUTO(R2_CDynamicMapClientEventForwarder_scenarioUpdated) //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); getEditor().scenarioUpdated(highLevel, willTP, initialActIndex);
} }
@ -5708,6 +5714,7 @@ void CEditor::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialAct
if (_WaitScenarioScreenActive) if (_WaitScenarioScreenActive)
{ {
// defer scenario update to the end of the wait screen // defer scenario update to the end of the wait screen
nlassert(!_NewScenario);
_NewScenario = highLevel ? highLevel->clone() : NULL; _NewScenario = highLevel ? highLevel->clone() : NULL;
_NewScenarioInitialAct = initialActIndex; _NewScenarioInitialAct = initialActIndex;
_PostponeScenarioUpdated = true; _PostponeScenarioUpdated = true;

Loading…
Cancel
Save