Merge with develop

--HG--
branch : compatibility-develop
hg/compatibility-develop
kervala 7 years ago
commit 81929a6a75

@ -210,7 +210,7 @@ public:
* \return the new offset regarding from the origin.
* \see ESeekNotSupported SeekOrigin seek
*/
virtual sint32 getPos () const throw(EStream)
virtual sint32 getPos () const
{
return sint32(_Buffer.Pos);
}

@ -79,6 +79,9 @@
# elif _MSC_VER >= 1600
# define NL_COMP_VC10
# define NL_COMP_VC_VERSION 100
# ifdef _HAS_CPP0X
# undef _HAS_CPP0X // VC++ 2010 doesn't implement C++11 stuff we need
# endif
# elif _MSC_VER >= 1500
# define NL_COMP_VC9
# define NL_COMP_VC_VERSION 90
@ -409,8 +412,16 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
#define NL_DEFAULT_MEMORY_ALIGNMENT 16
#define NL_ALIGN_SSE2 NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT)
#ifndef NL_CPU_X86_64
#ifdef NL_CPU_X86_64
// on x86_64, new and delete are already aligned on 16 bytes
#elif (defined(NL_COMP_VC) && defined(NL_DEBUG))
// don't use aligned memory if debugging with VC++ in 32 bits
#else
// use aligned memory in all other cases
#define NL_USE_ALIGNED_MEMORY_OPERATORS
#endif
#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS
#ifdef NL_NO_EXCEPTION_SPECS
extern void *operator new(size_t size);
@ -422,9 +433,9 @@ extern void *operator new(size_t size) throw(std::bad_alloc);
extern void *operator new[](size_t size) throw(std::bad_alloc);
extern void operator delete(void *p) throw();
extern void operator delete[](void *p) throw();
#endif
#endif /* NL_NO_EXCEPTION_SPECS */
#endif
#endif /* NL_USE_ALIGNED_MEMORY_OPERATORS */
#else /* NL_HAS_SSE2 */

@ -780,7 +780,7 @@ namespace NLNET
bool initModule(const TParsedCommandLine &initInfo);
void plugModule(IModuleSocket *moduleSocket);
void unplugModule(IModuleSocket *moduleSocket) throw (EModuleNotPluggedHere);
void unplugModule(IModuleSocket *moduleSocket);
void getPluggedSocketList(std::vector<IModuleSocket*> &resultList);
void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg);
void _onModuleUp(IModuleProxy *removedProxy);

@ -849,7 +849,7 @@ public:
// Mode initialisation, requests
virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0);
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
virtual bool release();
virtual bool setMode(const GfxMode& mode);
virtual bool getModes(std::vector<GfxMode> &modes);

@ -459,7 +459,7 @@ namespace NLGUI
#endif
// Display cached image while downloading new
if (type != TImageType::OverImage && CFile::fileExists(dest))
if (type != OverImage && CFile::fileExists(dest))
{
setImage(img, dest, type);
setImageSize(img, style);
@ -4713,7 +4713,7 @@ namespace NLGUI
if (overBitmap != normalBitmap)
{
over = localImageName(overBitmap);
addImageDownload(overBitmap, ctrlButton, style, TImageType::OverImage);
addImageDownload(overBitmap, ctrlButton, style, OverImage);
}
}

