Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2015-12-13 15:26:37 +01:00
commit 74f297f588
64 changed files with 467 additions and 243 deletions

View file

@ -72,10 +72,6 @@ IF(WIN32)
IF(WITH_MFC)
FIND_PACKAGE(MFC QUIET)
ENDIF(WITH_MFC)
IF(NOT DEFINED ENV{QTDIR})
SET(ENV{QTDIR} "c:/qt/4.6.3")
ENDIF(NOT DEFINED ENV{QTDIR})
ENDIF(WIN32)
#-----------------------------------------------------------------------------
@ -108,6 +104,7 @@ IF(WIN32)
ENDIF(WITH_MFC)
ENDIF(WIN32)
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(GIF)
@ -147,24 +144,194 @@ IF(WITH_SSE2)
ENDIF(WITH_SSE3)
ENDIF(WITH_SSE2)
MACRO(ADD_QT_LIBRARY _NAME)
IF(WIN32)
SET(_PREFIX "Qt5")
SET(_EXT "lib")
ELSE()
SET(_PREFIX "libQt5")
SET(_EXT "a")
ENDIF()
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
ENDIF()
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
ENDIF()
ENDMACRO()
MACRO(ADD_QT_PLUGIN _TYPE _NAME)
IF(WIN32)
SET(_PREFIX "")
SET(_EXT "lib")
ELSE()
SET(_PREFIX "lib")
SET(_EXT "a")
ENDIF()
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
ENDIF()
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
ENDIF()
ENDMACRO()
IF(WITH_QT5)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
FIND_PACKAGE(Qt5Core QUIET)
IF(Qt5Core_FOUND)
# Check if we are using Qt static or shared libraries
GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
SET(_VERSION "${QT_VERSION}")
IF(_FILE MATCHES "\\.(lib|a)$")
SET(QT_STATIC ON)
SET(_VERSION "${_VERSION} static version")
ELSE()
SET(QT_STATIC OFF)
SET(_VERSION "${_VERSION} shared version")
ENDIF()
MESSAGE(STATUS "Found Qt ${_VERSION}")
# These variables are not defined with Qt5 CMake modules
SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
# Fix wrong include directories with Qt 5 under Mac OS X
INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
FIND_PACKAGE(Qt5Gui)
FIND_PACKAGE(Qt5Widgets)
FIND_PACKAGE(Qt5OpenGL)
FIND_PACKAGE(Qt5Xml)
FIND_PACKAGE(Qt5LinguistTools)
FIND_PACKAGE(Qt5Network)
SET(QT_LIBRARIES Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Xml)
IF(QT_STATIC)
ADD_DEFINITIONS(-DQT_STATICPLUGIN)
# Core
IF(APPLE)
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${PCRE_LIBRARY}
${FOUNDATION_FRAMEWORK}
${CARBON_FRAMEWORK}
${SECURITY_FRAMEWORK})
ENDIF()
# Network
FIND_PACKAGE(OpenSSL REQUIRED)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
IF(WIN32)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${WINSDK_LIBRARY_DIR}/Crypt32.lib
${WINSDK_LIBRARY_DIR}/WS2_32.Lib)
ENDIF()
SET(QT_LIBRARIES ${QT_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARY})
# Gui
ADD_QT_LIBRARY(PrintSupport)
ADD_QT_LIBRARY(PlatformSupport)
IF(WIN32)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${WINSDK_LIBRARY_DIR}/Imm32.lib
${WINSDK_LIBRARY_DIR}/OpenGL32.lib
${WINSDK_LIBRARY_DIR}/WinMM.Lib)
ADD_QT_PLUGIN(platforms qwindows)
ELSEIF(APPLE)
# Cups needs .dylib
SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
FIND_LIBRARY(CUPS_LIBRARY cups)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${CUPS_LIBRARY}
${COCOA_FRAMEWORK}
${SYSTEMCONFIGURATION_FRAMEWORK}
${IOKIT_FRAMEWORK}
${OPENGL_FRAMEWORK})
ADD_QT_PLUGIN(printsupport cocoaprintersupport)
ADD_QT_PLUGIN(platforms qcocoa)
ENDIF()
ADD_QT_PLUGIN(imageformats qgif)
ADD_QT_PLUGIN(imageformats qicns)
ADD_QT_PLUGIN(imageformats qico)
ADD_QT_PLUGIN(imageformats qjpeg)
ADD_QT_PLUGIN(imageformats qmng)
ADD_QT_PLUGIN(imageformats qwebp)
# harfbuzz is needed since Qt 5.3
IF(APPLE)
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
ELSEIF(WIN32)
SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
ENDIF()
IF(EXISTS ${HB_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${HB_LIB})
ENDIF()
# freetype is needed since Qt 5.5
IF(APPLE)
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
ELSEIF(WIN32)
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
ENDIF()
IF(EXISTS ${FREETYPE_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB})
ENDIF()
# pcre is needed since Qt 5.5
IF(APPLE)
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
ELSEIF(WIN32)
SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
ENDIF()
IF(EXISTS ${PCRE_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${PCRE_LIB})
ENDIF()
ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
ENDIF()
ELSE()
MESSAGE(WARNING "Unable to find Qt 5")
ENDIF()
ENDIF()
IF(WITH_QT)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
# Use Qt 4
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED)
ENDIF(WITH_QT)
@ -235,7 +402,7 @@ ENDIF(WITH_SNOWBALLS)
IF(WITH_TOOLS)
ADD_SUBDIRECTORY(tool)
ENDIF(WITH_TOOLS)
ENDIF()
IF(WITH_STUDIO)
ADD_SUBDIRECTORY(studio)

View file

@ -64,18 +64,12 @@ IF(WITH_INSTALL_LIBRARIES)
ENDIF(UNIX)
ADD_SUBDIRECTORY(include)
ENDIF(WITH_INSTALL_LIBRARIES)
ENDIF()
ADD_SUBDIRECTORY(src)
IF(WITH_NEL_SAMPLES)
ADD_SUBDIRECTORY(samples)
ENDIF(WITH_NEL_SAMPLES)
ENDIF()
# Allow to compile only max plugins without other tools.
IF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN)
IF(WITH_NEL_TOOLS)
FIND_PACKAGE(Squish)
ENDIF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(tools)
ENDIF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN)

View file

@ -86,7 +86,7 @@ namespace NLGUI
uint8 getCurrentContentAlpha() const { return _CurrentContentAlpha; }
virtual bool isGrayed() const { return false; }
virtual bool getTouchFlag(bool clearFlag) const{ return false; }
virtual bool getTouchFlag(bool /* clearFlag */) const { return false; }
virtual void backupPosition() {}
virtual void restorePosition() {}

View file

@ -76,7 +76,7 @@ namespace NLGUI
public:
IDeletionWatcher() {}
virtual ~IDeletionWatcher() {}
virtual void onDeleted( const std::string &name ){}
virtual void onDeleted( const std::string &/* name */) {}
};
enum EStrech

View file

@ -701,7 +701,7 @@ struct CFile
/** Move a file
* NB this keeps file attributes
*/
static bool moveFile(const char *dest, const char *src);
static bool moveFile(const std::string &dest, const std::string &src);
/** Create a directory
* \return true if success

View file

@ -945,14 +945,6 @@ inline CSString operator+(const char* s0,const CSString& s1)
return CSString(s0) + s1.c_str();
}
#if !defined(NL_COMP_VC) || (NL_COMP_VC_VERSION <= 100)
// TODO: check if it can be disabled for other compilers too
inline CSString operator+(const std::string& s0,const CSString& s1)
{
return s0+static_cast<const std::string&>(s1);
}
#endif
} // NLMISC
// *** The following was commented out by Sadge because there were strange compilation/ link issues ***

View file

@ -370,7 +370,7 @@ inline void aligned_free(void *ptr) { _aligned_free(ptr); }
#elif defined(NL_OS_MAC)
#include <stdlib.h>
// under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment)
inline void *aligned_malloc(size_t size, size_t alignment) { return malloc(size); }
inline void *aligned_malloc(size_t size, size_t /* alignment */) { return malloc(size); }
inline void aligned_free(void *ptr) { free(ptr); }
#else
#include <malloc.h>

View file

