Merge with develop

This commit is contained in:
kervala 2016-10-25 17:41:54 +02:00
parent dc9c463483
commit 956da7f9da
17 changed files with 63 additions and 68 deletions

View file

@ -61,6 +61,10 @@ public:
sint32 Top; // Distance between origin and top of the texture sint32 Top; // Distance between origin and top of the texture
sint32 Left; // Distance between origin and left of the texture sint32 Left; // Distance between origin and left of the texture
sint32 AdvX; // Advance to the next caracter sint32 AdvX; // Advance to the next caracter
SLetterInfo():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false), Next(NULL), Prev(NULL), Cat(0), CharWidth(0), CharHeight(0), GlyphIndex(0), Top(0), Left(0), AdvX(0)
{
}
}; };
struct SLetterKey struct SLetterKey
@ -74,6 +78,10 @@ public:
uint32 getVal(); uint32 getVal();
//bool operator < (const SLetterKey&k) const; //bool operator < (const SLetterKey&k) const;
//bool operator == (const SLetterKey&k) const; //bool operator == (const SLetterKey&k) const;
SLetterKey():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false)
{
}
}; };
public: public:

View file

@ -320,7 +320,7 @@ public:
// For edition: change the tileVegetableDesc. NB: only the TileVegetableDescFileName is serialised. // For edition: change the tileVegetableDesc. NB: only the TileVegetableDescFileName is serialised.
void setTileVegetableDesc (const CTileVegetableDesc &tvd); void setTileVegetableDesc (const CTileVegetableDesc &tvd);
/** try to load the vegetable tile desc associated with the fileName (nlinfo() if can't) /** try to load the vegetable tile desc associated with the fileName (nlinfo() if can't)
* lookup into CPath. no-op if string=="". * lookup into CPath. no-op if string empty
*/ */
void loadTileVegetableDesc(); void loadTileVegetableDesc();

View file

