Support C++11 and update Eluna
Set compilation to use C++11 Updated Eluna version and applied all core modifications needed by the update
This commit is contained in:
parent
1be0b35125
commit
f81e455e3a
23
.travis.yml
23
.travis.yml
@ -1,7 +1,7 @@
|
||||
language: cpp
|
||||
|
||||
before_install:
|
||||
- bash .travis.sh
|
||||
# use docker in travis
|
||||
sudo: false
|
||||
|
||||
# reduce clone time by only getting the latest commit and not the whole history (default for travis is 100)
|
||||
git:
|
||||
@ -11,12 +11,6 @@ git:
|
||||
notifications:
|
||||
slack: getmangos:yRgNBSgRQVh8WdfGEbT08Hit
|
||||
|
||||
# only run travis on the master branch
|
||||
branches:
|
||||
only:
|
||||
- release20
|
||||
- develop21
|
||||
|
||||
# build on both Linux and OSX (finally)
|
||||
os:
|
||||
- linux
|
||||
@ -27,6 +21,19 @@ compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-4.8
|
||||
- g++-4.8
|
||||
- clang
|
||||
|
||||
before_install:
|
||||
- bash .travis.sh
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "gcc" ] ; then export CC=gcc-4.8 CXX=g++-4.8 ; fi
|
||||
|
||||
script:
|
||||
- test -d _build || mkdir _build
|
||||
- test -d _install || mkdir _install
|
||||
|
@ -119,11 +119,12 @@ elseif(UNIX)
|
||||
|
||||
if(NOT DEBUG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --no-warnings")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-warnings")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-warnings -std=c++11 -Wno-narrowing -Wno-deprecated-register")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -Woverloaded-virtual -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -Woverloaded-virtual -g3 -std=c++11 -Wno-narrowing -Wno-deprecated-register")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_C_COMPILER MATCHES "icc")
|
||||
if(PLATFORM EQUAL 32)
|
||||
add_definitions(-axSSE2)
|
||||
|
@ -173,6 +173,7 @@ typedef uint32 DWORD;
|
||||
#define CONCAT1(x, y) x##y
|
||||
#define STATIC_ASSERT_WORKAROUND(expr, msg) typedef char CONCAT(static_assert_failed_at_line_, __LINE__) [(expr) ? 1 : -1]
|
||||
|
||||
#ifndef COMPILER_HAS_CPP11_SUPPORT
|
||||
#if COMPILER == COMPILER_GNU
|
||||
# if !defined(__GXX_EXPERIMENTAL_CXX0X__) || (__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 7)
|
||||
# define override
|
||||
@ -188,6 +189,7 @@ typedef uint32 DWORD;
|
||||
# define static_assert(a, b) STATIC_ASSERT_WORKAROUND(a, b)
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -183,8 +183,7 @@ Creature::~Creature()
|
||||
void Creature::AddToWorld()
|
||||
{
|
||||
#ifdef ENABLE_ELUNA
|
||||
if (!IsInWorld())
|
||||
sEluna->OnAddToWorld(this);
|
||||
bool inWorld = IsInWorld();
|
||||
#endif /* ENABLE_ELUNA */
|
||||
|
||||
///- Register the creature for guid lookup
|
||||
@ -197,6 +196,11 @@ void Creature::AddToWorld()
|
||||
std::set<uint32> const* mapList = sWorld.getConfigForceLoadMapIds();
|
||||
if ((mapList && mapList->find(GetMapId()) != mapList->end()) || (GetCreatureInfo()->ExtraFlags & CREATURE_EXTRA_FLAG_ACTIVE))
|
||||
{ SetActiveObjectState(true); }
|
||||
|
||||
#ifdef ENABLE_ELUNA
|
||||
if (!inWorld)
|
||||
sEluna->OnAddToWorld(this);
|
||||
#endif /* ENABLE_ELUNA */
|
||||
}
|
||||
|
||||
void Creature::RemoveFromWorld()
|
||||
|
@ -85,8 +85,7 @@ GameObject::~GameObject()
|
||||
void GameObject::AddToWorld()
|
||||
{
|
||||
#ifdef ENABLE_ELUNA
|
||||
if (!IsInWorld())
|
||||
sEluna->OnAddToWorld(this);
|
||||
bool inWorld = IsInWorld();
|
||||
#endif /* ENABLE_ELUNA */
|
||||
|
||||
///- Register the gameobject for guid lookup
|
||||
@ -100,6 +99,11 @@ void GameObject::AddToWorld()
|
||||
|
||||
// After Object::AddToWorld so that for initial state the GO is added to the world (and hence handled correctly)
|
||||
UpdateCollisionState();
|
||||
|
||||
#ifdef ENABLE_ELUNA
|
||||
if (!inWorld)
|
||||
sEluna->OnAddToWorld(this);
|
||||
#endif /* ENABLE_ELUNA */
|
||||
}
|
||||
|
||||
void GameObject::RemoveFromWorld()
|
||||
|
@ -62,6 +62,11 @@ Map::~Map()
|
||||
if (m_persistentState)
|
||||
{ m_persistentState->SetUsedByMapState(NULL); } // field pointer can be deleted after this
|
||||
|
||||
#ifdef ENABLE_ELUNA
|
||||
if (Instanceable())
|
||||
sEluna->FreeInstanceId(GetInstanceId());
|
||||
#endif /* ENABLE_ELUNA */
|
||||
|
||||
delete i_data;
|
||||
i_data = NULL;
|
||||
|
||||
@ -1192,14 +1197,22 @@ void Map::CreateInstanceData(bool load)
|
||||
if (i_data != NULL)
|
||||
{ return; }
|
||||
|
||||
uint32 i_script_id = GetScriptId();
|
||||
#ifdef ENABLE_ELUNA
|
||||
i_data = sEluna->GetInstanceData(this);
|
||||
#endif /* ENABLE_ELUNA */
|
||||
|
||||
if (!i_script_id)
|
||||
{ return; }
|
||||
|
||||
i_data = sScriptMgr.CreateInstanceData(this);
|
||||
uint32 i_script_id = 0;
|
||||
if (!i_data)
|
||||
{ return; }
|
||||
{
|
||||
i_script_id = GetScriptId();
|
||||
|
||||
if (!i_script_id)
|
||||
{ return; }
|
||||
|
||||
i_data = sScriptMgr.CreateInstanceData(this);
|
||||
if (!i_data)
|
||||
{ return; }
|
||||
}
|
||||
|
||||
if (load)
|
||||
{
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 48e5d45d9c504d0da83e015374b92bb36f97821b
|
||||
Subproject commit 33e3bf9de270e916b5bacd5b329486e265eec609
|
Loading…
x
Reference in New Issue
Block a user