@ -579,7 +579,7 @@ namespace NLGUI
string finalUrl;
if (it->type == ImgType)
{
CFile::moveFile(it->dest.c_str(), tmpfile.c_str());
CFile::moveFile(it->dest, tmpfile);
//if (lookupLocalFile (finalUrl, file.c_str(), false))
{
for(uint i = 0; i < it->imgs.size(); i++)
@ -591,7 +591,7 @@ namespace NLGUI
}
else
{
CFile::moveFile(it->dest.c_str(), tmpfile.c_str());
CFile::moveFile(it->dest, tmpfile);
//if (lookupLocalFile (finalUrl, file.c_str(), false))
{
CLuaManager::getInstance().executeLuaScript( it->luaScript, true );

View file

@ -356,7 +356,7 @@ namespace NLGUI
string backup = nextFileName+".backup";
if (CFile::fileExists(backup))
CFile::deleteFile(backup);
CFile::moveFile(backup.c_str(), nextFileName.c_str());
CFile::moveFile(backup, nextFileName);
}
return false;
}

View file

@ -154,10 +154,12 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f )
if (curFrame->ExtensionBlockCount > 0)
{
for(uint e=0; e<curFrame->ExtensionBlockCount; e++){
for(sint e = 0; e < curFrame->ExtensionBlockCount; e++)
{
ExtensionBlock *ext = &curFrame->ExtensionBlocks[e];
if (ext->Function == GRAPHICS_EXT_FUNC_CODE) {
if (ext->Function == GRAPHICS_EXT_FUNC_CODE)
{
uint8 flag = ext->Bytes[0];
//delay = (ext.Bytes[1] << 8) | ext.Bytes[2];
transparency = (flag & GIF_TRANSPARENT_MASK) ? ext->Bytes[3] : GIF_NOT_TRANSPARENT;

View file

@ -627,7 +627,7 @@ void COFile::internalClose(bool success)
if (CFile::fileExists(_FileName))
CFile::deleteFile (_FileName);
if (CFile::moveFile (_FileName.c_str(), _TempFileName.c_str()))
if (CFile::moveFile(_FileName, _TempFileName))
break;
nlSleep (0);
}

View file

@ -2451,7 +2451,7 @@ bool CFile::thoroughFileCompare(const std::string &fileName0, const std::string
return true;
}
bool CFile::moveFile(const char *dest,const char *src)
bool CFile::moveFile(const std::string &dest, const std::string &src)
{
return CopyMoveFile(dest, src, false);
}

View file

@ -66,15 +66,17 @@ IF(WITH_NEL_TOOLS AND WITH_3D)
ADD_SUBDIRECTORY(object_viewer_widget)
ENDIF(WITH_QT)
IF(WITH_NEL_TOOLS)
FIND_PACKAGE(Squish)
ENDIF()
IF(SQUISH_FOUND)
ADD_SUBDIRECTORY(s3tc_compressor_lib)
ADD_SUBDIRECTORY(panoply_maker)
ADD_SUBDIRECTORY(tga_2_dds)
ADD_SUBDIRECTORY(hls_bank_maker)
ENDIF(SQUISH_FOUND)
#crash_log_analyser
#shapes_exporter
ENDIF()
#crash_log_analyser
ENDIF()

View file

@ -563,7 +563,7 @@ static bool CheckIfNeedRebuildColoredVersionForOneBitmap(const CBuildInfo &bi, c
return true;
// ok, can move the cache
if (!NLMISC::CFile::moveFile(outputHLSInfo.c_str(), cacheHLSInfo.c_str()))
if (!NLMISC::CFile::moveFile(outputHLSInfo, cacheHLSInfo))
{
nlwarning(("Couldn't move " + cacheHLSInfo + " to " + outputHLSInfo).c_str());
return true;
@ -595,7 +595,7 @@ static bool CheckIfNeedRebuildColoredVersionForOneBitmap(const CBuildInfo &bi, c
// get version that is in the cache
std::string cacheDest = bi.OutputPath + outputFileName + bi.OutputFormat;
if (!NLMISC::CFile::moveFile(cacheDest.c_str(), searchName.c_str()))
if (!NLMISC::CFile::moveFile(cacheDest, searchName))
{
nlwarning(("Couldn't move " + searchName + " to " + cacheDest).c_str());
return true;

View file

@ -1,11 +1,15 @@
# Don't add other subdirectories if only max plugins are selected.
IF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(misc)
IF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(memory)
ENDIF(WITH_NEL_TOOLS)
# Max plugins are under the 3d directory as well.
# Allow to compile only max plugins without other tools.
IF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN)
ADD_SUBDIRECTORY(3d)
ENDIF()
# Don't add other subdirectories if only max plugins are selected.
IF(WITH_NEL_TOOLS)

View file

@ -1,9 +1,14 @@
# always compile crash report
IF(WITH_QT OR WITH_QT5)
ADD_SUBDIRECTORY(crash_report)
ENDIF()
IF(WITH_NEL_TOOLS)
SUBDIRS(bnp_make disp_sheet_id extract_filename lock make_sheet_id xml_packer)
IF(WITH_QT OR WITH_QT5)
ADD_SUBDIRECTORY(words_dic_qt)
ADD_SUBDIRECTORY(message_box_qt)
ADD_SUBDIRECTORY(crash_report)
ENDIF()
IF(WIN32)
@ -21,3 +26,4 @@ IF(WIN32)
ENDIF()
ADD_SUBDIRECTORY(probe_timers)
ENDIF()

View file

@ -11,13 +11,13 @@ SET(CRASHREPORT_UI
crash_report_widget.ui
)
IF(WITH_QT)
SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTMAIN TRUE)
SET(QT_USE_QTOPENGL FALSE)
SET(QT_USE_QTXML FALSE)
IF(WITH_QT)
INCLUDE_DIRECTORIES(${QT_INCLUDES})
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
@ -29,8 +29,6 @@ IF(WITH_QT)
ELSE()
QT5_WRAP_CPP(CRASHREPORT_MOC_SRC ${CRASHREPORT_MOC_HDR})
QT5_WRAP_UI(CRASHREPORT_UI_HDR ${CRASHREPORT_UI})
SET(QT_LIBRARIES Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Network)
ENDIF()
SOURCE_GROUP(QtResources FILES ${CRASHREPORT_UI})

View file

@ -76,6 +76,19 @@ public:
}
};
#ifdef QT_STATICPLUGIN
#include <QtPlugin>
#ifdef Q_OS_WIN32
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#endif
#ifdef Q_OS_MAC
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
#endif
#endif
int main( int argc, char **argv )
{
#ifndef WIN32

View file

@ -1,8 +1,6 @@
IF(WITH_QT)
INCLUDE_DIRECTORIES(${QT_INCLUDES})
INCLUDE(${QT_USE_FILE})
ELSE()
SET(QT_LIBRARIES Qt5::Widgets Qt5::Core Qt5::Gui)
ENDIF()
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -24,8 +24,6 @@ IF(WITH_QT)
ADD_DEFINITIONS(${QT_DEFINITIONS})
ELSE()
SET(QT_LIBRARIES Qt5::Widgets Qt5::Core Qt5::Gui)
QT5_ADD_RESOURCES(WORDS_DIC_RC_SRCS ${WORDS_DIC_RCS})
QT5_WRAP_UI(WORDS_DIC_UI_HDRS ${WORDS_DIC_UIS})
QT5_WRAP_CPP(WORDS_DIC_MOC_SRCS ${WORDS_DIC_HDR})

View file

@ -127,7 +127,7 @@ private:
fclose(fp);
fp = NULL;
NLMISC::CFile::moveFile(_DstFile.c_str(), _SrcFile.c_str());
NLMISC::CFile::moveFile(_DstFile, _SrcFile);
// verify the resulting file
fp = fopen(_SrcFile.c_str(), "rb");

View file

@ -1,8 +1,6 @@
#-----------------------------------------------------------------------------
#Platform specifics
FIND_PACKAGE(ZLIB)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/src )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common )
SET(RZ_SERVER_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/server/src)
@ -20,9 +18,7 @@ ELSEIF(WITH_RYZOM_TOOLS)
ADD_SUBDIRECTORY(client)
ENDIF(WITH_RYZOM_CLIENT)
IF(WITH_RYZOM_TOOLS)
ADD_SUBDIRECTORY(tools)
ENDIF(WITH_RYZOM_TOOLS)
IF(WITH_RYZOM_SERVER OR WITH_RYZOM_TOOLS)
# Need servershare for build packed collision tool

View file

@ -1744,7 +1744,7 @@ bool CInterfaceManager::loadConfig (const string &filename)
string sFileNameBackup = sFileName+"backup";
if (CFile::fileExists(sFileNameBackup))
CFile::deleteFile(sFileNameBackup);
CFile::moveFile(sFileNameBackup.c_str(), sFileName.c_str());
CFile::moveFile(sFileNameBackup, sFileName);
nlwarning("Config loading failed : restore default");
vector<string> v;
if (!ClientCfg.R2EDEnabled)

View file

@ -854,7 +854,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
else
{
deleteFile(DstName);
CFile::moveFile(DstName.c_str(), SrcName.c_str());
CFile::moveFile(DstName, SrcName);
}
nblab++;
@ -1128,7 +1128,7 @@ void CPatchManager::renameFile (const string &src, const string &dst)
ucstring s = CI18N::get("uiRenameFile") + " " + NLMISC::CFile::getFilename(src);
setState(true, s);
if (!NLMISC::CFile::moveFile(dst.c_str(), src.c_str()))
if (!NLMISC::CFile::moveFile(dst, src))
{
s = CI18N::get("uiRenameErr") + " " + src + " -> " + dst + " (" + toString(errno) + "," + strerror(errno) + ")";
setState(true, s);
@ -3677,7 +3677,7 @@ void CDownloadThread::run()
try
{
pPM->getServerFile(patchName, false, tmpFile);
NLMISC::CFile::moveFile(finalFile.c_str(), tmpFile.c_str());
NLMISC::CFile::moveFile(finalFile, tmpFile);
pPM->applyDate(finalFile, _Entries[first].Timestamp);
}

View file

@ -120,9 +120,9 @@ CInstance *CAutoGroup::getGroupingCandidate()
{
CObject *obj = NULL;
if(k<components->getSize())
obj = components->getValue(k);
obj = components->getValueAtPos(k);
else
obj = baseComponents->getValue(k - components->getSize());
obj = baseComponents->getValueAtPos(k - components->getSize());
CInstance *inst = getEditor().getInstanceFromObject(obj);
if (!inst)
{
@ -148,9 +148,9 @@ CInstance *CAutoGroup::getGroupingCandidate()
{
CObject *obj = NULL;
if(k<features->getSize())
obj = features->getValue(k);
obj = features->getValueAtPos(k);
else
obj = baseFeatures->getValue(k - features->getSize());
obj = baseFeatures->getValueAtPos(k - features->getSize());
CInstance *inst = getEditor().getInstanceFromObject(obj);
CDisplayerVisual *dv = inst->getDisplayerVisual();
if (!dv) continue;

View file

@ -124,7 +124,7 @@ void CDisplayerVisualActivitySequence::update()
for(uint k = 0; k < activities->getSize(); ++k)
{
// search next zone of activity
CObjectTable *activity = activities->getValue(k)->toTable();
CObjectTable *activity = activities->getValueAtPos(k)->toTable();
if (!activity) continue;
std::string activityStr = getString(activity, "Activity");
if (activityStr == "Stand Still" || activityStr == "Inactive") continue;
@ -369,7 +369,7 @@ void CDisplayerVisualActivitySequence::onPostRender()
for(uint k = 0; k < activities->getSize(); ++k)
{
// search next zone of activity
CObjectTable *activity = activities->getValue(k)->toTable();
CObjectTable *activity = activities->getValueAtPos(k)->toTable();
if (!activity) continue;
std::string zoneId = getString(activity, "ActivityZoneId");
if (zoneId.empty()) continue;

View file

@ -978,7 +978,7 @@ void CDisplayerVisualEntity::updateName()
sint actNb = -1;
for(uint i=0; i<acts->getSize(); i++)
{
if(acts->getValue(i)->equal(act))
if(acts->getValueAtPos(i)->equal(act))
{
actNb = i;
break;

View file

@ -755,7 +755,7 @@ void CDisplayerVisualGroup::updateInstanceList() const
_Instances.resize(sons->getSize());
for(uint k = 0; k < sons->getSize(); ++k)
{
CInstance *inst = getEditor().getInstanceFromObject(sons->getValue(k));
CInstance *inst = getEditor().getInstanceFromObject(sons->getValueAtPos(k));
if (inst)
{
_Instances[k] = inst->getDisplayerVisual();

View file

@ -1114,7 +1114,7 @@ void CComLuaModule::setObjectToLua(lua_State* state, CObject* object)
for (first=0 ; first != last; ++first)
{
std::string key = object->getKey(first);
CObject *value = object->getValue(first);
CObject *value = object->getValueAtPos(first);
if (!key.empty())
{
lua_pushstring(state, key.c_str());
@ -2246,7 +2246,7 @@ sint CComLuaModule::luaUpdateScenarioAck(lua_State* state)
for(uint i = 0; i < size; ++i)
{
std::string key = object->getKey(i);
CObject* value = object->getValue(i);
CObject* value = object->getValueAtPos(i);
if (value->isInteger())
{

View file

@ -3224,7 +3224,7 @@ void CEditor::initObjectProjectionMetatable()
if (ls.isInteger(2))
{
// index is an integer
const CObject *other = obj->getValue((uint32) ls.toInteger(2));
const CObject *other = obj->getValueAtPos((uint32) ls.toInteger(2));
if (other)
{
pushValue(ls, other);
@ -3569,7 +3569,7 @@ void CEditor::initObjectProjectionMetatable()
}
ls.pop(2);
pushKey(ls, obj, 0);
pushValue(ls, obj->getValue(0));
pushValue(ls, obj->getValueAtPos(0));
return 2;
}
}
@ -3618,7 +3618,7 @@ void CEditor::initObjectProjectionMetatable()
{
ls.pop(2);
pushKey(ls, obj, newIndex);
pushValue(ls, obj->getValue(newIndex));
pushValue(ls, obj->getValueAtPos(newIndex));
return 2;
}
}
@ -3751,7 +3751,7 @@ void CEditor::setCurrentActFromTitle(const std::string &wantedTitle)
{
for(uint k = 0; k < actTable->getSize(); ++k)
{
R2::CObject *act = actTable->getValue(k);
R2::CObject *act = actTable->getValueAtPos(k);
nlassert(act);
std::string actTitle;
if (act->isString("Name"))
@ -4560,7 +4560,7 @@ void CEditor::updatePrimitiveContextualVisibility()
for(uint k = 0; k < activities->getSize(); ++k)
{
// search next zone of activity
CObjectTable *activity = activities->getValue(k)->toTable();
CObjectTable *activity = activities->getValueAtPos(k)->toTable();
if (!activity) continue;
std::string zoneId = getString(activity, "ActivityZoneId");
CInstance *primitive = getInstanceFromId(zoneId);
@ -4734,7 +4734,7 @@ void CEditor::autoSave()
{
CFile::deleteFile(next);
}
CFile::moveFile(next.c_str(), current.c_str());
CFile::moveFile(next, current);
}
}
@ -5031,7 +5031,7 @@ void CEditor::onErase(CObject *root, bool &foundInBase, std::string &nameInParen
{
for(uint k = 0; k < root->getSize(); ++k)
{
CObject *obj = root->getValue(k);
CObject *obj = root->getValueAtPos(k);
if (obj->isTable())
{
onErase(obj);
@ -5122,7 +5122,7 @@ void CEditor::onErase(CObject *root, bool &foundInBase, std::string &nameInParen
CObjectTable *rootTable = root->toTable();
for (uint32 k = 0; k < rootTable->getSize(); ++k)
{
CObject *obj = rootTable->getValue(k);
CObject *obj = rootTable->getValueAtPos(k);
CObjectRefIdClient *objRefId = dynamic_cast<CObjectRefIdClient *>(obj);
if (objRefId)
{
@ -5547,7 +5547,7 @@ void CEditor::createNewInstanceForObjectTableInternal(const CObject *obj)
// do the same on sons
for(uint k = 0; k < table->getSize(); ++k)
{
createNewInstanceForObjectTableInternal(table->getValue(k));
createNewInstanceForObjectTableInternal(table->getValueAtPos(k));
}
}
@ -5754,7 +5754,7 @@ void CEditor::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialAct
CObject *acts = _Scenario->getAttr("Acts");
if (acts)
{
CObject *baseAct = acts->getValue(0);
CObject *baseAct = acts->getValueAtPos(0);
if (baseAct)
{
_BaseAct = getInstanceFromId(baseAct->toString("InstanceId"));
@ -5871,7 +5871,7 @@ CInstance *CEditor::getDefaultFeature(CInstance *act)
if (!act) return NULL;
CObject *defaultFeature = act->getObjectTable()->getAttr("Features");
if (!defaultFeature) return NULL;
defaultFeature = defaultFeature->getValue(0);
defaultFeature = defaultFeature->getValueAtPos(0);
if (!defaultFeature) return NULL; // 0 should be the default feature
CInstance *result = getInstanceFromId(defaultFeature->toString("InstanceId"));
if (!result) return NULL;

View file

@ -754,7 +754,7 @@ const CInstance *CInstance::getParentGroupLeader() const
{
return NULL;
}
return getEditor().getInstanceFromObject(components->getValue(0));
return getEditor().getInstanceFromObject(components->getValueAtPos(0));
}
// *********************************************************************************************************
@ -776,7 +776,7 @@ CObject *CInstance::getGroupSelectedSequence() const
{
if (selectedSequence >= 0 && selectedSequence < (sint) activities->getSize())
{
return activities->getValue((sint32) selectedSequence);
return activities->getValueAtPos((sint32) selectedSequence);
}
}
}

View file

@ -221,7 +221,7 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray
{
if (_IndexInParentArray == -1)
{
if (parentInstanceTable->getValue(_IndexInParent) == static_cast<const CObject *>(this))
if (parentInstanceTable->getValueAtPos(_IndexInParent) == static_cast<const CObject *>(this))
{
name = parentInstanceTable->getKey(_IndexInParent);
indexInArray = -1;
@ -230,13 +230,13 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray
}
else
{
CObject *subObject = parentInstanceTable->getValue(_IndexInParent);
CObject *subObject = parentInstanceTable->getValueAtPos(_IndexInParent);
if (subObject->isTable())
{
CObjectTable *subTable = (CObjectTable *) subObject;
if (_IndexInParentArray < (sint32) subTable->getSize())
{
if (subTable->getValue(_IndexInParentArray) == static_cast<const CObject *>(this))
if (subTable->getValueAtPos(_IndexInParentArray) == static_cast<const CObject *>(this))
{
name = parentInstanceTable->getKey(_IndexInParent);
indexInArray = _IndexInParentArray;
@ -261,7 +261,7 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray
// if instance is the direct parent (e.g object is not in an array of the parent)
for (uint k = 0; k < parentInstanceTable->getSize(); ++k)
{
if (parentInstanceTable->getValue(k) == ptrInParent)
if (parentInstanceTable->getValueAtPos(k) == ptrInParent)
{
_IndexInParent = k;
if (ptrInParent == this)
@ -276,7 +276,7 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray
// I'm in an array in my parent, retrieve the index
for (uint l = 0; l < getParent()->getSize(); ++l)
{
if (getParent()->getValue(l) == static_cast<const CObject *>(this))
if (getParent()->getValueAtPos(l) == static_cast<const CObject *>(this))
{
name = parentInstanceTable->getKey(_IndexInParent);
_IndexInParentArray = l;

View file

@ -321,11 +321,28 @@ static char *sha512crypt(const char *key, const char *setting, char *output)
p += sprintf(p, "$6$%s%.*s$", rounds, slen, salt);
#if 1
static const unsigned char perm[][3] = {
0,21,42,22,43,1,44,2,23,3,24,45,25,46,4,
47,5,26,6,27,48,28,49,7,50,8,29,9,30,51,
31,52,10,53,11,32,12,33,54,34,55,13,56,14,35,
15,36,57,37,58,16,59,17,38,18,39,60,40,61,19,
62,20,41 };
{ 0, 21, 42 },
{ 22, 43, 1 },
{ 44, 2, 23 },
{ 3, 24, 45 },
{ 25, 46, 4 },
{ 47, 5, 26 },
{ 6, 27, 48 },
{ 28, 49, 7 },
{ 50, 8, 29 },
{ 9, 30, 51 },
{ 31, 52, 10 },
{ 53, 11, 32 },
{ 12, 33, 54 },
{ 34, 55, 13 },
{ 56, 14, 35 },
{ 15, 36, 57 },
{ 37, 58, 16 },
{ 59, 17, 38 },
{ 18, 39, 60 },
{ 40, 61, 19 },
{ 62, 20, 41 }
};
for (i=0; i<21; i++) p = to64(p,
(md[perm[i][0]]<<16)|(md[perm[i][1]]<<8)|md[perm[i][2]], 4);
#else

View file

@ -1154,8 +1154,8 @@ public:
friend iterator; // MSVC
friend const_iterator;
#else
template <class U, class V> friend class _CMirrorPropValueListIterator; // GCC3
template <class U, class V> friend class _CCMirrorPropValueListIterator;
template <class U, class V> friend struct _CMirrorPropValueListIterator; // GCC3
template <class U, class V> friend struct _CCMirrorPropValueListIterator;
#endif
/// Constructor
@ -1241,8 +1241,8 @@ public:
friend iterator; // MSVC
friend const_iterator;
#else
template <class U, class V> friend class _CMirrorPropValueListIterator; // GCC3
template <class U, class V> friend class _CCMirrorPropValueListIterator;
template <class U, class V> friend struct _CMirrorPropValueListIterator; // GCC3
template <class U, class V> friend struct _CCMirrorPropValueListIterator;
template<class U, class V> friend class CMirrorPropValueItem;
#endif

View file

@ -392,7 +392,7 @@ CObject* CObject::getAttr(const std::string & /* name */) const { return 0;}
std::string CObject::getKey(uint32 /* pos */) const{ BOMB("Try to call the function getKey() on an object that is not a table", return ""); return "";}
CObject* CObject::getValue(uint32 /* pos */) const{ BOMB("Try to call the function getValue() on an object that is not a table", return 0); return 0;}
CObject* CObject::getValueAtPos(uint32 /* pos */) const{ BOMB("Try to call the function getValueAtPos() on an object that is not a table", return 0); return 0;}
uint32 CObject::getSize() const { BOMB("Try to call the function getSize() on an object that is not a table", return 0); return 0; }
@ -974,7 +974,7 @@ void CObjectTable::checkIntegrity() const
{
for(uint k = 0; k < getSize(); ++k)
{
CObject *subObj = getValue(k);
CObject *subObj = getValueAtPos(k);
if (subObj)
{
if (!subObj->getGhost())
@ -1017,7 +1017,7 @@ void CObjectTable::setGhost(bool ghost)
for(uint k = 0; k < getSize(); ++k)
{
CObject *subObj = getValue(k);
CObject *subObj = getValueAtPos(k);
if (subObj)
{
subObj->setGhost(ghost);
@ -1031,7 +1031,7 @@ void CObjectTable::previsit(std::vector<CObject::TRefPtr> &sons)
sons.reserve(sons.size() + getSize());
for(uint k = 0; k < getSize(); ++k)
{
CObject *subObj = getValue(k);
CObject *subObj = getValueAtPos(k);
if (subObj)
{
subObj->previsit(sons);
@ -1068,7 +1068,7 @@ void CObjectTable::inPlaceCopy(const CObjectTable &src)
}
else
{
src.getValue(k)->inPlaceCopyTo(*dest);
src.getValueAtPos(k)->inPlaceCopyTo(*dest);
}
}
else
@ -1115,7 +1115,7 @@ void CObjectTable::sort()
uint32 lastKey = keys->getSize();
for (; firstKey != lastKey ; ++firstKey)
{
CObject* keyObject = keys->getValue(firstKey);
CObject* keyObject = keys->getValueAtPos(firstKey);
if (! keyObject->isString()) return;
std::string key = keyObject->toString();
@ -1344,7 +1344,7 @@ std::string CObjectTable::getKey(uint32 pos) const
return _Value[pos].first;
}
CObject* CObjectTable::getValue(uint32 pos) const
CObject* CObjectTable::getValueAtPos(uint32 pos) const
{
//H_AUTO(R2_CObjectTable_getValue)
if (pos >= _Value.size())
@ -1404,7 +1404,7 @@ bool CObjectTable::setObject(const std::string& key, CObject* value)
for ( ; first != last ; ++first)
{
std::string key1 = table->getKey(first);
CObject* value1 = table->getValue(first);
CObject* value1 = table->getValueAtPos(first);
add(key1, value1->clone());
}
return true;
@ -1577,9 +1577,9 @@ bool CObjectTable::equal(const CObject* other) const
for ( i=0; i!= size ; ++i )
{
std::string key = other->getKey(i);
CObject* value = other->getValue(i);
CObject* value = other->getValueAtPos(i);
if (key != this->getKey(i)) return false;
if ( !value->equal(this->getValue(i))) return false;
if ( !value->equal(this->getValueAtPos(i))) return false;
}
return true;
}
@ -1835,7 +1835,7 @@ void CObjectGenerator::createDefaultValues(CObjectFactory* factory)
uint32 last = prop->getSize();
for ( ; first != last ; ++first )
{
CObject* found = prop->getValue(first);
CObject* found = prop->getValueAtPos(first);
if (found && found->isString("DefaultValue") && found->isString("Name") )
{
@ -1895,7 +1895,7 @@ CObject* CObjectGenerator::instanciate(CObjectFactory* factory) const
uint32 last = prop->getSize();
for ( ; first != last ; ++first )
{
CObject* found = prop->getValue(first);
CObject* found = prop->getValueAtPos(first);
if (found && found->isString("Type") )
{
@ -2461,7 +2461,7 @@ public:
uint8 shortKey = static_cast<uint8>(uiKey);
stream.serial(shortKey);
CObject*value = data->getValue(optionalPropFoundIndex[first]);
CObject*value = data->getValueAtPos(optionalPropFoundIndex[first]);
if (serializer->Log) { nldebug("R2NET: (%u) Field '%s'", serializer->Level, key.c_str());}
onSerial(stream, key, value, serializer);
}
@ -2483,7 +2483,7 @@ public:
stream.serial(last16);
for (; first != last; ++first)
{
CObject* value = data->getValue(valuePropFoundIndex[first]);
CObject* value = data->getValueAtPos(valuePropFoundIndex[first]);
if (serializer->Log) { nldebug("R2NET: (%u) Field [%u]", serializer->Level, first);}
CObjectSerializerImpl::getInstance().serialImpl(stream, value, serializer);
}
@ -2509,7 +2509,7 @@ public:
{
uint32 keyIndex = otherPropFoundIndex[first];
std::string key = data->getKey(keyIndex);
CObject* value = data->getValue(keyIndex);
CObject* value = data->getValueAtPos(keyIndex);
stream.serial(key);
if (serializer->Log) { nldebug("R2NET: (%u) Field '%s'", serializer->Level, key.c_str());}
CObjectSerializerImpl::getInstance().serialImpl(stream, value, serializer);
@ -3270,7 +3270,7 @@ void CObjectSerializerImpl::serialImpl(NLMISC::IStream& stream, CObject*& data,
for (uint first = 0; first != size; ++first)
{
std::string key = data->getKey(first);
CObject* value = data->getValue(first);
CObject* value = data->getValueAtPos(first);
stream.serial(key);
++ (serializer->Level);
if (serializer->Log) { nldebug("R2NET: (%u) Field '%s'", serializer->Level, key.c_str());}

View file

@ -114,7 +114,7 @@ public:
virtual std::string getKey(uint32 pos) const;
virtual CObject* getValue(uint32 pos) const;
virtual CObject* getValueAtPos(uint32 pos) const;
virtual uint32 getSize() const;
@ -385,7 +385,7 @@ public:
virtual std::string getKey(uint32 pos) const;
virtual CObject* getValue(uint32 pos) const;
virtual CObject* getValueAtPos(uint32 pos) const;
virtual sint32 findIndex(const CObject* child) const;

View file

@ -421,7 +421,7 @@ bool CRingAccess::verifyRtScenario(CObject* rtScenario, const std::string& charR
for ( ;firstLocation != lastLocation; ++firstLocation)
{
CObject* location = locations->getValue(firstLocation);
CObject* location = locations->getValueAtPos(firstLocation);
if (!location || !location->isString("Island"))
{
err = new CVerfiyRightRtScenarioError(CVerfiyRightRtScenarioError::InvalidData);
@ -445,7 +445,7 @@ bool CRingAccess::verifyRtScenario(CObject* rtScenario, const std::string& charR
uint32 lastActIndex = acts->getSize();
for ( ;firstActIndex != lastActIndex; ++firstActIndex)
{
CObject* act = acts->getValue(firstActIndex);
CObject* act = acts->getValueAtPos(firstActIndex);
if (!act || !act->isTable() || !act->isTable("Npcs"))
{
err = new CVerfiyRightRtScenarioError(CVerfiyRightRtScenarioError::InvalidData);
@ -457,7 +457,7 @@ bool CRingAccess::verifyRtScenario(CObject* rtScenario, const std::string& charR
uint32 lastNpcIndex = npcs->getSize();
for (; firstNpcIndex != lastNpcIndex; ++firstNpcIndex)
{
CObject* npc = npcs->getValue(firstNpcIndex);
CObject* npc = npcs->getValueAtPos(firstNpcIndex);
if (npc && npc->isTable() && npc->isString("SheetClient") && npc->isString("Sheet"))
{
std::string botName;

View file

@ -122,7 +122,7 @@ CObject *CScenario::find(const std::string& instanceId, const std::string & attr
}
if (position != -1)
{
CObject *subObj = src->getValue(position);
CObject *subObj = src->getValueAtPos(position);
if (!subObj)
{
nlwarning("Can't find attribute %s[%d] inside object with InstanceId = %s", attrName.c_str(), (int) position, instanceId.c_str());
@ -388,7 +388,7 @@ void CInstanceMap::add(CObject* root)
sint32 first = 0;
for (first = 0 ; first != size ; ++first)
{
CObject* value = root->getValue(first);
CObject* value = root->getValueAtPos(first);
add(value);
}
@ -416,7 +416,7 @@ void CInstanceMap::remove(CObject* root)
sint32 first = 0;
for (first = 0 ; first != size ; ++first)
{
CObject* value = root->getValue(first);
CObject* value = root->getValueAtPos(first);
remove(value);
}

View file

@ -691,7 +691,7 @@ void CAttributeToProperty::setPrimPath()
points->VPoints.resize(last);
for ( ; first != last ; ++first )
{
CObject* pt = pts->getValue(first);
CObject* pt = pts->getValueAtPos(first);
attr = pt->getAttr("x");
if (attr && attr->isNumber()) { points->VPoints[first].x = static_cast<float>(attr->toNumber()); }
@ -721,7 +721,7 @@ void CAttributeToProperty::setPrimZone()
points->VPoints.resize(last);
for ( ; first != last ; ++first )
{
CObject* pt = pts->getValue(first);
CObject* pt = pts->getValueAtPos(first);
attr = pt->getAttr("x");
if (attr && attr->isNumber()) { points->VPoints[first].x = static_cast<float>(attr->toNumber()); }
@ -1103,7 +1103,7 @@ IPrimitive* CServerAnimationModule::getAction(CObject* action, const std::string
uint32 nb =children->getSize();
for(uint32 i=0;i<nb;++i)
{
IPrimitive* tmp=getAction(children->getValue(i), prefix,scenarioId);
IPrimitive* tmp=getAction(children->getValueAtPos(i), prefix,scenarioId);
if (!tmp)
{
nlwarning("Error in action %s nb: %u", action->toString("Name").c_str(), i);
@ -1466,7 +1466,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C
for ( ; firstAiState != lastAiState ; ++firstAiState)
{
CObject* aiState = aiStates->getValue(firstAiState);
CObject* aiState = aiStates->getValueAtPos(firstAiState);
std::string aiMovement = aiState->toString("AiMovement");
@ -1532,7 +1532,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C
uint32 firstChild(0), lastChild(children->getSize());
for ( ; firstChild != lastChild ; ++firstChild)
{
CObject* childName = children->getValue(firstChild);
CObject* childName = children->getValueAtPos(firstChild);
CObject* component = components.find(childName->toString());
@ -1597,7 +1597,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C
uint32 firstNpc(0), lastNpc(npcChild->getSize());
for ( ; firstNpc != lastNpc ; ++firstNpc)
{
CObject* objectNpcId = npcChild->getValue(firstNpc);
CObject* objectNpcId = npcChild->getValueAtPos(firstNpc);
std::string npcId ( objectNpcId->toString() );
CObject* objectNpc = components.find(npcId);
@ -1760,14 +1760,14 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C
for(;firstEvent!=lastEvent;++firstEvent)
{
//create the primitive event and its associated actions
IPrimitive* pEvent = getEvent(events->getValue(firstEvent), components, prefix, animSession->SessionId);
IPrimitive* pEvent = getEvent(events->getValueAtPos(firstEvent), components, prefix, animSession->SessionId);
if (!pEvent)
{
nlwarning("Error while generating primitive");
return false;
}
//insert the primitive event
CObject* eventObject = events->getValue(firstEvent);
CObject* eventObject = events->getValueAtPos(firstEvent);
bool isTriggerZone = false;
if ( eventObject->isInteger("IsTriggerZone") )
@ -1806,7 +1806,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C
uint32 firstnode = 0;
for (; firstnode != lastnode; ++firstnode)
{
CObject* node = tree->getValue(firstnode);
CObject* node = tree->getValueAtPos(firstnode);
if (!node
|| !node->isTable()
|| !node->isString("Name")
@ -1898,7 +1898,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi
uint32 firstPlotItem = 0;
for (; firstPlotItem != lastPlotItem; ++firstPlotItem)
{
CObject* plotItem = plotItems->getValue(firstPlotItem);
CObject* plotItem = plotItems->getValueAtPos(firstPlotItem);
if (!plotItem
|| !plotItem->isTable()
|| !plotItem->isInteger("SheetId")
@ -1955,7 +1955,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi
uint32 firstLocation = 0;
for (; firstLocation != lastLocation; ++firstLocation)
{
CObject* location = locations->getValue(firstLocation);
CObject* location = locations->getValueAtPos(firstLocation);
if (!location
|| !location->isTable()
|| !location->isInteger("Season")
@ -1991,7 +1991,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi
for (; firstAct != lastAct ; ++firstAct)
{
//std::string key = acts->getKey(firstAct);
CObject* act= acts->getValue(firstAct);
CObject* act= acts->getValueAtPos(firstAct);
if (!act)
{
nlwarning("R2An: Can't make animation session, invalid RtAct");
@ -3697,7 +3697,7 @@ IPrimitive* CServerAnimationModule::getEvent(CObject* event,CInstanceMap& compon
//for each action of this event
for(;firstAction!=lastAction;++firstAction)
{
CObject * action_id = actions_id->getValue(firstAction);
CObject * action_id = actions_id->getValueAtPos(firstAction);
std::string id = action_id->toString();
CObject* action=components.find(id); // can be null?
if (!action)
@ -3770,7 +3770,7 @@ void CServerAnimationModule::requestLoadTable(CAnimationSession* session)
msg.serial(size);
for(uint32 i=0;i<size;++i)
{
CObject* entry = textsTable->getValue(i);
CObject* entry = textsTable->getValueAtPos(i);
std::string tmp = entry->getAttr("Id")->toString();
msg.serial(tmp);
tmp = entry->getAttr("Text")->toString();

View file

@ -3645,7 +3645,7 @@ bool CServerEditionModule::checkScenario(CObject* scenario)
uint32 max = acts->getSize();
for(uint32 i = 0;i<max;i++)
{
CObject * act = acts->getValue(i);
CObject * act = acts->getValueAtPos(i);
CObject * npcs = act->findAttr("Npcs");
CObject * states = act->findAttr("AiStates");
if (states && states->isTable())
@ -4022,14 +4022,14 @@ bool CServerEditionModule::getPosition(TSessionId sessionId, double& x, double&
CObject* acts = hl->getAttr("Acts");
BOMB_IF(!acts || !acts->isTable() || actIndex >= acts->getSize(), "Invalid acts.", return false);
CObject* selectedAct = acts->getValue(actIndex);
CObject* selectedAct = acts->getValueAtPos(actIndex);
BOMB_IF(!selectedAct || !selectedAct->isString("LocationId"), "Invalid act.", return false);
std::string locationInstanceId = selectedAct->toString("LocationId");
uint32 firstLocationIndex = 0, lastLocationIndex = locations->getSize();
for (; firstLocationIndex != lastLocationIndex; ++firstLocationIndex)
{
CObject* location = locations->getValue(firstLocationIndex);
CObject* location = locations->getValueAtPos(firstLocationIndex);
if ( location && location->isString("InstanceId") && location->toString("InstanceId") == locationInstanceId )
{
locationId = firstLocationIndex;
@ -4043,7 +4043,7 @@ bool CServerEditionModule::getPosition(TSessionId sessionId, double& x, double&
CObject* firstLocation = locations->getValue(locationId);
CObject* firstLocation = locations->getValueAtPos(locationId);
BOMB_IF(!firstLocation || !firstLocation->isTable(), "Invalid location.", return false);
CObject* entryPointObj = firstLocation->getAttr("EntryPoint");

View file

@ -123,7 +123,7 @@ CSmallStringManager::CSmallStringManager(CObject* textManager)
//unused ids
for(uint32 i=0;i<max;i++)
{
uint32 id = static_cast<uint32>(unused->getValue(i)->toInteger());
uint32 id = static_cast<uint32>(unused->getValueAtPos(i)->toInteger());
_FreeIds.insert(id);
}
@ -131,7 +131,7 @@ CSmallStringManager::CSmallStringManager(CObject* textManager)
max = texts->getSize();
for(uint32 i=0;i<max;i++)
{
CObject* entry = texts->getValue(i);
CObject* entry = texts->getValueAtPos(i);
std::string text = entry->getAttr("Text")->toString();
uint32 textId = static_cast<uint32>(entry->getAttr("TextId")->toInteger());
uint32 textCount = static_cast<uint32>(entry->getAttr("Count")->toInteger());

View file

@ -417,7 +417,7 @@ void CStringManagerModule::registerTableRequested(TSessionId sessionId,CObject*
//for each entry of the local table
for(uint i=0;i<max;++i)
{
CObject* text = textsTable->getValue(i);
CObject* text = textsTable->getValueAtPos(i);
CObject* tmp = text->getAttr("Id");
nlassert(tmp);
std::string localId = tmp->toString();

View file

@ -478,7 +478,7 @@ IFileAccess::TReturnCode CDeleteFile::execute(CFileAccessManager& manager)
}
while (i <= 10000 && NLMISC::CFile::fileExists(backup));
fileBackuped = (i <= 10000 && NLMISC::CFile::moveFile(backup.c_str(), (getBackupFileName(Filename)).c_str()));
fileBackuped = (i <= 10000 && NLMISC::CFile::moveFile(backup, getBackupFileName(Filename)));
}
catch (...)
{

View file

@ -3244,8 +3244,8 @@ NLMISC_COMMAND(moveCharAndOfflineCmdToHashTable, "Move all character and offline
CFile::createDirectory(PlayerManager.getCharacterPath(userId, false));
// move the file
CFile::moveFile(
(PlayerManager.getCharacterPath(userId, false)+CFile::getFilename(allChars[i])).c_str(),
allChars[i].c_str()
PlayerManager.getCharacterPath(userId, false)+CFile::getFilename(allChars[i]),
allChars[i]
);
}
}
@ -3271,8 +3271,8 @@ NLMISC_COMMAND(moveCharAndOfflineCmdToHashTable, "Move all character and offline
CFile::createDirectory(PlayerManager.getOfflineCommandPath(userId, false));
// move the file
CFile::moveFile(
(PlayerManager.getOfflineCommandPath(userId, false)+CFile::getFilename(allCommands[i])).c_str(),
allCommands[i].c_str()
PlayerManager.getOfflineCommandPath(userId, false)+CFile::getFilename(allCommands[i]),
allCommands[i]
);
}
}

View file

@ -127,7 +127,7 @@ void CPlayer::checkCrashMarker()
wipeAndRestore(NLMISC::toString("%s/account_%u_%d_pdr.bin", PlayerManager.getCharacterPath(userId, false).c_str(), userId, charId));
// string fileName = makeCharacterFileName(lastBad[0], lastBad[1]);
// CFile::moveFile((fileName+".wiped").c_str(), fileName.c_str());
// CFile::moveFile(fileName+".wiped", fileName);
//
// // try to restore a backup
// if (CFile::isExists(fileName+".last_good"))
@ -166,9 +166,9 @@ bool wipeAndRestore(const std::string &fileName)
return false;
}
// move the last wiped file
CFile::moveFile(incFn.c_str(), newfn.c_str());
CFile::moveFile(incFn, newfn);
}
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
// // try to restore a backup
//if (CFile::isExists(fileName+".last_good"))
@ -811,13 +811,13 @@ void CPlayer::loadAllCharacters()
{
nlwarning("Failed to load '%s': %s", serialBinFileName.c_str(), e.what());
string newfn = serialBinFileName+".wiped";
CFile::moveFile(newfn.c_str(), serialBinFileName.c_str());
CFile::moveFile(newfn, serialBinFileName);
}
catch(...)
{
nlwarning("Failed to load '%s': low level exception", serialBinFileName.c_str());
string newfn = serialBinFileName+".wiped";
CFile::moveFile(newfn.c_str(), serialBinFileName.c_str());
CFile::moveFile(newfn, serialBinFileName);
}
}
break;
@ -910,13 +910,13 @@ void CPlayer::loadAllCharacters()
{
nlwarning("Failed to load '%s': %s", fileName.c_str(), e.what());
string newfn = fileName+".wiped";
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
}
catch(...)
{
nlwarning("Failed to load '%s': low level exception", fileName.c_str());
string newfn = fileName+".wiped";
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
}
}
else
@ -937,13 +937,13 @@ void CPlayer::loadAllCharacters()
{
nlwarning("Failed to load '%s': %s", fileName.c_str(), e.what());
string newfn = fileName+".wiped";
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
}
catch(...)
{
nlwarning("Failed to load '%s': low level exception", fileName.c_str());
string newfn = fileName+".wiped";
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
}
}
}
@ -983,14 +983,14 @@ void CPlayer::loadAllCharactersPdr()
{
nlwarning("Failed to load '%s': %s", fileName.c_str(), e.what());
string newfn = fileName+".wiped";
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
continue;
}
catch(...)
{
nlwarning("Failed to load '%s': low level exception", fileName.c_str());
string newfn = fileName+".wiped";
CFile::moveFile(newfn.c_str(), fileName.c_str());
CFile::moveFile(newfn, fileName);
continue;
}

View file

@ -477,7 +477,7 @@ void CRepositoryReceiver::fileEnd(NLNET::IModuleProxy *sender, const std::string
// rename the temp file
// note that the _receiveBeginFile() method will have removed any file that could be in the way...
bool renameOk= NLMISC::CFile::moveFile((_TargetDirectory+awaitedFileName).c_str(),rrTempFileName(_TargetDirectory,_EmitterName).c_str());
bool renameOk= NLMISC::CFile::moveFile(_TargetDirectory+awaitedFileName, rrTempFileName(_TargetDirectory,_EmitterName));
DROP_IF(!renameOk,"Failed to move tmp file ('"+rrTempFileName(_TargetDirectory,_EmitterName)+"') to : '"+fileNameRec+"'",return);
// setup the index entry for this file and force an index file write

View file

@ -318,7 +318,7 @@ namespace SAVES
// do the moving
nlinfo("Treating request to move file: %s => %s",srcPath.c_str(),dstPath.c_str());
CFile::moveFile((_Path+dstPath).c_str(),(_Path+srcPath).c_str());
CFile::moveFile(_Path+dstPath, _Path+srcPath);
// make sure the src file no longer exists and that a destination file now exists
if (CFile::fileExists(_Path+srcPath) && !CFile::fileExists(_Path+dstPath))

View file

@ -138,7 +138,7 @@ bool finalisePatch(const NLMISC::CSString& installDir,const NLMISC::CSString& fi
// rename the final patched file
nldebug("SPA RENAME: %s => %s",srcFile.c_str(),destFile.c_str());
NLMISC::CFile::moveFile(destFile.c_str(),srcFile.c_str());
NLMISC::CFile::moveFile(destFile, srcFile);
// delete the temp file used in patch generation (if there was one)
if (NLMISC::CFile::fileExists(oldFile))

View file

@ -98,7 +98,7 @@ public:
// rename the created file...
DROP_IF(!NLMISC::CFile::fileExists(_TmpFileName),"No output file created: "+_TmpFileName,return);
DROP_IF(NLMISC::CFile::fileExists(_FileName),"Cannot rename output file '"+_TmpFileName+"' because another file is in the way: "+_FileName,return);
NLMISC::CFile::moveFile(_FileName.c_str(),_TmpFileName.c_str());
NLMISC::CFile::moveFile(_FileName, _TmpFileName);
DROP_IF(!NLMISC::CFile::fileExists(_FileName),"Failed to create final output file: '"+_FileName+"' from tmp file: '"+_TmpFileName+"'",return);
}

View file

@ -246,7 +246,7 @@ public:
of.serial(*this);
}
// rename the 'tmp" into finale output file
NLMISC::CFile::moveFile(fileName.c_str(), (fileName+".tmp").c_str());
NLMISC::CFile::moveFile(fileName, fileName+".tmp");
}

View file

@ -274,7 +274,7 @@ void CMailForumService::changeUserName(uint32 shardid, const string& oldName, co
uint i;
for (i=0; i<files.size(); ++i)
CFile::moveFile((newdir+CFile::getFilename(files[i])).c_str(), files[i].c_str());
CFile::moveFile(newdir+CFile::getFilename(files[i]), files[i]);
}
@ -373,7 +373,7 @@ void CMailForumService::removeUser( uint32 shardid, string username )
}
while (CFile::isExists(userDelDir));
CFile::moveFile(userDelDir.c_str(), userDir.c_str());
CFile::moveFile(userDelDir, userDir);
}
// ****************************************************************************
@ -392,7 +392,7 @@ void CMailForumService::removeGuild( uint32 shardid, string guildname )
}
while (CFile::isExists(guildDelDir));
CFile::moveFile(guildDelDir.c_str(), guildDir.c_str());
CFile::moveFile(guildDelDir, guildDir);
}

View file

@ -677,7 +677,7 @@ namespace PATCHMAN
}
// write succeeded so rename the tmp file to the correct file name
bool ok= NLMISC::CFile::moveFile(fileName.c_str(),tmpFileName.c_str());
bool ok= NLMISC::CFile::moveFile(fileName, tmpFileName);
DROP_IF(!ok,"Failed to save file '"+fileName+"' because failed to rename tmp file: '"+tmpFileName+"'",return false);
return true;

View file

@ -493,7 +493,7 @@ void CRepositoryReceiver::fileList(NLNET::IModuleProxy *sender, uint32 version,
//
// // rename the temp file
// // note that the _receiveBeginFile() method will have removed any file that could be in the way...
// bool renameOk= NLMISC::CFile::moveFile((_TargetDirectories.patchDirectoryName()+awaitedFileName).c_str(),rrTempFileName(_TargetDirectories.patchDirectoryName(),_EmitterName).c_str());
// bool renameOk= NLMISC::CFile::moveFile(_TargetDirectories.patchDirectoryName()+awaitedFileName, rrTempFileName(_TargetDirectories.patchDirectoryName(),_EmitterName));
// DROP_IF(!renameOk,"Failed to move tmp file ('"+rrTempFileName(_TargetDirectories.patchDirectoryName(),_EmitterName)+"') to : '"+fileNameRec+"'",return);
//
// // If we're all done then we need to set the new version number

View file

@ -290,7 +290,7 @@ void CServerPatchTerminal::onModuleUpdate()
{
// move the command file to a tmp file...
CSString tmpFileName= _CommandFileName+"__patchman__spt__.tmp";
bool ok= NLMISC::CFile::moveFile(tmpFileName.c_str(),_CommandFileName.c_str());
bool ok= NLMISC::CFile::moveFile(tmpFileName,_CommandFileName);
DROP_IF(!ok,"Attempt to move file '"+_CommandFileName+"' to '"+tmpFileName+"' FAILED",return);
// read the tmp file and delete it

View file

@ -1409,7 +1409,7 @@ bool CDatabase::isReferenceUpToDate()
{
if (timestamp > _State.EndTimestamp)
{
CFile::moveFile((files[i]+".disabled").c_str(), files[i].c_str());
CFile::moveFile(files[i]+".disabled", files[i]);
continue;
}

View file

@ -1,3 +1,4 @@
IF(WITH_RYZOM_TOOLS)
ADD_SUBDIRECTORY(skill_extractor)
ADD_SUBDIRECTORY(make_alias_file)
ADD_SUBDIRECTORY(make_anim_by_race)
@ -8,23 +9,24 @@ ADD_SUBDIRECTORY(leveldesign)
IF(WITH_LIGO)
ADD_SUBDIRECTORY(translation_tools)
ENDIF(WITH_LIGO)
ENDIF()
IF(WITH_NET)
ADD_SUBDIRECTORY(stats_scan)
ADD_SUBDIRECTORY(pdr_util)
ADD_SUBDIRECTORY(patch_gen)
IF(WIN32)
ADD_SUBDIRECTORY(sheets_packer_shard)
ENDIF(WIN32)
ENDIF(WITH_NET)
ENDIF()
ENDIF()
IF(WITH_LIGO AND WITH_NET)
ADD_SUBDIRECTORY(sheets_packer)
ENDIF(WITH_LIGO AND WITH_NET)
ENDIF()
ENDIF()
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(server)
# Old stuff that doesn't compile anymore.

View file

@ -6,4 +6,6 @@ IF(WITH_RYZOM_CLIENT)
ENDIF()
ENDIF()
IF(WITH_RYZOM_TOOLS)
ADD_SUBDIRECTORY(r2_islands_textures)
ENDIF()

View file

@ -51,8 +51,6 @@ ELSE()
QT5_ADD_RESOURCES(CLIENT_CONFIG_RC_SRCS ${CLIENT_CONFIG_RCS})
QT5_WRAP_CPP(CLIENT_CONFIG_MOC_SRC ${CLIENT_CONFIG_HDR})
QT5_WRAP_UI(CLIENT_CONFIG_UI_HDRS ${CLIENT_CONFIG_UIS})
SET(QT_LIBRARIES Qt5::Widgets Qt5::Core Qt5::Gui Qt5::OpenGL)
ENDIF()
SOURCE_GROUP("Resources" FILES ${CLIENT_CONFIG_RCS})

View file

@ -21,6 +21,19 @@
#include <QSplashScreen>
#ifdef QT_STATICPLUGIN
#include <QtPlugin>
#ifdef Q_OS_WIN32
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#endif
#ifdef Q_OS_MAC
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
#endif
#endif
int main( sint32 argc, char **argv )
{
QApplication app( argc, argv );

View file

@ -20,13 +20,13 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Client Config Qt"
VALUE "FileDescription", "Ryzom Configuration"
VALUE "FileVersion", NL_VERSION
VALUE "LegalCopyright", COPYRIGHT
#ifdef _DEBUG
VALUE "OriginalFilename", "client_config_qt_d.exe"
VALUE "OriginalFilename", "ryzom_configuration_qt_d.exe"
#else
VALUE "OriginalFilename", "client_config_qt_r.exe"
VALUE "OriginalFilename", "ryzom_configuration_qt_r.exe"
#endif
VALUE "ProductName", "Ryzom Core"
VALUE "ProductVersion", NL_VERSION

View file

@ -76,15 +76,34 @@ void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,c
void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
{
{
// old syntax incompatible with new versions
std::string cmd = "lzma e ";
cmd += " " + sourceFile + " " + outputFile;
nlinfo("executing system command: %s",cmd.c_str());
nlinfo("Executing system command: %s", cmd.c_str());
}
#ifdef NL_OS_WINDOWS
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
#else // NL_OS_WINDOWS
// new lzma only supports one file name on command line, so make a copy
CFile::copyFile(sourceFile, outputFile);
// new lzma syntax, -z = compress, -9 = best compression
std::string cmd = NLMISC::toString("lzma -z -9 %s", outputFile.c_str());
sint error = system(cmd.c_str());
if (error)
{
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
CFile::deleteFile(outputFile);
}
else
{
// lzma always append a .lzma extension, so rename compressed file to wanted one
CFile::moveFile(outputFile + ".lzma", outputFile);
}
#endif // NL_OS_WINDOWS
}
@ -369,7 +388,7 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const
// process cannot terminate)
GenerateLZMA(bnpFileName, lzmaFile+".tmp");
// rename the tmp file
CFile::moveFile(lzmaFile.c_str(), (lzmaFile+".tmp").c_str());
CFile::moveFile(lzmaFile, lzmaFile+".tmp");
}
// store the lzma file size in the descriptor

View file

@ -1,9 +1,12 @@
IF(WITH_RYZOM_TOOLS)
IF(WITH_LIGO)
ADD_SUBDIRECTORY(ai_build_wmap)
ENDIF(WITH_LIGO)
ENDIF()
IF(WITH_3D)
ADD_SUBDIRECTORY(build_world_packed_col)
ENDIF(WITH_3D)
ENDIF()
ENDIF()
# Not done yet.
#admin

View file

@ -408,7 +408,7 @@ bool mergeStringDiff(vector<TStringInfo> &strings, const string &language, const
if (archiveDiff)
{
// move the diff file in the history dir
CFile::moveFile((historyDir+CFile::getFilename(diffs[i])).c_str(), diffs[i].c_str());
CFile::moveFile(historyDir+CFile::getFilename(diffs[i]), diffs[i]);
}
}
@ -801,7 +801,7 @@ int mergeStringDiff(int argc, char *argv[])
ucstring old;
CI18N::readTextFile(filename, old, false, true, false, CI18N::LINE_FMT_CRLF);
if (old != str)
CFile::moveFile((historyDir+CFile::getFilenameWithoutExtension(filename)+"_"+diffVersion+"."+CFile::getExtension(filename)).c_str(), filename.c_str());
CFile::moveFile(historyDir+CFile::getFilenameWithoutExtension(filename)+"_"+diffVersion+"."+CFile::getExtension(filename), filename);
}
CI18N::writeTextFile(filename, str);
@ -909,7 +909,7 @@ bool mergePhraseDiff(vector<TPhrase> &phrases, const string &language, bool only
if (archiveDiff)
{
// move the diff file in the history dir
CFile::moveFile((historyDir+CFile::getFilename(diffs[i])).c_str(), diffs[i].c_str());
CFile::moveFile(historyDir+CFile::getFilename(diffs[i]), diffs[i]);
}
}
@ -1165,7 +1165,7 @@ int mergePhraseDiff(int argc, char *argv[], int version)
ucstring old;
CI18N::readTextFile(filename, old, false, true, false, CI18N::LINE_FMT_CRLF);
if (old != str)
CFile::moveFile((historyDir+CFile::getFilenameWithoutExtension(filename)+"_"+diffVersion+"."+CFile::getExtension(filename)).c_str(), filename.c_str());
CFile::moveFile(historyDir+CFile::getFilenameWithoutExtension(filename)+"_"+diffVersion+"."+CFile::getExtension(filename), filename);
}
CI18N::writeTextFile(transDir+basename+".txt", str);
@ -1334,7 +1334,7 @@ int mergeClauseDiff(int argc, char *argv[])
ucstring old;
CI18N::readTextFile(filename, old, false, true, false, CI18N::LINE_FMT_CRLF);
if (old != str)
CFile::moveFile((historyDir+CFile::getFilenameWithoutExtension(filename)+"_"+diffVersion+"."+CFile::getExtension(filename)).c_str(), filename.c_str());
CFile::moveFile(historyDir+CFile::getFilenameWithoutExtension(filename)+"_"+diffVersion+"."+CFile::getExtension(filename), filename);
}
CI18N::writeTextFile(filename, str);
@ -1449,7 +1449,7 @@ bool mergeWorksheetDiff(const std::string filename, TWorksheet &sheet, bool only
if (archiveDiff)
{
// move the diff file in the history dir
CFile::moveFile((historyDir+CFile::getFilename(fileList[i])).c_str(), fileList[i].c_str());
CFile::moveFile(historyDir+CFile::getFilename(fileList[i]), fileList[i]);
}
}

View file

@ -245,7 +245,7 @@ void BNPFileHandle::addFiles( const vector<string> &filePathes)
if (CFile::fileExists( m_openedBNPFile ))
CFile::deleteFile( m_openedBNPFile );
string src = m_openedBNPFile + ".tmp";
CFile::moveFile( m_openedBNPFile.c_str(), src.c_str() );
CFile::moveFile(m_openedBNPFile, src);
}
// ***************************************************************************
void BNPFileHandle::deleteFiles( const vector<string>& fileNames)
@ -281,7 +281,7 @@ void BNPFileHandle::deleteFiles( const vector<string>& fileNames)
CFile::deleteFile( m_openedBNPFile );
string src = m_openedBNPFile + ".tmp";
CFile::moveFile( m_openedBNPFile.c_str(), src.c_str() );
CFile::moveFile(m_openedBNPFile, src);
}
// ***************************************************************************
void BNPFileHandle::append(const string &destination, const PackedFile &source)