Integrate C++11 branch into 5_1-new

This commit is contained in:
teejusb
2019-06-22 12:35:38 -07:00
444 changed files with 19503 additions and 21007 deletions
+15 -18
View File
@@ -10,7 +10,6 @@
#include "RageTimer.h"
#include "RageUtil.h"
#include "ActorUtil.h"
#include "Foreach.h"
#include "LuaBinding.h"
#include "LuaManager.h"
#include "LocalizedString.h"
@@ -100,13 +99,13 @@ ActorMultiVertex::ActorMultiVertex( const ActorMultiVertex &cpy ):
CPY(_states);
#undef CPY
if( cpy._Texture != NULL )
if( cpy._Texture != nullptr )
{
_Texture = TEXTUREMAN->CopyTexture( cpy._Texture );
}
else
{
_Texture = NULL;
_Texture = nullptr;
}
}
@@ -137,7 +136,7 @@ void ActorMultiVertex::SetTexture( RageTexture *Texture )
void ActorMultiVertex::LoadFromTexture( RageTextureID ID )
{
RageTexture *Texture = NULL;
RageTexture *Texture = nullptr;
if( _Texture && _Texture->GetID() == ID )
{
return;
@@ -148,10 +147,10 @@ void ActorMultiVertex::LoadFromTexture( RageTextureID ID )
void ActorMultiVertex::UnloadTexture()
{
if( _Texture != NULL )
if( _Texture != nullptr )
{
TEXTUREMAN->UnloadTexture( _Texture );
_Texture = NULL;
_Texture = nullptr;
}
}
@@ -409,20 +408,18 @@ void ActorMultiVertex::SetState(size_t i)
void ActorMultiVertex::SetAllStateDelays(float delay)
{
FOREACH(State, _states, s)
for (State &s : _states)
{
s->delay= delay;
s.delay= delay;
}
}
float ActorMultiVertex::GetAnimationLengthSeconds() const
{
float tot= 0.0f;
FOREACH_CONST(State, _states, s)
{
tot+= s->delay;
}
return tot;
auto calcDelay = [](float total, State const &s) {
return total + s.delay;
};
return std::accumulate(_states.begin(), _states.end(), 0.f, calcDelay);
}
void ActorMultiVertex::SetSecondsIntoAnimation(float seconds)
@@ -958,7 +955,7 @@ public:
static void FillStateFromLua(lua_State *L, ActorMultiVertex::State& state,
RageTexture* tex, int index)
{
if(tex == NULL)
if(tex == nullptr)
{
luaL_error(L, "The texture must be set before adding states.");
}
@@ -1027,7 +1024,7 @@ public:
static int GetStateData(T* p, lua_State *L)
{
RageTexture* tex= p->GetTexture();
if(tex == NULL)
if(tex == nullptr)
{
luaL_error(L, "The texture must be set before adding states.");
}
@@ -1065,7 +1062,7 @@ public:
luaL_error(L, "The states must be inside a table.");
}
RageTexture* tex= p->GetTexture();
if(tex == NULL)
if(tex == nullptr)
{
luaL_error(L, "The texture must be set before adding states.");
}
@@ -1148,7 +1145,7 @@ public:
static int GetTexture(T* p, lua_State *L)
{
RageTexture *texture = p->GetTexture();
if(texture != NULL)
if(texture != nullptr)
{
texture->PushSelf(L);
}