@ -49,7 +49,7 @@ void CClassRegistry::release()
}
// ======================================================================================================
IClassable *CClassRegistry::create(const string &className) throw(ERegistry)
IClassable *CClassRegistry::create(const string &className)
{
init();
@ -72,7 +72,7 @@ IClassable *CClassRegistry::create(const string &className) throw(ERegistry)
}
// ======================================================================================================
void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck) throw(ERegistry)
void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck)
{
init();

@ -80,7 +80,7 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif // !NL_COMP_MINGW
#if defined(NL_HAS_SSE2) && !defined(NL_CPU_X86_64)
#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS
#ifdef NL_NO_EXCEPTION_SPECS
void *operator new(size_t size)

@ -357,7 +357,7 @@ void CParticleWorkspace::setName(const std::string &name)
//***********************************************************************************************
CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) throw( NLMISC::EStream)
CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath)
{
nlassert(_OV);
// Check that file is not already inserted

@ -187,7 +187,21 @@ static inline bool isUrlTag(const ucstring &s, ucstring::size_type index, ucstri
if (isUrl && i > 0 && !markdown)
{
// '}' is in the list because of color tags, ie "@{FFFF}http://..."
#ifdef NL_ISO_CPP0X_AVAILABLE
const vector<ucchar> chars{ ' ', '"', '\'', '(', '[', '}' };
#else
static std::vector<ucchar> chars;
if (chars.empty())
{
chars.push_back(' ');
chars.push_back('"');
chars.push_back('\'');
chars.push_back('(');
chars.push_back('[');
chars.push_back('}');
}
#endif
isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end();
}
return isUrl;

@ -83,8 +83,8 @@ void CItemGroup::addItem(sint32 createTime, sint32 serial, SLOT_EQUIPMENT::TSlot
nldebug("Not adding duplicate item, createTime: %d, serial: %d", createTime, serial);
//In this case, we are adding the duplicate item for a 2 hands item
//If it's saved as a left hand item, save it as a right hand item instead (so we have only 1 correct item)
if(Items[i].slot == SLOT_EQUIPMENT::TSlotEquipment::HANDL && slot == SLOT_EQUIPMENT::TSlotEquipment::HANDR)
Items[i].slot = SLOT_EQUIPMENT::TSlotEquipment::HANDR;
if(Items[i].slot == SLOT_EQUIPMENT::HANDL && slot == SLOT_EQUIPMENT::HANDR)
Items[i].slot = SLOT_EQUIPMENT::HANDR;
return;
}
}
@ -389,7 +389,7 @@ CItemGroup CItemGroupManager::migrateGroup(CItemGroup group)
//Get all matching items from all inventory
CItemGroup out;
out.name = group.name;
for (int i=0; i < INVENTORIES::TInventory::NUM_ALL_INVENTORY; i++)
for (int i=0; i < INVENTORIES::NUM_ALL_INVENTORY; i++)
{
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
std::vector<CInventoryItem> items = matchingItems(&group, inventory);
@ -501,7 +501,7 @@ bool CItemGroupManager::moveGroup(std::string name, INVENTORIES::TInventory dst)
std::string moveParams = "to=lists|nblist=1|listsheet0=" + toDbPath(dst);
// Grab all matching item from all available inventory and put it in dst
for (int i=0; i< INVENTORIES::TInventory::NUM_ALL_INVENTORY; i ++)
for (int i=0; i< INVENTORIES::NUM_ALL_INVENTORY; i ++)
{
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
if (inventory != dst && pIM->isInventoryAvailable(inventory))
@ -531,7 +531,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
return false;
}
if(pullBefore) moveGroup(name, INVENTORIES::TInventory::bag);
if(pullBefore) moveGroup(name, INVENTORIES::bag);
//Start by unequipping all slot that user wants to unequip
for(int i=0; i < group->removeBeforeEquip.size(); i++)
{
@ -547,6 +547,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
uint32 maxEquipTime = 0;
#ifdef NL_ISO_CPP0X_AVAILABLE
std::map<ITEM_TYPE::TItemType, bool> possiblyDual =
{
{ITEM_TYPE::ANKLET, false},
@ -554,8 +555,17 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
{ITEM_TYPE::EARING, false},
{ITEM_TYPE::RING, false},
};
#else
std::map<ITEM_TYPE::TItemType, bool> possiblyDual;
possiblyDual[ITEM_TYPE::ANKLET] = false;
possiblyDual[ITEM_TYPE::BRACELET] = false;
possiblyDual[ITEM_TYPE::EARING] = false;
possiblyDual[ITEM_TYPE::RING] = false;
#endif
std::vector<CInventoryItem> duals;
std::vector<CInventoryItem> items = matchingItems(group, INVENTORIES::TInventory::bag);
std::vector<CInventoryItem> items = matchingItems(group, INVENTORIES::bag);
for(int i=0; i < items.size(); i++)
{
CInventoryItem item = items[i];
@ -713,19 +723,19 @@ std::string CItemGroupManager::toDbPath(INVENTORIES::TInventory inventory)
{
switch(inventory)
{
case INVENTORIES::TInventory::bag:
case INVENTORIES::bag:
return LIST_BAG_TEXT; break;
case INVENTORIES::TInventory::pet_animal1:
case INVENTORIES::pet_animal1:
return LIST_PA0_TEXT; break;
case INVENTORIES::TInventory::pet_animal2:
case INVENTORIES::pet_animal2:
return LIST_PA1_TEXT; break;
case INVENTORIES::TInventory::pet_animal3:
case INVENTORIES::pet_animal3:
return LIST_PA2_TEXT; break;
case INVENTORIES::TInventory::pet_animal4:
case INVENTORIES::pet_animal4:
return LIST_PA3_TEXT; break;
case INVENTORIES::TInventory::player_room:
case INVENTORIES::player_room:
return LIST_ROOM_TEXT;break;
case INVENTORIES::TInventory::guild:
case INVENTORIES::guild:
return ClientCfg.ItemGroupAllowGuild ? LIST_GUILD_TEXT : ""; break;
default:
return "";

@ -83,7 +83,7 @@ std::string CFightSelectFilter::toString() const
CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr)
{
std::vector<std::string> params;
explodeSubStrings(inStr, params, -1);
@ -151,7 +151,7 @@ public:
CFightOnceReader() {}
virtual ~CFightOnceReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> params;
explodeSubStrings(inStr, params, -1);
@ -229,7 +229,7 @@ public:
CFightTimedFilterReader() {}
virtual ~CFightTimedFilterReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> params;
explodeSubStrings(inStr, params, -1);
@ -302,7 +302,7 @@ public:
CFightHPLessFilterReader() {}
virtual ~CFightHPLessFilterReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> params;
explodeSubStrings(inStr, params, -1);
@ -372,7 +372,7 @@ public:
CFightHPMoreFilterReader() {}
virtual ~CFightHPMoreFilterReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> params;
explodeSubStrings(inStr, params, -1);
@ -443,7 +443,7 @@ public:
CFightRandomFilterReader() {}
virtual ~CFightRandomFilterReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> params;
explodeSubStrings(inStr, params, -1);
@ -523,7 +523,7 @@ public:
CFightSendActionReader() {}
virtual ~CFightSendActionReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -588,7 +588,7 @@ public:
CFightSendSelfActionReader() {}
virtual ~CFightSendSelfActionReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -647,7 +647,7 @@ public:
CFightAggroBlockReader() {}
virtual ~CFightAggroBlockReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -705,7 +705,7 @@ public:
CFightAggroChangeReader() {}
virtual ~CFightAggroChangeReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
return new CFightAggroChange();
}
@ -751,7 +751,7 @@ public:
CFightDamageCoefReader() {}
virtual ~CFightDamageCoefReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -818,7 +818,7 @@ public:
CFightGroupDamageCoefReader() {}
virtual ~CFightGroupDamageCoefReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -871,7 +871,7 @@ public:
CFightDamageSpeedCoefReader() {}
virtual ~CFightDamageSpeedCoefReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -933,7 +933,7 @@ public:
CFightSetRandomTargetReader() {}
virtual ~CFightSetRandomTargetReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> strings;
explodeSubStrings(inStr, strings, -1);
@ -1003,7 +1003,7 @@ public:
CFightMultReader() {}
virtual ~CFightMultReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
CFightScriptComp *create (const std::string &inStr)
{
vector<string> params;
explodeSubStrings(inStr, params, -1);
@ -1075,7 +1075,7 @@ CFightScriptCompReader *CFightScriptCompReader::getScriptReader (const string &s
return &(*(it->second));
}
CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str) throw (ReadFightActionException)
CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str)
{
string scriptCompName;
{

@ -51,12 +51,12 @@ public:
{}
virtual ~CFightScriptCompReader()
{}
virtual CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) = 0;
virtual CFightScriptComp *create (const std::string &inStr) = 0;
virtual std::string getName () const =0;
static CFightScriptCompReader *getScriptReader (const std::string &str);
static CFightScriptComp *createScriptComp (const std::string &str) throw (ReadFightActionException);
static CFightScriptComp *createScriptComp (const std::string &str)
protected:
private:
};
@ -116,7 +116,7 @@ public:
CFightSelectFilterReader() {}
virtual ~CFightSelectFilterReader() {}
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException);
CFightScriptComp *create (const std::string &inStr)
std::string getName () const
{
return std::string("SELECT");

@ -90,7 +90,7 @@ public:
// the following routine shouldn't be needed it should be superceded by a better alternative
// in the event manager
template <class TState>
bool testCompatibility(CStateInstance *const stateInstance, const TState *const state) const;
bool testCompatibility(const CStateInstance *stateInstance, const TState *state) const
protected:
// protected data ---------------------------------------------------

@ -28,7 +28,7 @@
#include "continent.h"*/
template <class TState>
bool CAIEventReaction::testCompatibility(CStateInstance *const stateInstance, const TState *const state) const
bool CAIEventReaction::testCompatibility(const CStateInstance *stateInstance, const TState *state) const
{
if (!stateInstance)
return false;

@ -101,7 +101,7 @@ public :
* Get the client infos
* \param id is the client character id
*/
CChatClient& getClient( const TDataSetRow& id ); //throw (EChatClient);
CChatClient& getClient( const TDataSetRow& id );
/**
* Return a reference on the static database

Loading…
Cancel
Save