@ -1831,9 +1831,9 @@ void CLandscape::loadTile(uint16 tileId)
if(tile) if(tile)
textName= tile->getRelativeFileName(CTile::additive); textName= tile->getRelativeFileName(CTile::additive);
else else
textName= ""; textName.clear();
// If no additive for this tile, rdrpass is NULL. // If no additive for this tile, rdrpass is NULL.
if(textName=="") if(textName.empty())
tileInfo->AdditiveRdrPass= NULL; tileInfo->AdditiveRdrPass= NULL;
else else
{ {
@ -1844,7 +1844,7 @@ void CLandscape::loadTile(uint16 tileId)
// We may have an alpha part for additive. // We may have an alpha part for additive.
textName= tile->getRelativeFileName (CTile::alpha); textName= tile->getRelativeFileName (CTile::alpha);
if(textName!="") if(!textName.empty())
// Must Use clamp for alpha (although NVidia drivers are buggy), because the texture doesn't tile at all // Must Use clamp for alpha (although NVidia drivers are buggy), because the texture doesn't tile at all
pass.TextureAlpha= findTileTexture(TileBank.getAbsPath()+textName, true); pass.TextureAlpha= findTileTexture(TileBank.getAbsPath()+textName, true);
@ -1866,7 +1866,7 @@ void CLandscape::loadTile(uint16 tileId)
if(tile) if(tile)
{ {
textName= tile->getRelativeFileName(CTile::diffuse); textName= tile->getRelativeFileName(CTile::diffuse);
if(textName!="") if(!textName.empty())
// Avoid using Clamp for diffuse, because of recent NVidia GL drivers Bugs in 77.72 // Avoid using Clamp for diffuse, because of recent NVidia GL drivers Bugs in 77.72
pass.TextureDiffuse= findTileTexture(TileBank.getAbsPath()+textName, false); pass.TextureDiffuse= findTileTexture(TileBank.getAbsPath()+textName, false);
else else
@ -1880,7 +1880,7 @@ void CLandscape::loadTile(uint16 tileId)
if(tile) if(tile)
{ {
textName= tile->getRelativeFileName (CTile::alpha); textName= tile->getRelativeFileName (CTile::alpha);
if(textName!="") if(!textName.empty())
// Must Use clamp for alpha (although NVidia drivers are buggy), because the texture doesn't tile at all // Must Use clamp for alpha (although NVidia drivers are buggy), because the texture doesn't tile at all
pass.TextureAlpha= findTileTexture(TileBank.getAbsPath()+textName, true); pass.TextureAlpha= findTileTexture(TileBank.getAbsPath()+textName, true);
} }

View file

@ -174,7 +174,7 @@ UInstanceGroup *CLandscapeIGManager::loadZoneIG(const std::string &name)
{ {
NL3D_HAUTO_LAND_MNGR_LOAD_ZONEIG NL3D_HAUTO_LAND_MNGR_LOAD_ZONEIG
if(name=="") if(name.empty())
return NULL; return NULL;
// try to find this InstanceGroup. // try to find this InstanceGroup.
@ -232,7 +232,7 @@ void CLandscapeIGManager::unloadArrayZoneIG(const std::vector<std::string> &name
void CLandscapeIGManager::unloadZoneIG(const std::string &name) void CLandscapeIGManager::unloadZoneIG(const std::string &name)
{ {
NL3D_HAUTO_LAND_MNGR_UNLOAD_ZONEIG NL3D_HAUTO_LAND_MNGR_UNLOAD_ZONEIG
if(name=="") if(name.empty())
return; return;
// try to find this InstanceGroup. // try to find this InstanceGroup.
@ -255,7 +255,7 @@ void CLandscapeIGManager::unloadZoneIG(const std::string &name)
// *************************************************************************** // ***************************************************************************
bool CLandscapeIGManager::isIGAddedToScene(const std::string &name) const bool CLandscapeIGManager::isIGAddedToScene(const std::string &name) const
{ {
if(name=="") if(name.empty())
return false; return false;
// try to find this InstanceGroup. // try to find this InstanceGroup.
@ -272,7 +272,7 @@ bool CLandscapeIGManager::isIGAddedToScene(const std::string &name) const
// *************************************************************************** // ***************************************************************************
UInstanceGroup *CLandscapeIGManager::getIG(const std::string &name) const UInstanceGroup *CLandscapeIGManager::getIG(const std::string &name) const
{ {
if(name=="") if(name.empty())
return NULL; return NULL;
// try to find this InstanceGroup. // try to find this InstanceGroup.

View file

@ -573,10 +573,11 @@ bool CInstanceGroup::addToScene (CScene& scene, IDriver *driver, uint selectedTe
else else
{ {
_Instances[i] = scene.createInstance (shapeName); _Instances[i] = scene.createInstance (shapeName);
}
if( _Instances[i] == NULL ) if (_Instances[i] == NULL)
{ {
nlwarning("Not found '%s' file", shapeName.c_str()); nlwarning("Not found '%s' file", shapeName.c_str());
}
} }
} }
} }

View file

@ -264,7 +264,7 @@ sint CTileBank::getNumBitmap (CTile::TBitmap bitmap) const
if (!_TileVector[i].isFree()) if (!_TileVector[i].isFree())
{ {
const std::string &str=_TileVector[i].getRelativeFileName (bitmap); const std::string &str=_TileVector[i].getRelativeFileName (bitmap);
if (str!="") if (!str.empty())
{ {
std::vector<char> vect (str.length()+1); std::vector<char> vect (str.length()+1);
memcpy (&*vect.begin(), str.c_str(), str.length()+1); memcpy (&*vect.begin(), str.c_str(), str.length()+1);
@ -583,7 +583,7 @@ void CTileBank::removeDisplacementMap (uint mapId)
if (mapId==_DisplacementMap.size()-1) if (mapId==_DisplacementMap.size()-1)
{ {
// Resize the array ? // Resize the array ?
while ((mapId>0)&&(_DisplacementMap[mapId]._FileName=="")) while ((mapId>0)&&(_DisplacementMap[mapId]._FileName.empty()))
_DisplacementMap.resize (mapId--); _DisplacementMap.resize (mapId--);
} }
} }
@ -608,7 +608,7 @@ uint CTileBank::getDisplacementMap (const string &fileName)
for (noiseTile=0; noiseTile<_DisplacementMap.size(); noiseTile++) for (noiseTile=0; noiseTile<_DisplacementMap.size(); noiseTile++)
{ {
// Same name ? // Same name ?
if (_DisplacementMap[noiseTile]._FileName=="") if (_DisplacementMap[noiseTile]._FileName.empty())
break; break;
} }
if (noiseTile==_DisplacementMap.size()) if (noiseTile==_DisplacementMap.size())
@ -1433,7 +1433,7 @@ void CTileSet::deleteBordersIfLast (const CTileBank& bank, CTile::TBitmap type)
while (ite!=_Tile128.end()) while (ite!=_Tile128.end())
{ {
// If the file name is valid // If the file name is valid
if (bank.getTile (*ite)->getRelativeFileName(type)!="") if (!bank.getTile (*ite)->getRelativeFileName(type).empty())
{ {
// Don't delete, // Don't delete,
bDelete=false; bDelete=false;
@ -1450,7 +1450,7 @@ void CTileSet::deleteBordersIfLast (const CTileBank& bank, CTile::TBitmap type)
while (ite!=_Tile256.end()) while (ite!=_Tile256.end())
{ {
// If the file name is valid // If the file name is valid
if (bank.getTile (*ite)->getRelativeFileName(type)!="") if (!bank.getTile (*ite)->getRelativeFileName(type).empty())
{ {
// Don't delete, // Don't delete,
bDelete=false; bDelete=false;
@ -1474,7 +1474,7 @@ void CTileSet::deleteBordersIfLast (const CTileBank& bank, CTile::TBitmap type)
if (nTile!=-1) if (nTile!=-1)
{ {
// If the file name is valid // If the file name is valid
if (bank.getTile (nTile)->getRelativeFileName(type)!="") if (!bank.getTile (nTile)->getRelativeFileName(type).empty())
{ {
// Don't delete, // Don't delete,
bDelete=false; bDelete=false;
@ -1564,7 +1564,7 @@ const CTileVegetableDesc &CTileSet::getTileVegetableDesc() const
// *************************************************************************** // ***************************************************************************
void CTileSet::loadTileVegetableDesc() void CTileSet::loadTileVegetableDesc()
{ {
if(_TileVegetableDescFileName!="") if(!_TileVegetableDescFileName.empty())
{ {
try try
{ {

View file

@ -1221,7 +1221,7 @@ void NLPACS::CGlobalRetriever::findCollisionChains(CCollisionSurfaceTemp &cst, c
if (!localRetriever.isLoaded()) if (!localRetriever.isLoaded())
{ {
nlwarning("local retriever %d in %s not loaded, findCollisionChains in this retriever aborted", localRetrieverId, _RetrieverBank->getNamePrefix().c_str()); nldebug("local retriever %d in %s not loaded, findCollisionChains in this retriever aborted", localRetrieverId, _RetrieverBank->getNamePrefix().c_str());
continue; continue;
} }

View file

@ -1797,7 +1797,7 @@ void CAudioMixerUser::addSource( CSourceCommon *source )
_Sources.insert( source ); _Sources.insert( source );
// _profile(( "AM: ADDSOURCE, SOUND: %d, TRACK: %p, NAME=%s", source->getSound(), source->getTrack(), // _profile(( "AM: ADDSOURCE, SOUND: %d, TRACK: %p, NAME=%s", source->getSound(), source->getTrack(),
// source->getSound() && (source->getSound()->getName()!="") ? source->getSound()->getName().c_str() : "" )); // source->getSound() && (!source->getSound()->getName().empty()) ? source->getSound()->getName().c_str() : "" ));
} }

View file

@ -2798,7 +2798,7 @@ class CAHScenarioControl : public IActionHandler
// description // description
string description = sessionBrowser._LastDescription; string description = sessionBrowser._LastDescription;
if(description!="") if(!description.empty())
{ {
result = scenarioWnd->findFromShortId(string("edit_small_description")); result = scenarioWnd->findFromShortId(string("edit_small_description"));
if(result) if(result)

View file

@ -171,7 +171,7 @@ public:
// hide every static fxs // hide every static fxs
void hideStaticFXs(); void hideStaticFXs();
// Create the loading instance. return false if shapeName!="" while still fails to load. else return true. // Create the loading instance. return false if shapeName is not empty while still fails to load. else return true.
bool createLoading(const std::string &shapeName, const std::string &stickPoint=std::string(""), sint texture=-1, bool clearIfFail= true); bool createLoading(const std::string &shapeName, const std::string &stickPoint=std::string(""), sint texture=-1, bool clearIfFail= true);
// Apply Colors // Apply Colors

View file

@ -2661,7 +2661,7 @@ class CAHOnCreateAccountSubmit : public IActionHandler
for(uint i=0; i<errors.size(); i++) for(uint i=0; i<errors.size(); i++)
{ {
string comment = parseCommentError(res, errors[i]); string comment = parseCommentError(res, errors[i]);
if(comment!="") if(!comment.empty())
error += "- " + comment + "\n"; error += "- " + comment + "\n";
} }

View file

@ -993,7 +993,7 @@ void CDisplayerVisualEntity::updateName()
else else
actName = act->toString("Title"); //obsolete actName = act->toString("Title"); //obsolete
if(actName!=firstPart && actName!="") if(actName!=firstPart && !actName.empty())
actName = firstPart+":"+actName; actName = firstPart+":"+actName;
} }
else else

View file

@ -385,7 +385,7 @@ void CScenarioEntryPoints::loadFromXMLFile()
shortEntryPoint.Y = entryPoint.Y; shortEntryPoint.Y = entryPoint.Y;
entryPoints.push_back(shortEntryPoint); entryPoints.push_back(shortEntryPoint);
if(package=="") if(package.empty())
package=entryPoint.Package; package=entryPoint.Package;
else if(package!=entryPoint.Package) else if(package!=entryPoint.Package)
nlinfo("Different packages for island '%s' in file %s", island, _EntryPointsFilename.c_str()); nlinfo("Different packages for island '%s' in file %s", island, _EntryPointsFilename.c_str());

View file

@ -225,7 +225,7 @@ void CStringTableManager::setValue(uint32 tableId,const std::string& localId, co
if(found2!=localTable->end()) if(found2!=localTable->end())
{ {
std::string oldValue = _StringMgr.getString(found2->second); std::string oldValue = _StringMgr.getString(found2->second);
if (oldValue=="") nlwarning("error! no string %u in string manager! ",found2->second); if (oldValue.empty()) nlwarning("error! no string %u in string manager! ",found2->second);
_StringMgr.unregisterString(oldValue); _StringMgr.unregisterString(oldValue);
found2->second = _StringMgr.registerString(value); found2->second = _StringMgr.registerString(value);
} }

View file

@ -469,7 +469,7 @@ static std::string formatString(std::string str,std::vector<float> args)
void CStringManagerModule::translateAndForwardWithArg(TDataSetRow senderId,CChatGroup::TGroupType groupType,std::string id,TSessionId sessionId,std::vector<float>& args) void CStringManagerModule::translateAndForwardWithArg(TDataSetRow senderId,CChatGroup::TGroupType groupType,std::string id,TSessionId sessionId,std::vector<float>& args)
{ {
std::string text = getValue(sessionId.asInt(), id ); std::string text = getValue(sessionId.asInt(), id );
if (text!="") if (!text.empty())
{ {
std::string toSend = formatString(text,args); std::string toSend = formatString(text,args);
send(senderId,groupType,toSend); send(senderId,groupType,toSend);

View file

@ -1,7 +1,6 @@
FILE(GLOB SRC main.cpp FILE(GLOB SRC main.cpp
${CMAKE_SOURCE_DIR}/ryzom/client/src/app_bundle_utils.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/app_bundle_utils.cpp
${CMAKE_SOURCE_DIR}/ryzom/client/src/user_agent.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/user_agent.cpp
${CMAKE_SOURCE_DIR}/ryzom/client/src/client_cfg.cpp
${CMAKE_SOURCE_DIR}/ryzom/client/src/login_patch.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/login_patch.cpp
${CMAKE_SOURCE_DIR}/ryzom/client/src/login_xdelta.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/login_xdelta.cpp
${CMAKE_SOURCE_DIR}/ryzom/client/src/stdpch.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/stdpch.cpp
@ -9,7 +8,7 @@ FILE(GLOB SRC main.cpp
) )
# always enable custom patch server # always enable custom patch server
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DRZ_USE_CUSTOM_PATCH_SERVER) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
ADD_EXECUTABLE(ryzom_client_patcher ${SRC}) ADD_EXECUTABLE(ryzom_client_patcher ${SRC})
@ -32,7 +31,7 @@ IF(APPLE)
TARGET_LINK_LIBRARIES(ryzom_client_patcher ${FOUNDATION_LIBRARY}) TARGET_LINK_LIBRARIES(ryzom_client_patcher ${FOUNDATION_LIBRARY})
ENDIF(APPLE) ENDIF(APPLE)
ADD_DEFINITIONS(${CURL_DEFINITIONS} -DRZ_NO_CLIENT -DNL_USE_SEVENZIP) ADD_DEFINITIONS(${CURL_DEFINITIONS})
NL_DEFAULT_PROPS(ryzom_client_patcher "Ryzom, Tools: Ryzom Client Patcher") NL_DEFAULT_PROPS(ryzom_client_patcher "Ryzom, Tools: Ryzom Client Patcher")
NL_ADD_RUNTIME_FLAGS(ryzom_client_patcher) NL_ADD_RUNTIME_FLAGS(ryzom_client_patcher)

View file

@ -16,6 +16,22 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
// simplified implementation to not depend on client_cfg.cpp
CClientConfig::CClientConfig()
{
}
void CClientConfig::serial(class NLMISC::IStream &/* f */) throw(NLMISC::EStream)
{
}
bool CClientConfig::getDefaultConfigLocation(std::string&/* p_name */) const
{
return false;
}
CClientConfig ClientCfg;
// stuff which is defined as extern in other .cpp files // stuff which is defined as extern in other .cpp files
void quitCrashReport() void quitCrashReport()
{ {
@ -126,7 +142,7 @@ void printDownload(const std::string &str)
fflush(stdout); fflush(stdout);
} }
// hardcoded english translations to not depends on external files // hardcoded english translations to not depend on external files
struct CClientPatcherTranslations : public NLMISC::CI18N::ILoadProxy struct CClientPatcherTranslations : public NLMISC::CI18N::ILoadProxy
{ {
virtual void loadStringFile(const std::string &filename, ucstring &text) virtual void loadStringFile(const std::string &filename, ucstring &text)
@ -174,6 +190,8 @@ struct CClientPatcherTranslations : public NLMISC::CI18N::ILoadProxy
} }
}; };
// hardcoded URL to not depend on external files
static const std::string PatchUrl = "http://dl.ryzom.com/patch_live";
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -182,7 +200,6 @@ int main(int argc, char *argv[])
Args.setVersion(getDisplayVersion()); Args.setVersion(getDisplayVersion());
Args.setDescription("Ryzom client"); Args.setDescription("Ryzom client");
Args.addArg("c", "config", "id", "Use this configuration to determine what directory to use by default");
if (!Args.parse(argc, argv)) return 1; if (!Args.parse(argc, argv)) return 1;
@ -194,28 +211,6 @@ int main(int argc, char *argv[])
INelContext::getInstance().getInfoLog()->removeDisplayer("DEFAULT_SD"); INelContext::getInstance().getInfoLog()->removeDisplayer("DEFAULT_SD");
INelContext::getInstance().getWarningLog()->removeDisplayer("DEFAULT_SD"); INelContext::getInstance().getWarningLog()->removeDisplayer("DEFAULT_SD");
std::string config = "client.cfg";
// if client.cfg is not in current directory, use client.cfg from user directory
if (!CFile::isExists(config))
config = CPath::getApplicationDirectory("Ryzom") + config;
// if client.cfg is not in current directory, use client_default.cfg
if (!CFile::isExists(config))
config = "client_default.cfg";
#ifdef RYZOM_ETC_PREFIX
// if client_default.cfg is not in current directory, use application default directory
if (!CFile::isExists(config))
config = CPath::standardizePath(RYZOM_ETC_PREFIX) + config;
#endif
if (!CFile::isExists(config))
{
printError(config + " not found, aborting patch.");
return 1;
}
// check if console supports colors // check if console supports colors
std::string term = toLower(std::string(getenv("TERM") ? getenv("TERM"):"")); std::string term = toLower(std::string(getenv("TERM") ? getenv("TERM"):""));
useEsc = (term.find("xterm") != string::npos || term.find("linux") != string::npos); useEsc = (term.find("xterm") != string::npos || term.find("linux") != string::npos);
@ -233,16 +228,6 @@ int main(int argc, char *argv[])
} }
#endif #endif
// load client.cfg or client_default.cfg
ClientCfg.init(config);
// check if PatchUrl is defined
if (ClientCfg.PatchUrl.empty())
{
printError("PatchUrl not defined in " + config);
return 1;
}
// allocate translations proxy // allocate translations proxy
CClientPatcherTranslations *trans = new CClientPatcherTranslations(); CClientPatcherTranslations *trans = new CClientPatcherTranslations();
@ -255,6 +240,8 @@ int main(int argc, char *argv[])
// now translations are read, we don't need it anymore // now translations are read, we don't need it anymore
delete trans; delete trans;
Args.displayVersion();
printf("\n");
printf("Checking %s files to patch...\n", convert(CI18N::get("TheSagaOfRyzom")).c_str()); printf("Checking %s files to patch...\n", convert(CI18N::get("TheSagaOfRyzom")).c_str());
// initialize patch manager and set the ryzom full path, before it's used // initialize patch manager and set the ryzom full path, before it's used
@ -262,7 +249,7 @@ int main(int argc, char *argv[])
// use PatchUrl // use PatchUrl
vector<string> patchURLs; vector<string> patchURLs;
pPM->init(patchURLs, ClientCfg.PatchUrl, ClientCfg.PatchVersion); pPM->init(patchURLs, PatchUrl, "");
pPM->startCheckThread(true /* include background patchs */); pPM->startCheckThread(true /* include background patchs */);
ucstring state; ucstring state;