Merge with develop

This commit is contained in:
kervala 2016-11-20 14:51:11 +01:00
parent e529295ca4
commit 4d96978674
372 changed files with 1824 additions and 1777 deletions

View file

@ -18,6 +18,7 @@ FIND_PATH(MAXSDK_DIR
PATHS
"$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk"
@ -36,7 +37,7 @@ FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
)
IF(TARGET_X64)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release)
ELSE()
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
ENDIF()
@ -73,8 +74,26 @@ if(MAXSDK_FOUND)
${MAXSDK_MAXUTIL_LIBRARY}
${MAXSDK_MAXSCRIPT_LIBRARY}
${MAXSDK_PARAMBLK2_LIBRARY}
${MAXSDK_BMM_LIBRARY} )
${MAXSDK_BMM_LIBRARY})
# parse maxversion.h to determine SDK version
IF(EXISTS "${MAXSDK_DIR}/include/maxversion.h")
FILE(STRINGS "${MAXSDK_DIR}/include/maxversion.h" LINES REGEX "#define MAX_PRODUCT_YEAR_NUMBER ([0-9]+)")
STRING(REGEX REPLACE ".+MAX_PRODUCT_YEAR_NUMBER ([0-9]+)" "\\1" MAXSDK_VERSION "${LINES}")
UNSET(LINES)
ELSE()
SET(MAXSDK_VERSION "Unknown")
ENDIF()
MESSAGE(STATUS "Found 3dsmax version ${MAXSDK_VERSION} in ${MAXSDK_DIR}")
# 3ds Max 2013 and later are always Unicode
IF(MAXSDK_VERSION VERSION_GREATER 2012)
SET(MAXSDK_DEFINITIONS -DUNICODE -D_UNICODE)
ELSE()
SET(MAXSDK_DEFINITIONS)
ENDIF()
ELSE()
set(MAXSDK_LIBRARIES)
ENDIF()

View file

@ -367,7 +367,7 @@ ENDMACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
MACRO(ADD_PLATFORM_FLAGS _FLAGS)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${_FLAGS}")
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${_FLAGS}")
ENDMACRO(ADD_PLATFORM_FLAGS)
ENDMACRO()
MACRO(NL_SETUP_BUILD)
@ -390,9 +390,13 @@ MACRO(NL_SETUP_BUILD)
ENDIF()
ENDIF()
IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
SET(HOST_CPU ${CMAKE_CXX_LIBRARY_ARCHITECTURE})
ELSE()
SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR})
ENDIF()
IF(HOST_CPU MATCHES "(amd|AMD)64")
IF(HOST_CPU MATCHES "(amd|AMD|x86_)64")
SET(HOST_CPU "x86_64")
ELSEIF(HOST_CPU MATCHES "i.86")
SET(HOST_CPU "x86")
@ -402,10 +406,10 @@ MACRO(NL_SETUP_BUILD)
# If not specified, use the same CPU as host
IF(NOT TARGET_CPU)
SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
SET(TARGET_CPU ${HOST_CPU})
ENDIF()
IF(TARGET_CPU MATCHES "(amd|AMD)64")
IF(TARGET_CPU MATCHES "(amd|AMD|x86_)64")
SET(TARGET_CPU "x86_64")
ELSEIF(TARGET_CPU MATCHES "i.86")
SET(TARGET_CPU "x86")
@ -413,7 +417,7 @@ MACRO(NL_SETUP_BUILD)
IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
SET(CLANG ON)
MESSAGE(STATUS "Using Clang compiler")
MESSAGE(STATUS "Using Clang ${CMAKE_CXX_COMPILER_VERSION} compiler")
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Xcode")
@ -474,6 +478,9 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "arm64")
SET(TARGET_ARM 1)
SET(TARGET_ARM64 1)
ELSEIF(TARGET_CPU STREQUAL "armv7s")
SET(TARGET_ARM 1)
SET(TARGET_ARMV7S 1)
@ -493,6 +500,10 @@ MACRO(NL_SETUP_BUILD)
ENDIF()
IF(TARGET_ARM)
IF(TARGET_ARM64)
ADD_PLATFORM_FLAGS("-DHAVE_ARM64")
ENDIF()
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S")
ENDIF()
@ -541,10 +552,6 @@ MACRO(NL_SETUP_BUILD)
ENDIF()
IF(MSVC)
IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
SET(MSVC11 ON)
ENDIF()
# Ignore default include paths
ADD_PLATFORM_FLAGS("/X")
@ -555,31 +562,31 @@ MACRO(NL_SETUP_BUILD)
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC12)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2013, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC11)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2012, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC10)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC90)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy-")
# don't use a /O[012x] flag if you want custom optimizations
SET(RELEASE_CFLAGS "/Ob2 /Oi /Ot /Oy /GT /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC80)
ADD_PLATFORM_FLAGS("/Gy- /Wp64 /Zm1000")
ADD_PLATFORM_FLAGS("/Gy- /Wp64")
# don't use a /O[012x] flag if you want custom optimizations
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
@ -588,16 +595,19 @@ MACRO(NL_SETUP_BUILD)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF()
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /wd4250")
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /D_WIN32 /DWIN32 /D_WINDOWS /wd4250")
# huge PCH
ADD_PLATFORM_FLAGS("/Zm1000")
IF(TARGET_X64)
# Fix a bug with Intellisense
ADD_PLATFORM_FLAGS("/D_WIN64")
# Fix a compilation error for some big C++ files
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj")
ADD_PLATFORM_FLAGS("/bigobj")
ELSE()
# Allows 32 bits applications to use 3 GB of RAM
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
ADD_PLATFORM_LINKFLAGS("/LARGEADDRESSAWARE")
ENDIF()
# Exceptions are only set for C++
@ -840,6 +850,9 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("-D_REENTRANT -fno-strict-aliasing")
# hardening
ADD_PLATFORM_FLAGS("-D_FORTIFY_SOURCE=2")
IF(NOT WITH_LOW_MEMORY)
ADD_PLATFORM_FLAGS("-pipe")
ENDIF()
@ -850,6 +863,12 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_WARNINGS)
ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused")
ELSE()
# Check wrong formats in printf-like functions
ADD_PLATFORM_FLAGS("-Wformat -Werror=format-security")
# Don't display invalid or unused command lines arguments by default (often too verbose)
ADD_PLATFORM_FLAGS("-Wno-invalid-command-line-argument -Wno-unused-command-line-argument")
ENDIF()
IF(ANDROID)
@ -859,7 +878,7 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("-Wa,--noexecstack")
IF(TARGET_ARM)
ADD_PLATFORM_FLAGS("-fpic -fstack-protector")
ADD_PLATFORM_FLAGS("-fpic")
ADD_PLATFORM_FLAGS("-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__")
IF(TARGET_ARMV7)
@ -871,24 +890,20 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_THUMB ON)
IF(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64")
ADD_PLATFORM_FLAGS("-mthumb -finline-limit=64")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm")
ELSE()
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
ENDIF()
ELSEIF(TARGET_X86)
# Optimizations for Intel Atom
ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops")
ADD_PLATFORM_FLAGS("-fstack-protector -funswitch-loops -finline-limit=300")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
ELSEIF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing")
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300")
ENDIF()
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib")
ENDIF()
@ -897,16 +912,22 @@ MACRO(NL_SETUP_BUILD)
ENDIF()
# Fix "relocation R_X86_64_32 against.." error on x64 platforms
IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
IF(NOT MINGW)
ADD_PLATFORM_FLAGS("-fPIC")
ENDIF()
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
# hardening
ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
ENDIF()
# hardening
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now")
IF(WITH_SYMBOLS)
SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g")
ELSE()
@ -920,7 +941,7 @@ MACRO(NL_SETUP_BUILD)
SET(NL_DEBUG_CFLAGS "-g -DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}")
ENDIF()
ENDMACRO(NL_SETUP_BUILD)
ENDMACRO()
MACRO(NL_SETUP_BUILD_FLAGS)
SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE)

View file

@ -84,7 +84,7 @@ public:
void setTextureFile (const char* file);
/**
* Add a coarse mesh in the manager. If an error occured, it returns CantAddCoarseMesh.
* Add a coarse mesh in the manager. If an error occurred, it returns CantAddCoarseMesh.
* \param vBuffer the VertexBuffer pre-transformed / Colored. Size MUST be numVertices*NL3D_COARSEMESH_VERTEX_FORMAT_MGR
* \param indexBuffer containing triangles that will be inserted.
* \return false if the mesh can't be added to this pass BECAUSE OF TOO MANY VERTICES or TOO MANY PRIMITIVES reason

View file

@ -716,7 +716,7 @@ private:
bool _RefineMode;
float _FarTransition;
uint _TileMaxSubdivision;
// For VertexProgram. true if change has occured in threshold since the last render().
// For VertexProgram. true if change has occurred in threshold since the last render().
float _VPThresholdChange;
/// \name VertexBuffer mgt.

View file

@ -92,9 +92,9 @@ public:
void setWorldMatrix (const NLMISC::CMatrix &WM);
void setName (std::string &name) { _Name = name; }
void setName (const std::string &name) { _Name = name; }
std::string getName () { return _Name; }
std::string getName () const { return _Name; }
void open (bool opened) { _Opened = opened; }
bool isOpened () { return _Opened; }

View file

@ -24,6 +24,8 @@
#include "nel/misc/rgba.h"
#include "nel/misc/traits_nl.h"
#include <iterator>
namespace NL3D {
/*
@ -480,7 +482,11 @@ void CPSValueGradientFunc<T>::setValuesUnpacked(const T *valueTab, uint32 numVal
_MaxValue = _MinValue = valueTab[0];
_NbValues = (numValues - 1) * nbStages;
_Tab.resize(_NbValues + 1);
#ifdef NL_COMP_VC14
std::copy(valueTab, valueTab + _NbValues + 1, stdext::make_checked_array_iterator(&_Tab[0], _Tab.size()));
#else
std::copy(valueTab, valueTab + _NbValues + 1, &_Tab[0]);
#endif
}

View file

@ -336,7 +336,7 @@ protected:
* should not be called directly. Call CPSLocated::resize instead
*/
virtual void resize(uint32 size);
virtual void bounceOccured(uint32 index, TAnimationTime timeToNextSimStep);
virtual void bounceOccurred(uint32 index, TAnimationTime timeToNextSimStep);
void updateMaxCountVect();

View file

@ -66,14 +66,14 @@ class CParticleSystem;
/// This structure helps to perform the collision step, by telling which collisionner is the nearest if there are several candidate
/// a distance of -1 indicates that no collisions occured
/// a distance of -1 indicates that no collisions occurred
struct CPSCollisionInfo
{
CPSCollisionInfo *Next;
float Dist; // Distance to the nearest collider, or -1 if not collision occured
float Dist; // Distance to the nearest collider, or -1 if not collision occurred
NLMISC::CVector NewPos;
NLMISC::CVector NewSpeed; // The speed of particle after a collision occured. After the updated of collision it is swapped with the post-collision speed
CPSZone *CollisionZone; // The zone on which the bounce occured, can be useful to check the behaviour in case of collision
NLMISC::CVector NewSpeed; // The speed of particle after a collision occurred. After the updated of collision it is swapped with the post-collision speed
CPSZone *CollisionZone; // The zone on which the bounce occurred, can be useful to check the behaviour in case of collision
uint32 Index;
CPSCollisionInfo()
{
@ -906,10 +906,10 @@ protected:
*/
virtual void resize(uint32 size) = 0;
/** a bounce occured, so some action could be done. The default behaviour does nothing
/** a bounce occurred, so some action could be done. The default behaviour does nothing
* \param index the index of the element that bounced
*/
virtual void bounceOccured(uint32 /* index */, TAnimationTime /* timeToNextsimStep */) {}
virtual void bounceOccurred(uint32 /* index */, TAnimationTime /* timeToNextsimStep */) {}
/** show an drawing to represent the object, and in red if it is selected
* \param tab : a table of 2 * nbSeg vector. only the x and y coordinates are used

View file

@ -120,7 +120,7 @@ protected:
/**
* This set speed of a located so that it looks like bouncing on a surface
* \param locatedIndex the index
* \param bouncePoint the position where the collision occured
* \param bouncePoint the position where the collision occurred
* \param surfNormal the normal of the surface at the collision point (this must be a unit vector)
* \elasticity 1 = full bounce, 0 = no bounce (contact)
* \ellapsedTime the time ellapsed

View file

@ -79,7 +79,7 @@ public:
/** Set the userPos (relative to the height map coordinates). This is needed because a height map can't be used with large surface (such as a sea).
* As a consequence, the height map is only valid below the user (e.g from user.x - 0.5 * size to user.x + 0.5 *size).
* When setPos is called, and if a move has occured, new area of the height field are set to 0
* When setPos is called, and if a move has occurred, new area of the height field are set to 0
* The pos set will be taken in account when buffers have been swapped (e.g when the propagation time as ellapsed)
*/
void setUserPos(sint x, sint y);

View file

@ -90,7 +90,7 @@ namespace NLGUI
virtual std::string luaWhat() const throw() {return NLMISC::toString("LUAError: %s", what());}
};
// A parse error occured
// A parse error occurred
class ELuaParseError : public ELuaError
{
public:
@ -117,7 +117,7 @@ namespace NLGUI
std::string _Reason;
};
// A execution error occured
// A execution error occurred
class ELuaExecuteError : public ELuaError
{
public:
@ -128,7 +128,7 @@ namespace NLGUI
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaExecuteError: %s", what());}
};
// A bad cast occured when using lua_checkcast
// A bad cast occurred when using lua_checkcast
class ELuaBadCast : public ELuaError
{
public:

View file

@ -49,13 +49,13 @@ public:
* This file will try to open the file ligo class description file (XML) using the LigoClass as file name.
* It will try first to load directly the file and then to lookup the file in NLMISC::CPath.
*/
bool readConfigFile (const char *fileName, bool parsePrimitiveComboContent);
bool readConfigFile (const std::string &fileName, bool parsePrimitiveComboContent);
/**
* This file will read the file ligo class description file (XML) using the LigoClass as file name.
* It will try first to load directly the file and then to lookup the file in NLMISC::CPath.
*/
bool readPrimitiveClass (const char *fileName, bool parsePrimitiveComboContent);
bool readPrimitiveClass (const std::string &fileName, bool parsePrimitiveComboContent);
bool reloadIndexFile(const std::string &indexFileName = std::string());
@ -100,7 +100,7 @@ public:
/// Build a standard human readable alias string
std::string aliasToString(uint32 fullAlias);
/// Read a standard human readable alias string
uint32 aliasFromString(std::string fullAlias);
uint32 aliasFromString(const std::string &fullAlias);
// Get a primitive class

View file

@ -286,6 +286,15 @@ inline sint nlstricmp(const char *lhs, const std::string &rhs) { return stricmp(
#define wideToUtf8(str) (ucstring((ucchar*)str).toUtf8())
#define utf8ToWide(str) ((wchar_t*)ucstring::makeFromUtf8(str).c_str())
// macros helper to convert UTF-8 std::string and TCHAR*
#ifdef _UNICODE
#define tStrToUtf8(str) (ucstring((ucchar*)(LPCWSTR)str).toUtf8())
#define utf8ToTStr(str) ((wchar_t*)ucstring::makeFromUtf8(str).c_str())
#else
#define tStrToUtf8(str) ((LPCSTR)str)
#define utf8ToTStr(str) (str.c_str())
#endif
// wrapper for fopen to be able to open files with an UTF-8 filename
FILE* nlfopen(const std::string &filename, const std::string &mode);

View file

@ -46,7 +46,7 @@ public:
double getSamplingPeriod() const { return _SamplingPeriod; }
// Reset smoother. The next returned position will be the exact position of mouse (no smoothing with previous position is done)
void reset();
// \return trueif no sampling has occured since last resetor construction
// \return trueif no sampling has occurred since last resetor construction
bool isReseted() const { return !_Init; }
// Sample pos, and return smoothed position
CVector2f samplePos(const CVector2f &wantedPos, double date);

View file

@ -29,7 +29,7 @@ struct CHashKey
CHashKey (const unsigned char Message_Digest[20])
{
HashKeyString = "";
HashKeyString.clear();
for(sint i = 0; i < 20 ; ++i)
{
HashKeyString += Message_Digest[i];
@ -45,7 +45,7 @@ struct CHashKey
}
else if (str.size() == 40)
{
HashKeyString = "";
HashKeyString.clear();
for(uint i = 0; i < str.size(); i+=2)
{
uint8 val;

View file

@ -81,7 +81,7 @@ public:
}
//nldebug("active, leave sleep, test assert");
// If this assert occured, it means that a checked part of the code was
// If this assert occurred, it means that a checked part of the code was
// to slow and then I decided to assert to display the problem.
nlassert(!(_Control==ACTIVE && _Counter==lastCounter));
}

View file

@ -159,7 +159,7 @@ public:
/** Force to send data pending in the send queue now. If all the data could not be sent immediately,
* the returned nbBytesRemaining value is non-zero.
* \param nbBytesRemaining If the pointer is not NULL, the method sets the number of bytes still pending after the flush attempt.
* \returns False if an error has occured (e.g. the remote host is disconnected).
* \returns False if an error has occurred (e.g. the remote host is disconnected).
* To retrieve the reason of the error, call CSock::getLastError() and/or CSock::errorString()
*/
bool flush( uint *nbBytesRemaining=NULL ) { return _BufSock->flush( nbBytesRemaining ); }

View file

@ -235,7 +235,7 @@ public:
* the returned nbBytesRemaining value is non-zero.
* \param destid The identifier of the destination connection.
* \param nbBytesRemaining If the pointer is not NULL, the method sets the number of bytes still pending after the flush attempt.
* \returns False if an error has occured (e.g. the remote host is disconnected).
* \returns False if an error has occurred (e.g. the remote host is disconnected).
* To retrieve the reason of the error, call CSock::getLastError() and/or CSock::errorString()
*/
bool flush( TSockId destid, uint *nbBytesRemaining=NULL );

View file

@ -84,7 +84,7 @@ protected:
///@name Sending data
//@{
/// Update the network sending (call this method evenly). Returns false if an error occured.
/// Update the network sending (call this method evenly). Returns false if an error occurred.
bool update();
/** Sets the time flush trigger (in millisecond). When this time is elapsed,
@ -101,7 +101,7 @@ protected:
* (see CNonBlockingBufSock), if all the data could not be sent immediately,
* the returned nbBytesRemaining value is non-zero.
* \param nbBytesRemaining If the pointer is not NULL, the method sets the number of bytes still pending after the flush attempt.
* \returns False if an error has occured (e.g. the remote host is disconnected).
* \returns False if an error has occurred (e.g. the remote host is disconnected).
* To retrieve the reason of the error, call CSock::getLastError() and/or CSock::errorString()
*/
bool flush( uint *nbBytesRemaining=NULL );
@ -170,7 +170,7 @@ protected:
}
/** Pushes a buffer to the send queue and update,
* or returns false if the socket is not physically connected the or an error occured during sending
* or returns false if the socket is not physically connected the or an error occurred during sending
*/
bool pushBuffer( const NLMISC::CMemStream& buffer )
{

View file

@ -553,7 +553,7 @@ static void cbPacsAnswer (CMessage &msgin, TSockId from, CCallbackNetBase &netba
client->getPositionSpeedCallback (id, position, speed);
}
else
NLMISC::nlError ("Pacs client: unkown sub message string");
NLMISC::nlError ("Pacs client: unknown sub message string");
// Next message ?
msgin.serial (again);

View file

@ -121,7 +121,7 @@ public:
/// Releases the network engine
static void releaseNetwork();
/** Returns the code of the last error that has occured.
/** Returns the code of the last error that has occurred.
* Note: This code is platform-dependant. On Unix, it is errno; on Windows it is the Winsock error code.
* See also errorString()
*/

View file

@ -52,7 +52,7 @@ public:
static const char *getStringUniTime (NLMISC::TTime ut);
/** You need to call this function before calling getUniTime or an assert will occured.
/** You need to call this function before calling getUniTime or an assert will occurred.
* This function will connect to the time service and synchronize your computer.
* This function assumes that all services run on server that are time synchronized with NTP for example.
* If addr is NULL, the function will connect to the Time Service via the Naming Service. In this case,
@ -87,11 +87,11 @@ public:
*/
static void simulate() { nlstop; _Simulate = true; }
static bool Sync; // true if the synchronization occured
static bool Sync; // true if the synchronization occurred
private:
static NLMISC::TTime _SyncUniTime; // time in millisecond when the universal time received
static NLMISC::TTime _SyncLocalTime; // time in millisecond when the syncro with universal time occured
static NLMISC::TTime _SyncLocalTime; // time in millisecond when the syncro with universal time occurred
// If true, do not synchronize
static bool _Simulate;

View file

@ -282,7 +282,7 @@ private:
// Free world image pointers
void freeWorldImage (CPrimitiveWorldImage *worldImage);
// Called by CMovePrimitive when a change occured on the primitive BB
// Called by CMovePrimitive when a change occurred on the primitive BB
void changed (CMovePrimitive* primitive, uint8 worldImage);
// Remove the collisionable primitive from the modified list

View file

@ -319,7 +319,7 @@ void CCluster::serial (NLMISC::IStream&f)
// write the env fx name
std::string envFxName = CStringMapper::unmap(_EnvironmentFxId);
if (envFxName == "no fx")
envFxName = "";
envFxName.clear();
f.serial(envFxName);
}

View file

@ -1265,7 +1265,7 @@ bool CDriverD3D::init (uintptr_t windowIcon, emptyProc exitFunc)
if (error != ERROR_CLASS_ALREADY_EXISTS)
{
nlwarning("CDriverD3D::init: Can't register window class %s (error code %i)", _WindowClass.c_str(), (sint)error);
_WindowClass = "";
_WindowClass.clear();
return false;
}
}

View file

@ -568,7 +568,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat)
if (_PixelProgram)
{
#ifdef NL_DEBUG_D3D
// Check, should not occured
// Check, should not occur
nlassertex (_PixelShader, ("STOP : no pixel shader available. Can't render this material."));
#endif // NL_DEBUG_D3D

View file

@ -62,7 +62,7 @@ void CD3DShaderFX::setName (const char *name)
bool CD3DShaderFX::loadShaderFile (const char *filename)
{
_Text = "";
_Text.clear();
// Lookup
string _filename = NLMISC::CPath::lookup(filename, false, true, true);
if (!_filename.empty())

View file

@ -270,7 +270,7 @@ uint getPixelFormatSize (D3DFORMAT destFormat)
case D3DFMT_DXT3: bits=8; break;
case D3DFMT_DXT4: bits=8; break;
case D3DFMT_DXT5: bits=8; break;
default: nlstop; break; // unkown pixel format
default: nlstop; break; // unknown pixel format
}
return bits;
}

View file

@ -109,7 +109,7 @@ void dumpWriteMask(uint mask, std::string &out)
H_AUTO_D3D(dumpWriteMask)
if (mask == 0xf)
{
out = "";
out.clear();
return;
}
out = ".";
@ -126,7 +126,7 @@ void dumpSwizzle(const CVPSwizzle &swz, std::string &out)
H_AUTO_D3D(dumpSwizzle)
if (swz.isIdentity())
{
out = "";
out.clear();
return;
}
out = ".";

View file

@ -491,7 +491,7 @@ void CDriverGL::showCursor(bool b)
}
else
{
_CurrName = "";
_CurrName.clear();
}
// update current hardware icon to avoid to have the plain arrow

View file

@ -1270,7 +1270,7 @@ static void ARBVertexProgramDumpWriteMask(uint mask, std::string &out)
H_AUTO_OGL(ARBVertexProgramDumpWriteMask)
if (mask == 0xf)
{
out = "";
out.clear();
return;
}
out = ".";
@ -1286,7 +1286,7 @@ static void ARBVertexProgramDumpSwizzle(const CVPSwizzle &swz, std::string &out)
H_AUTO_OGL(ARBVertexProgramDumpSwizzle)
if (swz.isIdentity())
{
out = "";
out.clear();
return;
}
out = ".";

View file

@ -626,7 +626,7 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server)
}
case SelectionClear:
_SelectionOwned = false;
_CopiedString = "";
_CopiedString.clear();
break;
case SelectionNotify:
{

View file

@ -262,8 +262,8 @@ void CLandscapeUser::refreshZonesAround(const CVector &pos, float radius, std::s
{
NL3D_HAUTO_LOAD_LANDSCAPE;
zoneRemoved= "";
zoneAdded= "";
zoneRemoved.clear();
zoneAdded.clear();
CZoneManager::SZoneManagerWork Work;
// Check if new zone must be added to landscape
if (_ZoneManager.isWorkComplete(Work))

View file

@ -1101,7 +1101,11 @@ bool CMeshGeom::retrieveTriangles(std::vector<uint32> &indices) const
else
{
// std::copy will convert from 16 bits index to 32 bit index
std::copy((uint16 *) iba.getPtr(), ((uint16 *) iba.getPtr()) + pb.getNumIndexes(), &indices[triIdx*3]);
#ifdef NL_COMP_VC14
std::copy((uint16 *)iba.getPtr(), ((uint16 *)iba.getPtr()) + pb.getNumIndexes(), stdext::make_checked_array_iterator(&indices[triIdx * 3], indices.size() - triIdx * 3));
#else
std::copy((uint16 *)iba.getPtr(), ((uint16 *)iba.getPtr()) + pb.getNumIndexes(), &indices[triIdx * 3]);
#endif
}
// next
triIdx+= pb.getNumIndexes()/3;

View file

@ -242,11 +242,11 @@ void CPortal::serial (NLMISC::IStream& f)
{
std::string occName = CStringMapper::unmap(_OcclusionModelId);
if (occName == "no occlusion")
occName = "";
occName.clear();
f.serial(occName);
occName = CStringMapper::unmap(_OpenOcclusionModelId);
if (occName == "no occlusion")
occName = "";
occName.clear();
f.serial(occName);
}
}

View file

@ -1901,9 +1901,9 @@ void CPSEmitter::resize(uint32 size)
}
///==========================================================================
void CPSEmitter::bounceOccured(uint32 index, TAnimationTime timeToNextSimStep)
void CPSEmitter::bounceOccurred(uint32 index, TAnimationTime timeToNextSimStep)
{
NL_PS_FUNC(CPSEmitter_bounceOccured)
NL_PS_FUNC(CPSEmitter_bounceOccurred)
// TODO : avoid duplication with deleteElement
if (_EmittedType && _EmissionType == CPSEmitter::onBounce)
{
@ -2797,7 +2797,7 @@ void CPSEmitter::doEmitOnce(uint firstInstanceIndex)
startPos = _Owner->getParametricInfos()[k].Pos;
}
float currTime = _Owner->getTime()[k];
_Owner->getTime()[k] = 0.f; // when emit occured, time was 0
_Owner->getTime()[k] = 0.f; // when emit occurred, time was 0
sint32 nbToGenerate = (sint32) (emitLOD * *numToEmitPtr);
if (nbToGenerate > 0)
{
@ -2830,7 +2830,7 @@ void CPSEmitter::doEmitOnce(uint firstInstanceIndex)
startPos = _Owner->getParametricInfos()[k].Pos;
}
float currTime = _Owner->getTime()[k];
_Owner->getTime()[k] = 0.f; // when emit occured, time was 0
_Owner->getTime()[k] = 0.f; // when emit occurred, time was 0
processEmitConsistent(startPos, k, nbToGenerate, _Owner->getAgeInSeconds(k) / CParticleSystem::RealEllapsedTimeRatio);
// restore time & pos
_Owner->getTime()[k] = currTime;

View file

@ -1004,7 +1004,7 @@ void CPSLocated::postNewElement(const NLMISC::CVector &pos,
const CPSCollisionInfo &ci = _Collisions[indexInEmitter];
if (ci.Dist != -1.f)
{
// a collision occured, check time from collision to next time step
// a collision occurred, check time from collision to next time step
if ((emitterLocated.getPos()[indexInEmitter] - ci.NewPos) * (pos - ci.NewPos) > 0.f) return; // discard emit that are farther than the collision
}
}
@ -1839,10 +1839,10 @@ void CPSLocated::updateCollisions()
{
_Pos[currCollision->Index] = currCollision->NewPos;
std::swap(_Speed[currCollision->Index], currCollision->NewSpeed); // keep speed because may be needed when removing particles
// notify each located bindable that a bounce occured ...
// notify each located bindable that a bounce occurred ...
for (TLocatedBoundCont::iterator it = _LocatedBoundCont.begin(); it != _LocatedBoundCont.end(); ++it)
{
(*it)->bounceOccured(currCollision->Index, computeDateFromCollisionToNextSimStep(currCollision->Index, getAgeInSeconds(currCollision->Index)));
(*it)->bounceOccurred(currCollision->Index, computeDateFromCollisionToNextSimStep(currCollision->Index, getAgeInSeconds(currCollision->Index)));
}
if (currCollision->CollisionZone->getCollisionBehaviour() == CPSZone::destroy)
{
@ -1878,13 +1878,13 @@ void CPSLocated::updateCollisions()
// if particle is too old, check whether it died before the collision
_Pos[currCollision->Index] = currCollision->NewPos;
std::swap(_Speed[currCollision->Index], currCollision->NewSpeed);
// notify each located bindable that a bounce occured ...
// notify each located bindable that a bounce occurred ...
if (!_LocatedBoundCont.empty())
{
TAnimationTime timeFromcollisionToNextSimStep = computeDateFromCollisionToNextSimStep(currCollision->Index, getAgeInSeconds(currCollision->Index));
for (TLocatedBoundCont::iterator it = _LocatedBoundCont.begin(); it != _LocatedBoundCont.end(); ++it)
{
(*it)->bounceOccured(currCollision->Index, timeFromcollisionToNextSimStep);
(*it)->bounceOccurred(currCollision->Index, timeFromcollisionToNextSimStep);
}
}
if (currCollision->CollisionZone->getCollisionBehaviour() == CPSZone::destroy)
@ -2190,7 +2190,7 @@ void CPSLocated::removeOldParticles()
TAnimationTime timeUntilNextSimStep;
if (_Collisions[*it].Dist == -1.f)
{
// no collision occured
// no collision occurred
if (_Time[*it] > 1.f)
{
@ -2213,18 +2213,18 @@ void CPSLocated::removeOldParticles()
}
else
{
// a collision occured before particle died, so pos is already good
// a collision occurred before particle died, so pos is already good
if (_LifeScheme)
{
timeUntilNextSimStep = computeDateFromCollisionToNextSimStep(*it, _Time[*it] / _TimeIncrement[*it]);
// compute age of particle when collision occured
// compute age of particle when collision occurred
_Time[*it] -= timeUntilNextSimStep * _TimeIncrement[*it];
NLMISC::clamp(_Time[*it], 0.f, 1.f); // avoid imprecisions
}
else
{
timeUntilNextSimStep = computeDateFromCollisionToNextSimStep(*it, _Time[*it] * _InitialLife);
// compute age of particle when collision occured
// compute age of particle when collision occurred
_Time[*it] -= timeUntilNextSimStep / (_InitialLife == 0.f ? 1.f : _InitialLife);
NLMISC::clamp(_Time[*it], 0.f, 1.f); // avoid imprecisions
}

View file

@ -1113,6 +1113,9 @@ void CPSConstraintMesh::getShapesNames(std::string *shapesNames) const
{
const_cast<CPSConstraintMesh *>(this)->update();
}
#ifdef NL_COMP_VC14
std::copy(_MeshShapeFileName.begin(), _MeshShapeFileName.end(), stdext::make_unchecked_array_iterator(shapesNames));
#else
std::copy(_MeshShapeFileName.begin(), _MeshShapeFileName.end(), shapesNames);
}

View file

@ -1463,7 +1463,11 @@ void CPSRibbon::setShape(const CVector *shape, uint32 nbPointsInShape, bool brac
///==================================================================================================================
void CPSRibbon::getShape(CVector *shape) const
{
NL_PS_FUNC(CPSRibbon_getShape)
NL_PS_FUNC(CPSRibbon_getShape);
#ifdef NL_COMP_VC14
std::copy(_Shape.begin(), _Shape.end(), stdext::make_unchecked_array_iterator(shape));
#else
std::copy(_Shape.begin(), _Shape.end(), shape);
}

View file

@ -34,6 +34,7 @@
#include <functional>
#include <iostream>
#include <limits>
#include <iterator>
#include "nel/misc/rgba.h"
#include "nel/misc/debug.h"

View file

@ -2530,7 +2530,7 @@ void CTessFace::refreshTesselationGeometry()
// ***************************************************************************
bool CTessFace::updateBindEdge(CTessFace *&edgeFace, bool &splitWanted)
{
// Return true, when the bind should be Ok, or if a split has occured.
// Return true, when the bind should be Ok, or if a split has occurred.
// Return false only if pointers are updated, without splits.
if(edgeFace==NULL)

View file

@ -134,7 +134,7 @@ void CTileBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
nlassert (f.isReading());
// Reset _AbsPath
_AbsPath="";
_AbsPath.clear();
// Remove diffuse and additive in transition
uint tileCount=(uint)getTileCount ();
@ -782,7 +782,7 @@ void CTile::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
_Flags=0;
// Initialize alpha name
_BitmapName[alpha]="";
_BitmapName[alpha].clear();
// Read free flag
f.serial (tmp);
@ -804,7 +804,7 @@ void CTile::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
// ***************************************************************************
void CTile::clearTile (CTile::TBitmap type)
{
_BitmapName[type]="";
_BitmapName[type].clear();
}
@ -1521,7 +1521,7 @@ void CTileSet::setDisplacement (TDisplacement displacement, const std::string& f
// ***************************************************************************
void CTileSet::cleanUnusedData ()
{
_Name="";
_Name.clear();
_ChildName.clear();
_Border128[0].reset ();
_Border128[1].reset ();
@ -1853,14 +1853,12 @@ CTileNoise::CTileNoise ()
{
// Not loaded
_TileNoiseMap=NULL;
_FileName="";
}
// ***************************************************************************
CTileNoise::CTileNoise (const CTileNoise &src)
{
// Default ctor
_TileNoiseMap=NULL;
_FileName="";
// Copy
*this=src;
@ -1932,7 +1930,7 @@ void CTileNoise::reset()
}
// Erase filename
_FileName="";
_FileName.clear();
}
// ***************************************************************************

View file

@ -885,7 +885,7 @@ void CVertexBuffer::serialHeader(NLMISC::IStream &f)
if(f.isReading())
{
_PreferredMemory = RAMPreferred;
_Name = "";
_Name.clear();
}
}
}

View file

@ -1110,7 +1110,7 @@ static void dumpWriteMask(uint mask, std::string &out)
{
if (mask == 0xf)
{
out = "";
out.clear();
return;
}
out = ".";
@ -1125,7 +1125,7 @@ static void dumpSwizzle(const CVPSwizzle &swz, std::string &out)
{
if (swz.isIdentity())
{
out = "";
out.clear();
return;
}
out = ".";

View file

@ -305,7 +305,11 @@ void CWaterHeightMap::makeCpy(uint buffer, uint dX, uint dY, uint sX, uint sY,
{
if (dest < src)
{
#ifdef NL_COMP_VC14
std::copy(src, src + width, stdext::make_unchecked_array_iterator(dest));
#else
std::copy(src, src + width, dest);
#endif
}
else
{

View file

@ -170,7 +170,7 @@ bool CZoneManager::isWorkComplete (CZoneManager::SZoneManagerWork &rWork)
rWork.NameZoneAdded = ite->ZoneToAddName;
rWork.ZoneRemoved = false;
rWork.IdZoneToRemove = 0;
rWork.NameZoneRemoved = "";
rWork.NameZoneRemoved.clear();
rWork.Zone = const_cast<CZone*>(ite->Zone);
_LoadedZones.push_back (ite->ZoneToAddId);
@ -187,7 +187,7 @@ bool CZoneManager::isWorkComplete (CZoneManager::SZoneManagerWork &rWork)
{
_RemovingZone = false;
rWork.ZoneAdded = false;
rWork.NameZoneAdded = "";
rWork.NameZoneAdded.clear();
rWork.ZoneRemoved = true;
rWork.IdZoneToRemove = _IdZoneToRemove;
rWork.NameZoneRemoved = getZoneNameFromId(_IdZoneToRemove);

View file

@ -498,7 +498,7 @@ void CFormDfn::CEntry::setDfn (CFormLoader &loader, const char *filename)
void CFormDfn::CEntry::setDfnPointer ()
{
TypeElement = EntryVirtualDfn;
Filename = "";
Filename.clear();
Type = NULL;
Dfn = NULL;
}

View file

@ -1512,7 +1512,7 @@ const char* CFormElm::tokenize (const char *name, string &str, uint &/* errorInd
return name+1;
}
str = "";
str.clear();
while ( (*name != '.') && (*name != '[') && (*name != ']') && (*name != 0) )
{
// Add a char
@ -2066,7 +2066,7 @@ void CFormElmStruct::getFormName (std::string &result, const CFormElm *child) co
// Reset the result
if (child == NULL)
{
result = "";
result.clear();
result.reserve (50);
}
@ -2723,7 +2723,7 @@ void CFormElmArray::getFormName (std::string &result, const CFormElm *child) con
// Reset the result
if (child == NULL)
{
result = "";
result.clear();
result.reserve (50);
}
@ -3067,7 +3067,7 @@ void CFormElmAtom::getFormName (std::string &result, const CFormElm *child) cons
{
// Must be NULL
nlassert (child == NULL);
result = "";
result.clear();
result.reserve (50);
// Get parent form name

View file

@ -159,7 +159,7 @@ void CFileHeader::read (xmlNodePtr root)
}
// Look for the comment node
Comments = "";
Comments.clear();
xmlNodePtr node = CIXml::getFirstChildNode (root, "COMMENTS");
if (node)
{
@ -181,7 +181,7 @@ void CFileHeader::read (xmlNodePtr root)
}
// Look for the log node
Log = "";
Log.clear();
node = CIXml::getFirstChildNode (root, "LOG");
if (node)
{

View file

@ -185,7 +185,7 @@ void CType::read (xmlNodePtr root)
xmlFree ((void*)value);
}
else
Default = "";
Default.clear();
// Read Min
value = (const char*)xmlGetProp (root, (xmlChar*)"Min");
@ -197,7 +197,7 @@ void CType::read (xmlNodePtr root)
xmlFree ((void*)value);
}
else
Min = "";
Min.clear();
// Read Max
value = (const char*)xmlGetProp (root, (xmlChar*)"Max");
@ -209,7 +209,7 @@ void CType::read (xmlNodePtr root)
xmlFree ((void*)value);
}
else
Max = "";
Max.clear();
// Read Increment
value = (const char*)xmlGetProp (root, (xmlChar*)"Increment");
@ -221,7 +221,7 @@ void CType::read (xmlNodePtr root)
xmlFree ((void*)value);
}
else
Increment = "";
Increment.clear();
// Read the definitions
uint childrenCount = CIXml::countChildren (root, "DEFINITION");
@ -465,7 +465,7 @@ uint getNextToken (const char *startString, string &token, uint &offset)
offset += 9;
return NL_TOKEN_NAME;
}
token = "";
token.clear();
while (startString[offset])
{
if (startString[offset] == '\\')

View file

@ -1768,7 +1768,7 @@ namespace NLGUI
// ***************************************************************************
void CGroupEditBox::clearAllEditBox()
{
_InputString = "";
_InputString.clear();
_CursorPos = 0;
_CursorAtPreviousLineEnd = false;
if (!_ViewText) return;

View file

@ -2089,10 +2089,10 @@ namespace NLGUI
templateName = value[MY_HTML_TEXTAREA_Z_INPUT_TMPL];
// Get the string name
_TextAreaName = "";
_TextAreaName.clear();
_TextAreaRow = 1;
_TextAreaCols = 10;
_TextAreaContent = "";
_TextAreaContent.clear();
_TextAreaMaxLength = 1024;
if (present[MY_HTML_TEXTAREA_NAME] && value[MY_HTML_TEXTAREA_NAME])
_TextAreaName = value[MY_HTML_TEXTAREA_NAME];
@ -2112,7 +2112,7 @@ namespace NLGUI
if(!_TitlePrefix.empty())
_TitleString = _TitlePrefix + " - ";
else
_TitleString = "";
_TitleString.clear();
_Title = true;
}
break;
@ -2144,10 +2144,10 @@ namespace NLGUI
endParagraph();
break;
case HTML_OBJECT:
_ObjectType = "";
_ObjectData = "";
_ObjectMD5Sum = "";
_ObjectAction = "";
_ObjectType.clear();
_ObjectData.clear();
_ObjectMD5Sum.clear();
_ObjectAction.clear();
if (present[HTML_OBJECT_TYPE] && value[HTML_OBJECT_TYPE])
_ObjectType = value[HTML_OBJECT_TYPE];
if (present[HTML_OBJECT_DATA] && value[HTML_OBJECT_DATA])
@ -2369,7 +2369,7 @@ namespace NLGUI
{
endParagraph();
}
_DivName = "";
_DivName.clear();
popIfNotEmpty (_Divs);
popIfNotEmpty (_BlockLevelElement);
break;
@ -2614,7 +2614,7 @@ namespace NLGUI
{
CLuaManager::getInstance().executeLuaScript("\nlocal __ALLREADYDL__=true\n"+_ObjectScript, true);
}
_ObjectScript = "";
_ObjectScript.clear();
}
}
_Object = false;
@ -2632,7 +2632,7 @@ namespace NLGUI
{
// we receive an embeded lua script
_ParsingLua = _TrustedDomain; // Only parse lua if TrustedDomain
_LuaScript = "";
_LuaScript.clear();
}
}
@ -2687,8 +2687,6 @@ namespace NLGUI
_LI = false;
_SelectOption = false;
_GroupListAdaptor = NULL;
_DocumentUrl = "";
_DocumentDomain = "";
_UrlFragment.clear();
_RefreshUrl.clear();
_NextRefreshTime = 0.0;
@ -2741,7 +2739,6 @@ namespace NLGUI
DefaultCheckBoxBitmapOver = "checkbox_over.tga";
DefaultRadioButtonBitmapNormal = "w_radiobutton.png";
DefaultRadioButtonBitmapPushed = "w_radiobutton_pushed.png";
DefaultRadioButtonBitmapOver = "";
DefaultBackgroundBitmapView = "bg";
clearContext();
@ -5825,7 +5822,7 @@ namespace NLGUI
if (it->second == "monospace")
style.FontFamily = "monospace";
else
style.FontFamily = "";
style.FontFamily.clear();
}
else
if (it->first == "font-weight")

View file

@ -363,7 +363,7 @@ namespace NLGUI
uint32 i;
if( fromString( value, i ) )
_TextId = i;
_HardText = "";
_HardText.clear();
onTextChanged();
return;
}

View file

@ -266,7 +266,7 @@ namespace NLGUI
else
if (stricmp((char*)cur->name, "action") == 0)
{
string strId, strAh, strParams, strCond, strTexture="";
string strId, strAh, strParams, strCond, strTexture;
ucstring ucstrName;
if (id) strId = (const char*)id;
@ -1077,7 +1077,7 @@ namespace NLGUI
for (uint32 i = 0; i < pCurGSM->_Lines.size(); ++i)
if (sRest == pCurGSM->_Lines[i].Id)
return pCurGSM->_Lines[i].ViewText;
sRest = "";
sRest.clear();
}
else // no a lot of token left
{

View file

@ -337,7 +337,7 @@ namespace NLGUI
if( fromString( value, i ) )
{
_TextId = i;
_HardText = "";
_HardText.clear();
}
onTextChanged();
return;

View file

@ -765,7 +765,7 @@ namespace NLGUI
rVR.getTextureSizeFromId(id, _XExtend, dummy);
else
// if not found, reset, to avoid errors
_ArboXExtend= "";
_ArboXExtend.clear();
}
// ----------------------------------------------------------------------------

View file

@ -1031,12 +1031,12 @@ namespace NLGUI
if (posid > 0)
idTmp = idTmp.substr (0, posid);
else
idTmp = "";
idTmp.clear();
if (poslid > 0)
lidTmp = lidTmp.substr (0, poslid);
else
lidTmp = "";
lidTmp.clear();
}
return true;
}

View file

@ -665,7 +665,7 @@ namespace NLGUI
if (strchr(ptr, '#') != NULL)
{
string LastProp = ptr.str();
string NewProp ="";
string NewProp;
string RepProp;
while (LastProp.size() > 0)
@ -709,7 +709,7 @@ namespace NLGUI
else
{
NewProp += LastProp;
LastProp = "";
LastProp.clear();
}
}
xmlSetProp(node,props->name, (const xmlChar*)NewProp.c_str());

View file

@ -39,7 +39,7 @@ CLigoConfig::CLigoConfig()
// ***************************************************************************
bool CLigoConfig::readConfigFile (const char *fileName, bool parsePrimitiveComboContent)
bool CLigoConfig::readConfigFile (const std::string &fileName, bool parsePrimitiveComboContent)
{
// The CF
CConfigFile cf;
@ -73,7 +73,7 @@ bool CLigoConfig::readConfigFile (const char *fileName, bool parsePrimitiveCombo
// ***************************************************************************
bool CLigoConfig::readPrimitiveClass (const char *_fileName, bool parsePrimitiveComboContent)
bool CLigoConfig::readPrimitiveClass (const std::string &_fileName, bool parsePrimitiveComboContent)
{
// File exist ?
string filename = _fileName;
@ -785,7 +785,7 @@ std::string CLigoConfig::aliasToString(uint32 fullAlias)
}
uint32 CLigoConfig::aliasFromString(std::string fullAlias)
uint32 CLigoConfig::aliasFromString(const std::string &fullAlias)
{
uint32 staticPart;
uint32 dynPart;

View file

@ -1240,7 +1240,7 @@ const IPrimitive *IPrimitive::getPrimitive (const std::string &absoluteOrRelativ
if (indexStr==string::npos)
{
childName=path;
path="";
path.clear();
}
else
{
@ -1664,7 +1664,7 @@ bool IPrimitive::read (xmlNodePtr xmlNode, const char *filename, uint version, C
if (commentNode)
{
if (!CIXml::getContentString(_UnparsedProperties, commentNode))
_UnparsedProperties = "";
_UnparsedProperties.clear();
}
// Read the expanded flag

View file

@ -183,8 +183,8 @@ bool CPrimitiveClass::read (xmlNodePtr primitiveNode,
// init default parameters
AutoInit = false;
Deletable = true;
FileExtension = "";
FileType = "";
FileExtension.clear();
FileType.clear();
Collision = false;
LinkBrothers = false;
ShowArrow = true;
@ -351,16 +351,16 @@ bool CPrimitiveClass::read (xmlNodePtr primitiveNode,
parameter.WidgetHeight = (uint)temp;
// Read the file extension
parameter.FileExtension = "";
parameter.FileExtension.clear();
CIXml::getPropertyString (parameter.FileExtension, paramNode, "FILE_EXTENSION");
parameter.FileExtension = toLower(parameter.FileExtension);
// Autonaming preference
parameter.Autoname = "";
parameter.Autoname.clear();
CIXml::getPropertyString (parameter.Autoname, paramNode, "AUTONAME");
// Read the file extension
parameter.Folder = "";
parameter.Folder.clear();
CIXml::getPropertyString (parameter.Folder, paramNode, "FOLDER");
parameter.Folder = toLower(parameter.Folder);
@ -650,7 +650,7 @@ void CPrimitiveClass::CParameter::CConstStringValue::getPrimitivesForPrimPath (s
bool CPrimitiveClass::CParameter::translateAutoname (std::string &result, const IPrimitive &primitive, const CPrimitiveClass &primitiveClass) const
{
result = "";
result.clear();
string::size_type strBegin = 0;
string::size_type strEnd = 0;
while (strBegin != Autoname.size())
@ -745,7 +745,7 @@ bool CPrimitiveClass::CParameter::translateAutoname (std::string &result, const
bool CPrimitiveClass::CParameter::getDefaultValue (std::string &result, const IPrimitive &primitive, const CPrimitiveClass &primitiveClass, std::string *fromWhere) const
{
result = "";
result.clear();
if (!Autoname.empty())
{
if (fromWhere)

View file

@ -88,7 +88,7 @@ void CZoneBankElement::convertSize()
}
fromString(sTmp, _SizeX);
++i; sTmp = "";
++i; sTmp.clear();
for (; i < sizeString.size(); ++i)
{
sTmp += sizeString[i];

View file

@ -453,7 +453,7 @@ public:
string shortExc, longExc, subject;
string addr, ext;
ULONG_PTR skipNFirst = 0;
_Reason = "";
_Reason.clear();
if (m_pexp == NULL)
{
@ -491,25 +491,25 @@ public:
case EXCEPTION_STACK_OVERFLOW : shortExc="Stack Overflow"; longExc="Stack overflow. Can occur during errant recursion, or when a function creates a particularly large array on the stack"; break;
case EXCEPTION_INVALID_DISPOSITION : shortExc="Invalid Disposition"; longExc="Whatever number the exception filter returned, it wasn't a value the OS knows about"; break;
case EXCEPTION_GUARD_PAGE : shortExc="Guard Page"; longExc="Memory Allocated as PAGE_GUARD by VirtualAlloc() has been accessed"; break;
case EXCEPTION_INVALID_HANDLE : shortExc="Invalid Handle"; longExc=""; break;
case EXCEPTION_INVALID_HANDLE : shortExc="Invalid Handle"; longExc.clear(); break;
case CONTROL_C_EXIT : shortExc="Control-C"; longExc="Lets the debugger know the user hit Ctrl-C. Seemingly for console apps only"; break;
case STATUS_NO_MEMORY : shortExc="No Memory"; longExc="Called by HeapAlloc() if you specify HEAP_GENERATE_EXCEPTIONS and there is no memory or heap corruption";
ext = ", unable to allocate ";
ext += toString ("%d bytes", m_pexp->ExceptionRecord->ExceptionInformation [0]);
break;
case STATUS_WAIT_0 : shortExc="Wait 0"; longExc=""; break;
case STATUS_ABANDONED_WAIT_0 : shortExc="Abandoned Wait 0"; longExc=""; break;
case STATUS_WAIT_0 : shortExc="Wait 0"; longExc.clear(); break;
case STATUS_ABANDONED_WAIT_0 : shortExc="Abandoned Wait 0"; longExc.clear(); break;
case STATUS_USER_APC : shortExc="User APC"; longExc="A user APC was delivered to the current thread before the specified Timeout interval expired"; break;
case STATUS_TIMEOUT : shortExc="Timeout"; longExc=""; break;
case STATUS_PENDING : shortExc="Pending"; longExc=""; break;
case STATUS_SEGMENT_NOTIFICATION : shortExc="Segment Notification"; longExc=""; break;
case STATUS_FLOAT_MULTIPLE_FAULTS : shortExc="Float Multiple Faults"; longExc=""; break;
case STATUS_FLOAT_MULTIPLE_TRAPS : shortExc="Float Multiple Traps"; longExc=""; break;
case STATUS_TIMEOUT : shortExc="Timeout"; longExc.clear(); break;
case STATUS_PENDING : shortExc="Pending"; longExc.clear(); break;
case STATUS_SEGMENT_NOTIFICATION : shortExc="Segment Notification"; longExc.clear(); break;
case STATUS_FLOAT_MULTIPLE_FAULTS : shortExc="Float Multiple Faults"; longExc.clear(); break;
case STATUS_FLOAT_MULTIPLE_TRAPS : shortExc="Float Multiple Traps"; longExc.clear(); break;
#ifdef NL_COMP_VC6
case STATUS_ILLEGAL_VLM_REFERENCE : shortExc="Illegal VLM Reference"; longExc=""; break;
case STATUS_ILLEGAL_VLM_REFERENCE : shortExc="Illegal VLM Reference"; longExc.clear(); break;
#endif
case 0xE06D7363 : shortExc="Microsoft C++ Exception"; longExc="Microsoft C++ Exception"; break; // cpp exception
case 0xACE0ACE : shortExc=""; longExc="";
case 0xACE0ACE : shortExc.clear(); longExc.clear();
if (m_pexp->ExceptionRecord->NumberParameters == 1)
skipNFirst = m_pexp->ExceptionRecord->ExceptionInformation [0];
break; // just want the stack
@ -824,7 +824,7 @@ public:
// replace param with the value of the stack for this param
string parse = str;
str = "";
str.clear();
uint pos2 = 0;
sint stop = 0;
@ -943,7 +943,7 @@ public:
str += tmp;
}
str += parse[i];
type = "";
type.clear();
}
else
{
@ -1442,7 +1442,7 @@ std::string formatErrorMessage(int errorCode)
NULL
);
// empty buffer, an error occured
// empty buffer, an error occurred
if (len == 0) return toString("FormatMessage returned error %d", getLastError());
// convert wchar_t* to std::string

View file

@ -255,7 +255,7 @@ void CLibrary::freeLibrary()
_PureNelLibrary = NULL;
_LibHandle = NULL;
_Ownership = false;
_LibFileName = "";
_LibFileName.clear();
}
}

View file

@ -587,10 +587,10 @@ void CEntityIdTranslator::getEntityIdInfo (const CEntityId &eid, ucstring &entit
if (it == RegisteredEntities.end ())
{
nlwarning ("EIT: %s is not registered in CEntityIdTranslator", reid.toString().c_str());
entityName = "";
entityName.clear();
entitySlot = -1;
uid = std::numeric_limits<uint32>::max();
userName = "";
userName.clear();
online = false;
}
else

View file

@ -550,7 +550,6 @@ uint CIFile::getDbgStreamSize() const
COFile::COFile() : IStream(false)
{
_F=NULL;
_FileName = "";
}
// ======================================================================================================

View file

@ -67,7 +67,6 @@ CIXml::CIXml () : IStream (true /* Input mode */)
_CurrentNode = NULL;
_PushBegin = false;
_AttribPresent = false;
_ErrorString = "";
_TryBinaryMode = false;
_BinaryStream = NULL;
}
@ -82,7 +81,6 @@ CIXml::CIXml (bool tryBinaryMode) : IStream (true /* Input mode */)
_CurrentNode = NULL;
_PushBegin = false;
_AttribPresent = false;
_ErrorString = "";
_TryBinaryMode = tryBinaryMode;
_BinaryStream = NULL;
}
@ -116,7 +114,7 @@ void CIXml::release ()
_CurrentNode = NULL;
_PushBegin = false;
_AttribPresent = false;
_ErrorString = "";
_ErrorString.clear();
resetPtrTable();
}
@ -195,7 +193,7 @@ bool CIXml::init (IStream &stream)
}
// Set error handler
_ErrorString = "";
_ErrorString.clear();
xmlSetGenericErrorFunc (this, xmlGenericErrorFuncRead);
// Ask to get debug info
@ -319,7 +317,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator )
// If no more node, empty string
if (_CurrentNode == NULL)
{
value = "";
value.clear();
_ContentStringIndex = 0;
_ContentString.erase ();
return;

View file

@ -377,11 +377,11 @@ void CLog::displayRawString (const char *str)
{
localargs.Date = 0;
localargs.LogType = CLog::LOG_NO;
localargs.ProcessName = "";
localargs.ProcessName.clear();
localargs.ThreadId = 0;
localargs.FileName = NULL;
localargs.Line = -1;
localargs.CallstackAndLog = "";
localargs.CallstackAndLog.clear();
TempString = str;
}
@ -397,11 +397,11 @@ void CLog::displayRawString (const char *str)
{
localargs.Date = 0;
localargs.LogType = CLog::LOG_NO;
localargs.ProcessName = "";
localargs.ProcessName.clear();
localargs.ThreadId = 0;
localargs.FileName = NULL;
localargs.Line = -1;
localargs.CallstackAndLog = "";
localargs.CallstackAndLog.clear();
disp = str;
args = &localargs;

View file

@ -85,7 +85,7 @@ static string getFuncInfo (DWORD_TYPE funcAddr, DWORD_TYPE stackAddr)
// replace param with the value of the stack for this param
string parse = str;
str = "";
str.clear();
uint pos = 0;
sint stop = 0;

View file

@ -134,7 +134,7 @@ COXml::COXml () : IStream (false /* Output mode */)
_CurrentNode = NULL;
// Content string
_ContentString = "";
_ContentString.clear();
// Push begin
_PushBegin = false;
@ -160,7 +160,7 @@ bool COXml::init (IStream *stream, const char *version)
if (!stream->isReading())
{
// Set error handler
_ErrorString = "";
_ErrorString.clear();
xmlSetGenericErrorFunc (this, xmlGenericErrorFuncWrite);
// Set XML mode
@ -179,7 +179,7 @@ bool COXml::init (IStream *stream, const char *version)
_CurrentNode = NULL;
// Content string
_ContentString = "";
_ContentString.clear();
// Push begin
_PushBegin = false;

View file

@ -33,8 +33,7 @@ CStringMapper CStringMapper::_GlobalMapper;
// ****************************************************************************
CStringMapper::CStringMapper()
{
_EmptyId = new string;
*_EmptyId = "";
_EmptyId = new string();
}
// ****************************************************************************

View file

@ -1525,7 +1525,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(nel, string, AvailableHDSpace, "Hard drive space
if (get)
{
*pointer = (CSystemInfo::availableHDSpace(location));
location = "";
location.clear();
}
else
{

View file

@ -37,7 +37,7 @@ CTaskManager::CTaskManager() : _RunningTask (""), _TaskQueue (""), _DoneTaskQueu
_IsTaskRunning = false;
_ThreadRunning = true;
CSynchronized<string>::CAccessor currentTask(&_RunningTask);
currentTask.value () = "";
currentTask.value ().clear();
_Thread = IThread::create(this);
_Thread->start();
_ChangePriorityCallback = NULL;
@ -111,7 +111,7 @@ void CTaskManager::run(void)
CSynchronized<string>::CAccessor currentTask(&_RunningTask);
CSynchronized<deque<string> >::CAccessor doneTask(&_DoneTaskQueue);
doneTask.value().push_front (currentTask.value ());
currentTask.value () = "";
currentTask.value ().clear();
if (doneTask.value().size () > NLMISC_DONE_TASK_SIZE)
doneTask.value().resize (NLMISC_DONE_TASK_SIZE);
}

View file

@ -156,7 +156,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
string str;
while (*pos2 != '\0')
{
str = "";
str.clear();
// get the string
while (*pos2 != '\0' && *pos2 != '\n')

View file

@ -381,7 +381,7 @@ void serviceGetView (uint32 rid, const string &rawvarpath, TAdminViewResult &ans
if (CCommandRegistry::getInstance().isNamedCommandHandler(varpath.Destination[0].first))
{
varpath.Destination[0].first += "."+varpath.Destination[0].second;
varpath.Destination[0].second = "";
varpath.Destination[0].second.clear();
}
if (varpath.isFinal())

View file

@ -84,7 +84,7 @@ CBufSock::~CBufSock()
delete Sock; // the socket disconnects automatically if needed
// destroy the structur to be sure that other people will not access to this anymore
AuthorizedCallback = "";
AuthorizedCallback.clear();
Sock = NULL;
_KnowConnected = false;
_LastFlushTime = 0;
@ -131,7 +131,7 @@ string stringFromVectorPart( const vector<uint8>& v, uint32 pos, uint32 len )
* (see CNonBlockingBufSock), if all the data could not be sent immediately,
* the returned nbBytesRemaining value is non-zero.
* \param nbBytesRemaining If the pointer is not NULL, the method sets the number of bytes still pending after the flush attempt.
* \returns False if an error has occured (e.g. the remote host is disconnected).
* \returns False if an error has occurred (e.g. the remote host is disconnected).
* To retrieve the reason of the error, call CSock::getLastError() and/or CSock::errorString()
*
* Note: this method works with both blocking and non-blocking sockets
@ -270,7 +270,7 @@ void CBufSock::setTimeFlushTrigger( sint32 ms )
/*
* Update the network sending (call this method evenly). Returns false if an error occured.
* Update the network sending (call this method evenly). Returns false if an error occurred.
*/
bool CBufSock::update()
{

View file

@ -127,7 +127,7 @@ string CLoginClient::authenticate(const string &loginServiceAddr, const ucstring
string CLoginClient::authenticateBegin(const string &loginServiceAddr, const ucstring &login, const string &cpassword, const string &application)
{
VerifyLoginPasswordReason = "";
VerifyLoginPasswordReason.clear();
VerifyLoginPassword = false;
// S01: connect to the LS
@ -355,7 +355,7 @@ string CLoginClient::selectShardBegin(sint32 shardId)
{
nlassert(_LSCallbackClient != 0 && _LSCallbackClient->connected());
ShardChooseShardReason = "";
ShardChooseShardReason.clear();
ShardChooseShard = false;
if (ShardList.empty())

View file

@ -157,7 +157,7 @@ void cbWSChooseShard (CMessage &msgin, const std::string &/* serviceName */, TSe
// add it to the awaiting client
nlinfo ("LS: New cookie %s (name '%s' priv '%s' extended '%s' instance %u slot %u) inserted in the pending user list (awaiting new client)", cookie.toString().c_str(), userName.c_str(), userPriv.c_str(), userExtended.c_str(), instanceId, charSlot);
PendingUsers.push_back (CPendingUser (cookie, userName, userPriv, userExtended, instanceId, charSlot));
reason = "";
reason.clear();
// callback if needed
if (NewCookieCallback != NULL)
@ -233,7 +233,7 @@ void cbShardValidation (CMessage &msgin, TSockId from, CCallbackNetBase &netbase
// if the cookie is not valid and we accept them, clear the error
if(AcceptInvalidCookie && !reason.empty())
{
reason = "";
reason.clear();
cookie.set (rand(), rand(), rand());
}
@ -425,7 +425,8 @@ void CLoginServer::addNewCookieCallback(TNewCookieCallback newCookieCb)
string CLoginServer::isValidCookie (const CLoginCookie &lc, string &userName, string &userPriv, string &userExtended, uint32 &instanceId, uint32 &charSlot)
{
userName = userPriv = "";
userName.clear();
userPriv.clear();
if (!AcceptInvalidCookie && !lc.isValid())
return "The cookie is invalid";

View file

@ -159,7 +159,7 @@ void CMessageRecorder::recordNext( sint64 updatecounter, TNetworkEvent event, TS
void CMessageRecorder::stopRecord()
{
_File.close();
_Filename = "";
_Filename.clear();
}
@ -395,7 +395,7 @@ TNetworkEvent CMessageRecorder::replayConnectionAttempt( const CInetAddress& add
void CMessageRecorder::stopReplay()
{
_File.close();
_Filename = "";
_Filename.clear();
}

View file

@ -1453,7 +1453,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName,
}
if (dispName.empty())
str = "";
str.clear();
else
str = dispName + ": ";

View file

@ -149,7 +149,7 @@ void CSock::releaseNetwork()
}
/* Returns the code of the last error that has occured.
/* Returns the code of the last error that has occurred.
* Note: This code is platform-dependant. On Unix, it is errno; on Windows it is the Winsock error code.
* See also errorString()
*/

View file

@ -167,7 +167,7 @@ void CVarPath::decode ()
if (val == "=")
{
srv += val + RawVarPath.substr (TokenPos);
var = "";
var.clear();
}
else
var = RawVarPath.substr (TokenPos);

View file

@ -631,7 +631,7 @@ bool computeRetriever(CCollisionMeshBuild &cmb, CLocalRetriever &lr, CVector &tr
{
nlwarning("Edge issues reported !!");
uint i;
error = "";
error.clear();
for (i=0; i<errors.size(); ++i)
error += errors[i]+"\n";
return false;

View file

@ -43,7 +43,7 @@ Doc:
// Collisionnable primitives
Each primitive must be moved first with the move() method.
Their moves are evaluate all at once. All the collisions found are time sorted in a time orderin table (_TimeOT).
While the table is not empty, the first collision occured in time is solved and
While the table is not empty, the first collision occurred in time is solved and
If a collision is found, reaction() is called.

View file

@ -1770,7 +1770,7 @@ void CAudioMixerUser::update()
str += tmp;
}
nldebug((string("Status1: ")+str).c_str());
str = "";
str.clear();
for (i=_NbTracks/2; i<_NbTracks; ++i)
{
sprintf(tmp, "[%2u]%8p ", i, _Tracks[i]->getSource());

View file

@ -160,7 +160,7 @@ void CContextSound::init()
uint contextArgIndex[SoundContextNbArgs];
bool useRandom = false;
bool parseArg = false;
_BaseName = "";
_BaseName.clear();
//nldebug("Init the context sound %s", _PatternName.c_str());
@ -190,7 +190,7 @@ void CContextSound::init()
nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/));
fromString(index, contextArgIndex[nbJoker++]);
parseArg = false;
index = "";
index.clear();
}
}
else if (*first == 'r')

View file

@ -563,15 +563,15 @@ void CSoundDriverDSound::initDevice(const std::string &device, ISoundDriver::TSo
switch (hr)
{
case DSERR_BUFFERLOST:
throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_BUFFERLOST");
throw ESoundDriver("Failed to lock the DirectSound primary buffer: DSERR_BUFFERLOST");
case DSERR_INVALIDCALL:
throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_INVALIDCALL");
throw ESoundDriver("Failed to lock the DirectSound primary buffer: DSERR_INVALIDCALL");
case DSERR_INVALIDPARAM:
throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_INVALIDPARAM");
throw ESoundDriver("Failed to lock the DirectSound primary buffer: DSERR_INVALIDPARAM");
case DSERR_PRIOLEVELNEEDED:
throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_PRIOLEVELNEEDED");
throw ESoundDriver("Failed to lock the DirectSound primary buffer: DSERR_PRIOLEVELNEEDED");
default:
throw ESoundDriver("Failed to lock the DirectSound primary buffer : unkown error");
throw ESoundDriver("Failed to lock the DirectSound primary buffer: unknown error");
}
}

View file

@ -92,7 +92,7 @@ CSound *CSound::createSound(const std::string &filename, NLGEORGES::UFormElm& fo
}
else
{
nlassertex(false, ("SoundType unsuported : %s", dfnName.c_str()));
nlassertex(false, ("SoundType unsupported: %s", dfnName.c_str()));
}
}

View file

@ -271,7 +271,7 @@ int main (int argc, char **argv)
bool _256=(type==CTileBank::_256x256);
// Diffuse bitmap filled ?
if (pTile->getRelativeFileName (CTile::diffuse)!="")
if (!pTile->getRelativeFileName (CTile::diffuse).empty())
{
// File exist ?
string tileFilename = bank.getAbsPath()+CPath::standardizePath(pTile->getRelativeFileName (CTile::diffuse), false);
@ -302,7 +302,7 @@ int main (int argc, char **argv)
}
// Additive bitmap filled ?
if (pTile->getRelativeFileName (CTile::additive)!="")
if (!pTile->getRelativeFileName (CTile::additive).empty())
{
// File exist ?
string tileFilename = bank.getAbsPath()+CPath::standardizePath(pTile->getRelativeFileName (CTile::additive), false);
@ -333,7 +333,7 @@ int main (int argc, char **argv)
}
// Alpha bitmap filled ?
if (pTile->getRelativeFileName (CTile::alpha)!="")
if (!pTile->getRelativeFileName (CTile::alpha).empty())
{
// File exist ?
string tileFilename = bank.getAbsPath()+CPath::standardizePath(pTile->getRelativeFileName (CTile::alpha), false);

View file

@ -175,7 +175,6 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector<SDispCS> &D
if (ITemp != NULL)
{
SDispCS dcsTemp;
dcsTemp.Name = "";
for (sint32 i = 0; i < (1+nNbPlus); ++i)
dcsTemp.Name += " ";
dcsTemp.Name += nameIG;

View file

@ -227,7 +227,7 @@ int main(int argc, char* argv[])
CGlobalRetriever *globalRetriever= NULL;
uint32 grFileDate= 0;
uint32 rbankFileDate= 0;
if( grFile!="" && rbankFile!="" )
if( !grFile.empty() && !rbankFile.empty())
{
CIFile fin;
// serial the retrieverBank. Exception if not found.

View file

@ -20,6 +20,8 @@ NL_DEFAULT_PROPS(ligoscape_utility "MAX Plugin: Ligoscape Utility")
NL_ADD_RUNTIME_FLAGS(ligoscape_utility)
NL_ADD_LIB_SUFFIX(ligoscape_utility)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
INSTALL(TARGETS ligoscape_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
INSTALL(FILES ligoscript.txt DESTINATION maxplugin/docs)
INSTALL(DIRECTORY scripts/

View file

@ -46,7 +46,7 @@ NeLLigoGetErrorZoneTemplate code_array vertex_id_array message_array error_index
Get the export errors after a call to NeLLigoExportZoneTemplate.
code_array is an integer array with the error code. (2 for OpenedEdge, 4 for InvalidVertexList, 5 for NotInserted)
vertex_id_array is an integer array with the id of the vertex where an error occured.
vertex_id_array is an integer array with the id of the vertex where an error occurred.
message_array is a string array with the error message for the vertices
error_index is the id of the error buffer (1 ~ 9)

View file

@ -124,17 +124,17 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di
if (hModule)
{
// Get the path
char sModulePath[256];
TCHAR sModulePath[256];
int res=GetModuleFileName(hModule, sModulePath, 256);
// Success ?
if (res)
{
// Path
char sDrive[256];
char sDir[256];
_splitpath (sModulePath, sDrive, sDir, NULL, NULL);
_makepath (sModulePath, sDrive, sDir, "ligoscape", ".cfg");
TCHAR sDrive[256];
TCHAR sDir[256];
_tsplitpath (sModulePath, sDrive, sDir, NULL, NULL);
_tmakepath (sModulePath, sDrive, sDir, _T("ligoscape"), _T(".cfg"));
try
{
@ -144,7 +144,7 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di
// ok
return true;
}
catch (Exception& e)
catch (const Exception& e)
{
// Print an error message
char msg[512];
@ -160,22 +160,22 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di
// ***************************************************************************
void CMaxToLigo::errorMessage (const char *msg, const char *title, Interface& it, bool dialog)
void CMaxToLigo::errorMessage(const std::string &msg, const std::string &title, Interface& it, bool dialog)
{
// Text or dialog ?
if (dialog)
{
// Dialog message
MessageBox (it.GetMAXHWnd(), msg, title, MB_OK|MB_ICONEXCLAMATION);
MessageBox (it.GetMAXHWnd(), utf8ToTStr(msg), utf8ToTStr(title), MB_OK|MB_ICONEXCLAMATION);
}
else
{
// Text message
mprintf ((string(msg) + "\n").c_str());
mprintf (utf8ToTStr(msg + "\n"));
}
// Output in log
nlwarning ("LIGO ERROR : %s", msg);
nlwarning ("LIGO ERROR : %s", msg.c_str());
}
// ***************************************************************************

View file

@ -70,7 +70,7 @@ public:
* \param it if a max interface
* \param dialog is true to see the message in a dilog, false to see it in the script window.
*/
static void errorMessage (const char *msg, const char *title, Interface& it, bool dialog);
static void errorMessage (const std::string &msg, const std::string &title, Interface& it, bool dialog);
};
}

View file

@ -137,7 +137,7 @@ Value* export_material_cf (Value** arg_list, int count)
check_arg_count(export_material, 4, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoExportMaterial [Object] [Filename] [CheckOnly] [Error in dialog]";
TCHAR *message = _T("NeLLigoExportMaterial [Object] [Filename] [CheckOnly] [Error in dialog]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], String, message);
type_check(arg_list[2], Boolean, message);
@ -306,7 +306,7 @@ Value* export_transition_cf (Value** arg_list, int count)
check_arg_count(export_transition, 6, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoExportTransition [Object array (count=9)] [Output filename] [First material filename] [Second material filename] [CheckOnly] [Error in dialog]";
TCHAR *message = _T("NeLLigoExportTransition [Object array (count=9)] [Output filename] [First material filename] [Second material filename] [CheckOnly] [Error in dialog]");
type_check(arg_list[0], Array, message);
type_check(arg_list[1], String, message);
type_check(arg_list[2], String, message);
@ -326,8 +326,8 @@ Value* export_transition_cf (Value** arg_list, int count)
// The second arg
string matFilename[2];
matFilename[0] = arg_list[2]->to_string();
matFilename[1] = arg_list[3]->to_string();
matFilename[0] = tStrToUtf8(arg_list[2]->to_string());
matFilename[1] = tStrToUtf8(arg_list[3]->to_string());
// The third arg
bool checkOnly = (arg_list[4]->to_bool() != FALSE);
@ -427,7 +427,7 @@ Value* export_transition_cf (Value** arg_list, int count)
// Serial
materials[mat].serial (inputXml);
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[2048];
@ -541,7 +541,7 @@ Value* export_transition_cf (Value** arg_list, int count)
ok = false;
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];
@ -595,7 +595,7 @@ Value* get_error_zone_template_cf (Value** arg_list, int count)
check_arg_count(get_error_zone_template, 4, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoGetErrorZoneTemplate [Array error codes] [Array vertex id] [Array messages] [Error index]";
TCHAR *message = _T("NeLLigoGetErrorZoneTemplate [Array error codes] [Array vertex id] [Array messages] [Error index]");
type_check(arg_list[0], Array, message);
type_check(arg_list[1], Array, message);
type_check(arg_list[2], Array, message);
@ -637,7 +637,7 @@ Value* get_error_zone_template_cf (Value** arg_list, int count)
vertexId->append (Integer::intern (id+1));
// Append messages
messages->append (new String("[LIGO DEBUG] Opened edge"));
messages->append (new String(_T("[LIGO DEBUG] Opened edge")));
}
// Return the main error message
@ -687,7 +687,7 @@ Value* check_zone_with_material_cf (Value** arg_list, int count)
check_arg_count(check_zone_with_template, 3, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoCheckZoneWithMaterial [Object] [Material filename] [Error in dialog]";
TCHAR *message = _T("NeLLigoCheckZoneWithMaterial [Object] [Material filename] [Error in dialog]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], String, message);
type_check(arg_list[2], Boolean, message);
@ -700,7 +700,7 @@ Value* check_zone_with_material_cf (Value** arg_list, int count)
nlassert (node);
// The second arg
string fileName = arg_list[1]->to_string();
string fileName = tStrToUtf8(arg_list[1]->to_string());
// The fourth arg
bool errorInDialog = (arg_list[2]->to_bool() != FALSE);
@ -778,7 +778,7 @@ Value* check_zone_with_material_cf (Value** arg_list, int count)
CMaxToLigo::errorMessage (tmp, "NeL Ligo check zone", *MAXScript_interface, errorInDialog);
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];
@ -820,7 +820,7 @@ Value* check_zone_with_transition_cf (Value** arg_list, int count)
check_arg_count(check_zone_with_template, 4, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoCheckZoneWithTransition [Object] [Transition filename] [Transition number: 0~8] [Error in dialog]";
TCHAR *message = _T("NeLLigoCheckZoneWithTransition [Object] [Transition filename] [Transition number: 0~8] [Error in dialog]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], String, message);
type_check(arg_list[2], Integer, message);
@ -834,7 +834,7 @@ Value* check_zone_with_transition_cf (Value** arg_list, int count)
nlassert (node);
// The second arg
string fileName = arg_list[1]->to_string();
string fileName = tStrToUtf8(arg_list[1]->to_string());
// The second arg
int transitionNumber = arg_list[2]->to_int();
@ -901,7 +901,7 @@ Value* check_zone_with_transition_cf (Value** arg_list, int count)
CMaxToLigo::errorMessage (tmp, "NeL Ligo check zone", *MAXScript_interface, errorInDialog);
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];
@ -987,7 +987,7 @@ Value* export_zone_cf (Value** arg_list, int count)
check_arg_count(check_zone_with_template, 5, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoExportZone [Object] [Ligozone filename] [Category Array] [Error in dialog] [Snapshot]";
TCHAR *message = _T("NeLLigoExportZone [Object] [Ligozone filename] [Category Array] [Error in dialog] [Snapshot]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], String, message);
type_check(arg_list[2], Array, message);
@ -1002,7 +1002,7 @@ Value* export_zone_cf (Value** arg_list, int count)
nlassert (node);
// The second arg
string fileName = arg_list[1]->to_string();
string fileName = tStrToUtf8(arg_list[1]->to_string());
// The thrid arg
Array *array = (Array*)arg_list[2];
@ -1047,8 +1047,8 @@ Value* export_zone_cf (Value** arg_list, int count)
type_check (cell->get(2), String, message);
// Get the strings
categories[i].first = cell->get(1)->to_string();
categories[i].second = cell->get(2)->to_string();
categories[i].first = tStrToUtf8(cell->get(1)->to_string());
categories[i].second = tStrToUtf8(cell->get(2)->to_string());
}
// Get a Object pointer
@ -1313,7 +1313,7 @@ Value* export_zone_cf (Value** arg_list, int count)
CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog);
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];
@ -1324,7 +1324,7 @@ Value* export_zone_cf (Value** arg_list, int count)
}
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];
@ -1362,14 +1362,14 @@ Value* get_error_string_cf (Value** arg_list, int count)
check_arg_count(get_error_string, 1, count);
// Checks arg
char *message = "NeLLigoGetErrorString [error code]";
TCHAR *message = _T("NeLLigoGetErrorString [error code]");
type_check(arg_list[0], Integer, message);
// The first arg
int errorCode = arg_list[0]->to_int()-1;
// Error code
return new String ((char*)CLigoError::getStringError ((CLigoError::TError)errorCode));
return new String (utf8ToTStr(CLigoError::getStringError ((CLigoError::TError)errorCode)));
}
// ***************************************************************************
@ -1380,14 +1380,14 @@ Value* set_directory_cf (Value** arg_list, int count)
check_arg_count(set_directory, 1, count);
// Checks arg
char *message = "NeLLigoDirectory [path]";
TCHAR *message = _T("NeLLigoDirectory [path]");
type_check(arg_list[0], String, message);
// The first arg
const char *dir = arg_list[0]->to_string();
const std::string dir = tStrToUtf8(arg_list[0]->to_string());
// Set the directory
return (chdir (dir)==0)?&true_value:&false_value;
return (chdir (dir.c_str())==0)?&true_value:&false_value;
}
// ***************************************************************************
@ -1398,7 +1398,7 @@ Value* get_zone_mask_cf (Value** arg_list, int count)
check_arg_count(check_zone_with_template, 5, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoGetZoneMask [Object] [Mask Array] [Width Array] [Height Array] [Error in dialog]";
TCHAR *message = _T("NeLLigoGetZoneMask [Object] [Mask Array] [Width Array] [Height Array] [Error in dialog]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], Array, message);
type_check(arg_list[2], Array, message);
@ -1558,7 +1558,7 @@ Value* get_zone_size_cf (Value** arg_list, int count)
check_arg_count(check_zone_with_template, 6, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoGetZoneMask [Object] [minx Array] [maxy Array] [miny Array] [maxy Array] [Error in dialog]";
TCHAR *message = _T("NeLLigoGetZoneMask [Object] [minx Array] [maxy Array] [miny Array] [maxy Array] [Error in dialog]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], Array, message);
type_check(arg_list[2], Array, message);
@ -1835,7 +1835,7 @@ bool MakeSnapShot (NLMISC::CBitmap &snapshot, const NL3D::CTileBank &tileBank, c
CMaxToLigo::errorMessage ("Can't initialise opengl offscreen renderer", "NeL Ligo check zone", *MAXScript_interface, errorInDialog);
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error
char tmp[512];
@ -1859,7 +1859,7 @@ Value* make_snapshot_cf (Value** arg_list, int count)
check_arg_count(NeLLigoMakeSnapShot, 7, count);
// Check to see if the arguments match up to what we expect
char *message = "NeLLigoMakeSnapShot [Object] [Snapshot filename] [xMin] [xMax] [yMin] [yMax] [Error in dialog]";
TCHAR *message = _T("NeLLigoMakeSnapShot [Object] [Snapshot filename] [xMin] [xMax] [yMin] [yMax] [Error in dialog]");
type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], String, message);
type_check(arg_list[2], Integer, message);
@ -1876,7 +1876,7 @@ Value* make_snapshot_cf (Value** arg_list, int count)
nlassert (node);
// The second arg
string fileName = arg_list[1]->to_string();
string fileName = tStrToUtf8(arg_list[1]->to_string());
// The thrid arg
int xMin = arg_list[2]->to_int();
@ -2042,7 +2042,7 @@ Value* make_snapshot_cf (Value** arg_list, int count)
CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog);
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];
@ -2068,7 +2068,7 @@ Value* make_snapshot_cf (Value** arg_list, int count)
}
}
}
catch (Exception &e)
catch (const Exception &e)
{
// Error message
char tmp[512];

View file

@ -81,12 +81,12 @@ void CAnimationSetDlg::OnAddAnimation ()
if (instance != 0xffffffff)
{
// Create a dialog
static char BASED_CODE szFilter[] =
"NeL Animation Files (*.anim)\0*.anim\0"
"All Files (*.*)\0*.*\0\0";
static TCHAR BASED_CODE szFilter[] =
_T("NeL Animation Files (*.anim)\0*.anim\0")
_T("All Files (*.*)\0*.*\0\0");
// Filename buffer
char buffer[65535];
TCHAR buffer[65535];
buffer[0]=0;
OPENFILENAME openFile;
@ -98,7 +98,7 @@ void CAnimationSetDlg::OnAddAnimation ()
openFile.lpstrFile = buffer;
openFile.nMaxFile = 65535;
openFile.Flags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT|OFN_ENABLESIZING|OFN_EXPLORER;
openFile.lpstrDefExt = "*.anim";
openFile.lpstrDefExt = _T("*.anim");
if (GetOpenFileName(&openFile))
@ -107,7 +107,7 @@ void CAnimationSetDlg::OnAddAnimation ()
try
{
// Filename pointer
char *c=buffer;
TCHAR *c=buffer;
// Read the path
CString path = buffer;
@ -117,7 +117,7 @@ void CAnimationSetDlg::OnAddAnimation ()
c[path.GetLength()+1]=0;
// Path is empty
path = "";
path.Empty();
}
else
{
@ -132,8 +132,8 @@ void CAnimationSetDlg::OnAddAnimation ()
while (*c)
{
// File name
char filename[256];
char *ptr=filename;
TCHAR filename[256];
TCHAR *ptr=filename;
// Read a file name
while (*c)
@ -147,7 +147,7 @@ void CAnimationSetDlg::OnAddAnimation ()
CString name = path + filename;
// Load the animation
_ObjView->loadAnimation (name, instance);
_ObjView->loadAnimation (tStrToUtf8(name), instance);
// Touch the channel mixer
_ObjView->reinitChannels ();
@ -156,9 +156,9 @@ void CAnimationSetDlg::OnAddAnimation ()
refresh (TRUE);
}
}
catch (Exception& e)
catch (const Exception& e)
{
MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION);
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
}
}
}
@ -173,8 +173,8 @@ void CAnimationSetDlg::OnAddSkelWt()
if (instance != CB_ERR)
{
// TODO: Add your control notification handler code here
static char BASED_CODE szFilter[] = "NeL Skeleton Weight Template Files (*.swt)|*.swt|All Files (*.*)|*.*||";
CFileDialog fileDlg( TRUE, ".swt", "*.swt", OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter);
static TCHAR BASED_CODE szFilter[] = _T("NeL Skeleton Weight Template Files (*.swt)|*.swt|All Files (*.*)|*.*||");
CFileDialog fileDlg( TRUE, _T(".swt"), _T("*.swt"), OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter);
if (fileDlg.DoModal()==IDOK)
{
// Open the file
@ -188,7 +188,7 @@ void CAnimationSetDlg::OnAddSkelWt()
CString filename=fileDlg.GetNextPathName(pos);
// Load the animation
_ObjView->loadSWT (filename, instance);
_ObjView->loadSWT (tStrToUtf8(filename), instance);
// Touch the channel mixer
_ObjView->reinitChannels ();
@ -197,9 +197,9 @@ void CAnimationSetDlg::OnAddSkelWt()
refresh (TRUE);
}
}
catch (Exception& e)
catch (const Exception& e)
{
MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION);
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
}
}
}
@ -233,9 +233,8 @@ void CAnimationSetDlg::refresh (BOOL update)
uint i;
for (i=0; i<_ObjView->getNumInstance (); i++)
{
char name[512];
_splitpath (_ObjView->getInstance (i)->Saved.ShapeFilename.c_str(), NULL, NULL, name, NULL);
EditedObject.InsertString (-1, name);
std::string name = NLMISC::CFile::getFilenameWithoutExtension(_ObjView->getInstance(i)->Saved.ShapeFilename);
EditedObject.InsertString (-1, utf8ToTStr(name));
}
// Get edited object
@ -270,7 +269,7 @@ void CAnimationSetDlg::refresh (BOOL update)
CAnimation *anim = object->AnimationSet.getAnimation (object->AnimationSet.getAnimationIdByName (name));
// Insert an intem
HTREEITEM item=Tree.InsertItem (name);
HTREEITEM item=Tree.InsertItem(utf8ToTStr(name));
Tree.SetItemData (item, i);
nlassert (item!=NULL);
@ -281,7 +280,7 @@ void CAnimationSetDlg::refresh (BOOL update)
while (ite!=setString.end())
{
// Add this string
HTREEITEM newItem = Tree.InsertItem (ite->c_str(), item);
HTREEITEM newItem = Tree.InsertItem (utf8ToTStr(*ite), item);
Tree.SetItemData (newItem, 0xffffffff);
// Get the track
@ -296,20 +295,17 @@ void CAnimationSetDlg::refresh (BOOL update)
keyTrack->getKeysInRange (track->getBeginTime ()-1, track->getEndTime ()+1, keys);
// Print track info
char name[512];
_snprintf (name, 512, "%s (%f - %f) %d keys", typeid(*track).name(), track->getBeginTime (), track->getEndTime (), keys.size());
HTREEITEM keyItem = Tree.InsertItem (name, newItem);
Tree.SetItemData (keyItem, 0xffffffff);
name = toString("%s (%f - %f) %u keys", typeid(*track).name(), track->getBeginTime(), track->getEndTime(), (uint32)keys.size());
}
else
{
// Print track info
char name[512];
_snprintf (name, 512, "%s (%f - %f)", typeid(*track).name(), track->getBeginTime (), track->getEndTime ());
HTREEITEM keyItem = Tree.InsertItem (name, newItem);
Tree.SetItemData (keyItem, 0xffffffff);
name = toString("%s (%f - %f)", typeid(*track).name(), track->getBeginTime(), track->getEndTime());
}
HTREEITEM keyItem = Tree.InsertItem(utf8ToTStr(name), newItem);
Tree.SetItemData(keyItem, 0xffffffff);
ite++;
}
}
@ -325,7 +321,7 @@ void CAnimationSetDlg::refresh (BOOL update)
CSkeletonWeight *swt = object->AnimationSet.getSkeletonWeight (object->AnimationSet.getSkeletonWeightIdByName (name));
// Insert an intem
HTREEITEM item=SkelTree.InsertItem (name);
HTREEITEM item=SkelTree.InsertItem(utf8ToTStr(name));
nlassert (item!=NULL);
// Get number of node in this skeleton weight
@ -334,11 +330,10 @@ void CAnimationSetDlg::refresh (BOOL update)
// Add the nodein the tree
for (uint n=0; n<numNode; n++)
{
char percent[512];
sprintf (percent, "%s (%f%%)", swt->getNodeName (n).c_str(), swt->getNodeWeight(n)*100);
std::string percent = toString("%s (%f%%)", swt->getNodeName(n).c_str(), swt->getNodeWeight(n)*100);
// Add this string
SkelTree.InsertItem (percent, item);
SkelTree.InsertItem (utf8ToTStr(percent), item);
}
}
@ -346,7 +341,7 @@ void CAnimationSetDlg::refresh (BOOL update)
for (i=0; i<object->Saved.PlayList.size(); i++)
{
// Insert an intem
int item=PlayList.InsertString (-1, object->Saved.PlayList[i].c_str());
int item=PlayList.InsertString (-1, utf8ToTStr(object->Saved.PlayList[i]));
nlassert (item!=LB_ERR);
}
}
@ -372,9 +367,9 @@ void CAnimationSetDlg::refresh (BOOL update)
for (i=0; i<object->Saved.PlayList.size(); i++)
{
// Insert an intem
char text[512];
TCHAR text[512];
PlayList.GetText( i, text);
object->Saved.PlayList[i] = text;
object->Saved.PlayList[i] = tStrToUtf8(text);
}
CDialog::UpdateData (update);

View file

@ -355,7 +355,7 @@ void CAttribDlg::init(HBITMAP bitmap, sint x, sint y, CWnd *pParent)
for (uint k = 0; k < getNumScheme(); ++k)
{
m_Scheme.InsertString(k, getSchemeName(k).c_str());
m_Scheme.InsertString(k, utf8ToTStr(getSchemeName(k)));
}
@ -683,7 +683,7 @@ END_MESSAGE_MAP()
{
CString out;
out.Format("%g", Scheme->getValue(index) );
out.Format(_T("%g"), Scheme->getValue(index) );
dc->TextOut(x + 10, y + 4, out);
}
CEditAttribDlg *newDialog(const std::string &id, IPSWrapperFloat *wrapper)
@ -896,7 +896,7 @@ END_MESSAGE_MAP()
{
CString out;
out.Format("%d", Scheme->getValue(index) );
out.Format(_T("%d"), Scheme->getValue(index) );
dc->TextOut(x + 10, y + 4, out);
}
CEditAttribDlg *newDialog(const std::string &id, IPSWrapperUInt *wrapper)
@ -1085,7 +1085,7 @@ END_MESSAGE_MAP()
{
CString out;
out.Format("%d", Scheme->getValue(index) );
out.Format(_T("%d"), Scheme->getValue(index) );
dc->TextOut(x + 10, y + 4, out);
}
CEditAttribDlg *newDialog(const std::string &id, IPSWrapper<sint32> *wrapper)

View file

@ -98,7 +98,7 @@ public:
}
// init the operator list box
static const char *ops[] = { "selectArg1", "selectArg2", "modulate", "add", "subtract" } ;
static const TCHAR *ops[] = { _T("selectArg1"), _T("selectArg2"), _T("modulate"), _T("add"), _T("subtract") };
for (k = 0 ; k < (uint) NL3D::CPSBinOp::last ; ++k)
{
// SchemeWrapper[k].S reference the atriobute maker being edited

View file

@ -77,24 +77,24 @@ public:
/** validate a value against upper bound. (if an upper bound was set
* \return NULL if ok or an error message
*/
const char *validateUpperBound(T v)
const TCHAR *validateUpperBound(T v)
{
if (!_UpperBoundEnabled) return NULL;
if (_UpperBoundExcluded && v < _UpperBound) return NULL;
if (!_UpperBoundExcluded && v <= _UpperBound) return NULL;
return "value too high";
return _T("value too high");
}
/** validate a value against lower bound. (if an lower bound was set
* \return NULL if ok or an error message
*/
const char *validateLowerBound(T v)
const TCHAR *validateLowerBound(T v)
{
if (!_LowerBoundEnabled) return NULL;
if (_LowerBoundExcluded && v > _LowerBound) return NULL;
if (!_LowerBoundExcluded && v >= _LowerBound) return NULL;
return "value too low";
return _T("value too low");
}
/// copy this bound checker object to another one

Some files were not shown because too many files have changed in this diff Show more