std::size_t -> size_t
Removing std prefix from all size_t.
This commit is contained in:
+12
-12
@@ -175,7 +175,7 @@ Actor::~Actor()
|
||||
{
|
||||
StopTweening();
|
||||
UnsubscribeAll();
|
||||
for(std::size_t i= 0; i < m_WrapperStates.size(); ++i)
|
||||
for(size_t i= 0; i < m_WrapperStates.size(); ++i)
|
||||
{
|
||||
RageUtil::SafeDelete(m_WrapperStates[i]);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ Actor::Actor( const Actor &cpy ):
|
||||
CPY( m_pLuaInstance );
|
||||
|
||||
m_WrapperStates.resize(cpy.m_WrapperStates.size());
|
||||
for(std::size_t i= 0; i < m_WrapperStates.size(); ++i)
|
||||
for(size_t i= 0; i < m_WrapperStates.size(); ++i)
|
||||
{
|
||||
m_WrapperStates[i]= new ActorFrame(*dynamic_cast<ActorFrame*>(cpy.m_WrapperStates[i]));
|
||||
}
|
||||
@@ -404,7 +404,7 @@ void Actor::Draw()
|
||||
{
|
||||
m_FakeParent->BeginDraw();
|
||||
}
|
||||
std::size_t wrapper_states_used= 0;
|
||||
size_t wrapper_states_used= 0;
|
||||
RageColor last_diffuse;
|
||||
RageColor last_glow;
|
||||
bool use_last_diffuse= false;
|
||||
@@ -420,7 +420,7 @@ void Actor::Draw()
|
||||
// wrapper[3] is the outermost frame. wrapper[2] is inside wrapper[3].
|
||||
// wrapper[1] is inside wrapper[2]. The actor is inside wrapper[1].
|
||||
// -Kyz
|
||||
for(std::size_t i= m_WrapperStates.size(); i > 0 && dont_abort_draw; --i)
|
||||
for(size_t i= m_WrapperStates.size(); i > 0 && dont_abort_draw; --i)
|
||||
{
|
||||
Actor* state= m_WrapperStates[i-1];
|
||||
if(!state->m_bVisible || state->m_fHibernateSecondsLeft > 0 ||
|
||||
@@ -469,7 +469,7 @@ void Actor::Draw()
|
||||
}
|
||||
this->PostDraw();
|
||||
}
|
||||
for(std::size_t i= 0; i < wrapper_states_used; ++i)
|
||||
for(size_t i= 0; i < wrapper_states_used; ++i)
|
||||
{
|
||||
Actor* state= m_WrapperStates[i];
|
||||
if(abort_with_end_draw)
|
||||
@@ -886,7 +886,7 @@ void Actor::Update( float fDeltaTime )
|
||||
fDeltaTime = -m_fHibernateSecondsLeft;
|
||||
m_fHibernateSecondsLeft = 0;
|
||||
}
|
||||
for(std::size_t i= 0; i < m_WrapperStates.size(); ++i)
|
||||
for(size_t i= 0; i < m_WrapperStates.size(); ++i)
|
||||
{
|
||||
m_WrapperStates[i]->Update(fDeltaTime);
|
||||
}
|
||||
@@ -984,14 +984,14 @@ void Actor::AddWrapperState()
|
||||
m_WrapperStates.push_back(wrapper);
|
||||
}
|
||||
|
||||
void Actor::RemoveWrapperState(std::size_t i)
|
||||
void Actor::RemoveWrapperState(size_t i)
|
||||
{
|
||||
ASSERT(i < m_WrapperStates.size());
|
||||
RageUtil::SafeDelete(m_WrapperStates[i]);
|
||||
m_WrapperStates.erase(m_WrapperStates.begin()+i);
|
||||
}
|
||||
|
||||
Actor* Actor::GetWrapperState(std::size_t i)
|
||||
Actor* Actor::GetWrapperState(size_t i)
|
||||
{
|
||||
ASSERT(i < m_WrapperStates.size());
|
||||
return m_WrapperStates[i];
|
||||
@@ -1964,11 +1964,11 @@ public:
|
||||
p->GetWrapperState(p->GetNumWrapperStates()-1)->PushSelf(L);
|
||||
return 1;
|
||||
}
|
||||
static std::size_t get_state_index(T* p, lua_State* L, int stack_index)
|
||||
static size_t get_state_index(T* p, lua_State* L, int stack_index)
|
||||
{
|
||||
// Lua is one indexed.
|
||||
int i= IArg(stack_index)-1;
|
||||
const std::size_t si= static_cast<std::size_t>(i);
|
||||
const size_t si= static_cast<size_t>(i);
|
||||
if(i < 0 || si >= p->GetNumWrapperStates())
|
||||
{
|
||||
luaL_error(L, "%d is not a valid wrapper state index.", i+1);
|
||||
@@ -1977,7 +1977,7 @@ public:
|
||||
}
|
||||
static int RemoveWrapperState(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t si= get_state_index(p, L, 1);
|
||||
size_t si= get_state_index(p, L, 1);
|
||||
p->RemoveWrapperState(si);
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
@@ -1988,7 +1988,7 @@ public:
|
||||
}
|
||||
static int GetWrapperState(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t si= get_state_index(p, L, 1);
|
||||
size_t si= get_state_index(p, L, 1);
|
||||
p->GetWrapperState(si)->PushSelf(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
+3
-3
@@ -318,9 +318,9 @@ public:
|
||||
Actor* GetFakeParent() { return m_FakeParent; }
|
||||
|
||||
void AddWrapperState();
|
||||
void RemoveWrapperState(std::size_t i);
|
||||
Actor* GetWrapperState(std::size_t i);
|
||||
std::size_t GetNumWrapperStates() const { return m_WrapperStates.size(); }
|
||||
void RemoveWrapperState(size_t i);
|
||||
Actor* GetWrapperState(size_t i);
|
||||
size_t GetNumWrapperStates() const { return m_WrapperStates.size(); }
|
||||
|
||||
/**
|
||||
* @brief Retrieve the Actor's x position.
|
||||
|
||||
@@ -98,7 +98,7 @@ void ActorMultiTexture::DrawPrimitives()
|
||||
quadVerticies.bottom = +m_size.y/2.0f;
|
||||
|
||||
DISPLAY->ClearAllTextures();
|
||||
for( std::size_t i = 0; i < m_aTextureUnits.size(); ++i )
|
||||
for( size_t i = 0; i < m_aTextureUnits.size(); ++i )
|
||||
{
|
||||
TextureUnit tu = enum_add2(TextureUnit_1, i);
|
||||
DISPLAY->SetTexture( tu, m_aTextureUnits[i].m_pTexture->GetTexHandle() );
|
||||
@@ -127,7 +127,7 @@ void ActorMultiTexture::DrawPrimitives()
|
||||
|
||||
DISPLAY->DrawQuad( v );
|
||||
|
||||
for( std::size_t i = 0; i < m_aTextureUnits.size(); ++i )
|
||||
for( size_t i = 0; i < m_aTextureUnits.size(); ++i )
|
||||
DISPLAY->SetTexture( enum_add2(TextureUnit_1, i), 0 );
|
||||
|
||||
DISPLAY->SetEffectMode( EffectMode_Normal );
|
||||
|
||||
+47
-47
@@ -69,7 +69,7 @@ ActorMultiVertex::ActorMultiVertex()
|
||||
_EffectMode = EffectMode_Normal;
|
||||
_TextureMode = TextureMode_Modulate;
|
||||
_splines.resize(num_vert_splines);
|
||||
for(std::size_t i= 0; i < num_vert_splines; ++i)
|
||||
for(size_t i= 0; i < num_vert_splines; ++i)
|
||||
{
|
||||
_splines[i].redimension(3);
|
||||
_splines[i].m_owned_by_actor= true;
|
||||
@@ -158,11 +158,11 @@ void ActorMultiVertex::UnloadTexture()
|
||||
}
|
||||
}
|
||||
|
||||
void ActorMultiVertex::SetNumVertices( std::size_t n )
|
||||
void ActorMultiVertex::SetNumVertices( size_t n )
|
||||
{
|
||||
if( n == 0 )
|
||||
{
|
||||
for( std::size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
for( size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
{
|
||||
AMV_Tweens[i].vertices.clear();
|
||||
}
|
||||
@@ -171,7 +171,7 @@ void ActorMultiVertex::SetNumVertices( std::size_t n )
|
||||
}
|
||||
else
|
||||
{
|
||||
for( std::size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
for( size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
{
|
||||
AMV_Tweens[i].vertices.resize( n );
|
||||
}
|
||||
@@ -182,7 +182,7 @@ void ActorMultiVertex::SetNumVertices( std::size_t n )
|
||||
|
||||
void ActorMultiVertex::ResizeVertices(std::vector<RageSpriteVertex>& vertices, int size)
|
||||
{
|
||||
if (vertices.capacity() < static_cast<std::size_t>(size))
|
||||
if (vertices.capacity() < static_cast<size_t>(size))
|
||||
{
|
||||
vertices.reserve(size);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void ActorMultiVertex::ResizeVertices(std::vector<RageSpriteVertex>& vertices, i
|
||||
|
||||
void ActorMultiVertex::AddVertex()
|
||||
{
|
||||
for( std::size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
for( size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
{
|
||||
AMV_Tweens[i].vertices.emplace_back( RageSpriteVertex() );
|
||||
}
|
||||
@@ -203,7 +203,7 @@ void ActorMultiVertex::AddVertices( int Add )
|
||||
{
|
||||
int size = AMV_DestTweenState().vertices.size();
|
||||
size += Add;
|
||||
for( std::size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
for( size_t i = 0; i < AMV_Tweens.size(); ++i )
|
||||
{
|
||||
ResizeVertices(AMV_Tweens[i].vertices, size);
|
||||
}
|
||||
@@ -246,7 +246,7 @@ void ActorMultiVertex::DrawPrimitives()
|
||||
if( m_pTempState->diffuse[0] != RageColor(1, 1, 1, 1) && m_pTempState->diffuse[0].a > 0 )
|
||||
{
|
||||
|
||||
for( std::size_t i=0; i < TS.vertices.size(); i++ )
|
||||
for( size_t i=0; i < TS.vertices.size(); i++ )
|
||||
{
|
||||
// RageVColor uses a std::uint8_t for each channel. 0-255.
|
||||
// RageColor uses a float. 0-1.
|
||||
@@ -279,7 +279,7 @@ void ActorMultiVertex::DrawPrimitives()
|
||||
if( m_pTempState->glow.a > 0 )
|
||||
{
|
||||
|
||||
for( std::size_t i=0; i < TS.vertices.size(); i++ )
|
||||
for( size_t i=0; i < TS.vertices.size(); i++ )
|
||||
{
|
||||
TS.vertices[i].c = m_pTempState->glow;
|
||||
}
|
||||
@@ -354,19 +354,19 @@ bool ActorMultiVertex::EarlyAbortDraw() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void ActorMultiVertex::SetVertsFromSplinesInternal(std::size_t num_splines, std::size_t offset)
|
||||
void ActorMultiVertex::SetVertsFromSplinesInternal(size_t num_splines, size_t offset)
|
||||
{
|
||||
std::vector<RageSpriteVertex>& verts= AMV_DestTweenState().vertices;
|
||||
std::size_t first= AMV_DestTweenState().FirstToDraw + offset;
|
||||
std::size_t num_verts= AMV_DestTweenState().GetSafeNumToDraw(AMV_DestTweenState()._DrawMode, AMV_DestTweenState().NumToDraw) - offset;
|
||||
size_t first= AMV_DestTweenState().FirstToDraw + offset;
|
||||
size_t num_verts= AMV_DestTweenState().GetSafeNumToDraw(AMV_DestTweenState()._DrawMode, AMV_DestTweenState().NumToDraw) - offset;
|
||||
std::vector<float> tper(num_splines, 0.0f);
|
||||
float num_parts= (static_cast<float>(num_verts) /
|
||||
static_cast<float>(num_splines)) - 1.0f;
|
||||
for(std::size_t i= 0; i < num_splines; ++i)
|
||||
for(size_t i= 0; i < num_splines; ++i)
|
||||
{
|
||||
tper[i]= _splines[i].get_max_t() / num_parts;
|
||||
}
|
||||
for(std::size_t v= 0; v < num_verts; ++v)
|
||||
for(size_t v= 0; v < num_verts; ++v)
|
||||
{
|
||||
std::vector<float> pos;
|
||||
const int spi= v%num_splines;
|
||||
@@ -406,7 +406,7 @@ void ActorMultiVertex::SetVertsFromSplines()
|
||||
}
|
||||
}
|
||||
|
||||
CubicSplineN* ActorMultiVertex::GetSpline(std::size_t i)
|
||||
CubicSplineN* ActorMultiVertex::GetSpline(size_t i)
|
||||
{
|
||||
ASSERT(i < num_vert_splines);
|
||||
return &(_splines[i]);
|
||||
@@ -414,7 +414,7 @@ CubicSplineN* ActorMultiVertex::GetSpline(std::size_t i)
|
||||
|
||||
void ActorMultiVertex::SetState(int i)
|
||||
{
|
||||
ASSERT(i >= 0 && static_cast<std::size_t>(i) < _states.size());
|
||||
ASSERT(i >= 0 && static_cast<size_t>(i) < _states.size());
|
||||
_cur_state= i;
|
||||
_secs_into_state= 0.0f;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update)
|
||||
{
|
||||
AMV_TweenState& dest= AMV_DestTweenState();
|
||||
std::vector<RageSpriteVertex>& verts= dest.vertices;
|
||||
std::vector<std::size_t>& qs= dest.quad_states;
|
||||
std::vector<size_t>& qs= dest.quad_states;
|
||||
if(!_use_animation_state || _states.empty() ||
|
||||
dest._DrawMode == DrawMode_LineStrip || qs.empty())
|
||||
{ return; }
|
||||
@@ -467,16 +467,16 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update)
|
||||
}
|
||||
if(state_changed)
|
||||
{
|
||||
std::size_t first= dest.FirstToDraw;
|
||||
std::size_t last= first+dest.GetSafeNumToDraw(dest._DrawMode, dest.NumToDraw);
|
||||
size_t first= dest.FirstToDraw;
|
||||
size_t last= first+dest.GetSafeNumToDraw(dest._DrawMode, dest.NumToDraw);
|
||||
|
||||
switch(AMV_DestTweenState()._DrawMode)
|
||||
{
|
||||
case DrawMode_Quads:
|
||||
for (std::size_t i = first; i < last; ++i)
|
||||
for (size_t i = first; i < last; ++i)
|
||||
{
|
||||
const std::size_t quad_id = (i - first) / 4;
|
||||
const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const size_t quad_id = (i - first) / 4;
|
||||
const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const auto& rect = _states[state_id].rect;
|
||||
|
||||
switch ((i - first) % 4)
|
||||
@@ -504,10 +504,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update)
|
||||
}
|
||||
[[fallthrough]];
|
||||
case DrawMode_QuadStrip:
|
||||
for (std::size_t i = first; i < last; ++i)
|
||||
for (size_t i = first; i < last; ++i)
|
||||
{
|
||||
const std::size_t quad_id = (i - first) / 2;
|
||||
const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const size_t quad_id = (i - first) / 2;
|
||||
const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const auto& rect = _states[state_id].rect;
|
||||
|
||||
if ((i - first) % 2 == 0)
|
||||
@@ -524,10 +524,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update)
|
||||
break;
|
||||
case DrawMode_Strip:
|
||||
case DrawMode_Fan:
|
||||
for (std::size_t i = first; i < last; ++i)
|
||||
for (size_t i = first; i < last; ++i)
|
||||
{
|
||||
const std::size_t quad_id = (i - first);
|
||||
const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const size_t quad_id = (i - first);
|
||||
const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const auto& rect = _states[state_id].rect;
|
||||
|
||||
verts[i].t.x = rect.left;
|
||||
@@ -535,10 +535,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update)
|
||||
}
|
||||
break;
|
||||
case DrawMode_Triangles:
|
||||
for (std::size_t i = first; i < last; ++i)
|
||||
for (size_t i = first; i < last; ++i)
|
||||
{
|
||||
const std::size_t quad_id = (i - first) / 3;
|
||||
const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const size_t quad_id = (i - first) / 3;
|
||||
const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const auto& rect = _states[state_id].rect;
|
||||
|
||||
switch ((i - first) % 3)
|
||||
@@ -559,10 +559,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update)
|
||||
}
|
||||
break;
|
||||
case DrawMode_SymmetricQuadStrip:
|
||||
for (std::size_t i = first; i < last; ++i)
|
||||
for (size_t i = first; i < last; ++i)
|
||||
{
|
||||
const std::size_t quad_id = (i - first) / 3;
|
||||
const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const size_t quad_id = (i - first) / 3;
|
||||
const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size();
|
||||
const auto& rect = _states[state_id].rect;
|
||||
|
||||
switch ((i - first) % 3)
|
||||
@@ -682,7 +682,7 @@ void ActorMultiVertex::AMV_TweenState::SetDrawState( DrawMode dm, int first, int
|
||||
void ActorMultiVertex::AMV_TweenState::MakeWeightedAverage(AMV_TweenState& average_out, const AMV_TweenState& ts1, const AMV_TweenState& ts2, float percent_between)
|
||||
{
|
||||
average_out.line_width= lerp(percent_between, ts1.line_width, ts2.line_width);
|
||||
for(std::size_t v= 0; v < average_out.vertices.size(); ++v)
|
||||
for(size_t v= 0; v < average_out.vertices.size(); ++v)
|
||||
{
|
||||
WeightedAvergeOfRSVs(average_out.vertices[v], ts1.vertices[v], ts2.vertices[v], percent_between);
|
||||
}
|
||||
@@ -718,7 +718,7 @@ public:
|
||||
}
|
||||
static int GetNumVertices( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumVertices() ); return 1; }
|
||||
|
||||
static void SetVertexFromStack(T* p, lua_State* L, std::size_t VertexIndex, int DataStackIndex)
|
||||
static void SetVertexFromStack(T* p, lua_State* L, size_t VertexIndex, int DataStackIndex)
|
||||
{
|
||||
// Use the number of arguments to determine which property a table is for
|
||||
if(lua_type(L, DataStackIndex) != LUA_TTABLE)
|
||||
@@ -726,13 +726,13 @@ public:
|
||||
LuaHelpers::ReportScriptErrorFmt("ActorMultiVertex::SetVertex: non-table parameter supplied. Table of tables of vertex data expected.");
|
||||
return;
|
||||
}
|
||||
std::size_t NumDataParts = lua_objlen(L, DataStackIndex);
|
||||
for(std::size_t i = 0; i < NumDataParts; ++i)
|
||||
size_t NumDataParts = lua_objlen(L, DataStackIndex);
|
||||
for(size_t i = 0; i < NumDataParts; ++i)
|
||||
{
|
||||
lua_pushnumber(L, i+1);
|
||||
lua_gettable(L, DataStackIndex);
|
||||
int DataPieceIndex = lua_gettop(L);
|
||||
std::size_t DataPieceElements = lua_objlen(L, DataPieceIndex);
|
||||
size_t DataPieceElements = lua_objlen(L, DataPieceIndex);
|
||||
if(lua_type(L, DataPieceIndex) != LUA_TTABLE)
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertex: non-table parameter %u supplied inside table of parameters, table expected.", (unsigned int)i );
|
||||
@@ -950,7 +950,7 @@ public:
|
||||
|
||||
static int GetSpline(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t i= static_cast<std::size_t>(IArg(1)-1);
|
||||
size_t i= static_cast<size_t>(IArg(1)-1);
|
||||
if(i >= ActorMultiVertex::num_vert_splines)
|
||||
{
|
||||
luaL_error(L, "Spline index must be greater than 0 and less than or equal to %zu.", ActorMultiVertex::num_vert_splines);
|
||||
@@ -1021,14 +1021,14 @@ public:
|
||||
p->AddState(s);
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static std::size_t ValidStateIndex(T* p, lua_State *L, int pos)
|
||||
static size_t ValidStateIndex(T* p, lua_State *L, int pos)
|
||||
{
|
||||
int index= IArg(pos)-1;
|
||||
if(index < 0 || index >= p->GetNumStates())
|
||||
{
|
||||
luaL_error(L, "Invalid state index %d.", index+1);
|
||||
}
|
||||
return static_cast<std::size_t>(index);
|
||||
return static_cast<size_t>(index);
|
||||
}
|
||||
static int RemoveState(T* p, lua_State *L)
|
||||
{
|
||||
@@ -1091,9 +1091,9 @@ public:
|
||||
luaL_error(L, "The texture must be set before adding states.");
|
||||
}
|
||||
std::vector<ActorMultiVertex::State> new_states;
|
||||
std::size_t num_states= lua_objlen(L, 1);
|
||||
size_t num_states= lua_objlen(L, 1);
|
||||
new_states.resize(num_states);
|
||||
for(std::size_t i= 0; i < num_states; ++i)
|
||||
for(size_t i= 0; i < num_states; ++i)
|
||||
{
|
||||
lua_rawgeti(L, 1, i+1);
|
||||
FillStateFromLua(L, new_states[i], tex, -1);
|
||||
@@ -1118,14 +1118,14 @@ public:
|
||||
lua_pushnumber(L, p->GetNumQuadStates());
|
||||
return 1;
|
||||
}
|
||||
static std::size_t QuadStateIndex(T* p, lua_State *L, int pos)
|
||||
static size_t QuadStateIndex(T* p, lua_State *L, int pos)
|
||||
{
|
||||
int index= IArg(pos)-1;
|
||||
if(index < 0 || static_cast<std::size_t>(index) >= p->GetNumQuadStates())
|
||||
if(index < 0 || static_cast<size_t>(index) >= p->GetNumQuadStates())
|
||||
{
|
||||
luaL_error(L, "Invalid state index %d.", index+1);
|
||||
}
|
||||
return static_cast<std::size_t>(index);
|
||||
return static_cast<size_t>(index);
|
||||
}
|
||||
static int AddQuadState(T* p, lua_State *L)
|
||||
{
|
||||
|
||||
+16
-16
@@ -31,7 +31,7 @@ class RageTexture;
|
||||
class ActorMultiVertex: public Actor
|
||||
{
|
||||
public:
|
||||
static const std::size_t num_vert_splines= 4;
|
||||
static const size_t num_vert_splines= 4;
|
||||
ActorMultiVertex();
|
||||
ActorMultiVertex( const ActorMultiVertex &cpy );
|
||||
virtual ~ActorMultiVertex();
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
int GetSafeNumToDraw( DrawMode dm, int num ) const;
|
||||
|
||||
std::vector<RageSpriteVertex> vertices;
|
||||
std::vector<std::size_t> quad_states;
|
||||
std::vector<size_t> quad_states;
|
||||
|
||||
DrawMode _DrawMode;
|
||||
int FirstToDraw;
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
void LoadFromTexture( RageTextureID ID );
|
||||
|
||||
void UnloadTexture();
|
||||
void SetNumVertices( std::size_t n );
|
||||
void SetNumVertices( size_t n );
|
||||
|
||||
void ResizeVertices(std::vector<RageSpriteVertex>& vertices, int size);
|
||||
void AddVertex();
|
||||
@@ -108,15 +108,15 @@ public:
|
||||
DrawMode GetCurrDrawMode() const { return AMV_current._DrawMode; }
|
||||
int GetCurrFirstToDraw() const { return AMV_current.FirstToDraw; }
|
||||
int GetCurrNumToDraw() const { return AMV_current.NumToDraw; }
|
||||
std::size_t GetNumVertices() { return AMV_DestTweenState().vertices.size(); }
|
||||
size_t GetNumVertices() { return AMV_DestTweenState().vertices.size(); }
|
||||
|
||||
void SetVertexPos( int index , float x , float y , float z );
|
||||
void SetVertexColor( int index , RageColor c );
|
||||
void SetVertexCoords( int index , float TexCoordX , float TexCoordY );
|
||||
|
||||
inline void SetVertsFromSplinesInternal(std::size_t num_splines, std::size_t start_vert);
|
||||
inline void SetVertsFromSplinesInternal(size_t num_splines, size_t start_vert);
|
||||
void SetVertsFromSplines();
|
||||
CubicSplineN* GetSpline(std::size_t i);
|
||||
CubicSplineN* GetSpline(size_t i);
|
||||
|
||||
struct State
|
||||
{
|
||||
@@ -125,12 +125,12 @@ public:
|
||||
};
|
||||
int GetNumStates() const override { return _states.size(); }
|
||||
void AddState(const State& new_state) { _states.push_back(new_state); }
|
||||
void RemoveState(std::size_t i)
|
||||
void RemoveState(size_t i)
|
||||
{ ASSERT(i < _states.size()); _states.erase(_states.begin()+i); }
|
||||
std::size_t GetState() { return _cur_state; }
|
||||
State& GetStateData(std::size_t i)
|
||||
size_t GetState() { return _cur_state; }
|
||||
State& GetStateData(size_t i)
|
||||
{ ASSERT(i < _states.size()); return _states[i]; }
|
||||
void SetStateData(std::size_t i, const State& s)
|
||||
void SetStateData(size_t i, const State& s)
|
||||
{ ASSERT(i < _states.size()); _states[i]= s; }
|
||||
void SetStateProperties(const std::vector<State>& new_states)
|
||||
{ _states= new_states; SetState(0); }
|
||||
@@ -139,15 +139,15 @@ public:
|
||||
float GetAnimationLengthSeconds() const override;
|
||||
void SetSecondsIntoAnimation(float seconds) override;
|
||||
void UpdateAnimationState(bool force_update= false);
|
||||
std::size_t GetNumQuadStates() const
|
||||
size_t GetNumQuadStates() const
|
||||
{ return AMV_DestTweenState().quad_states.size(); }
|
||||
void AddQuadState(std::size_t s)
|
||||
void AddQuadState(size_t s)
|
||||
{ AMV_DestTweenState().quad_states.push_back(s); }
|
||||
void RemoveQuadState(std::size_t i)
|
||||
void RemoveQuadState(size_t i)
|
||||
{ AMV_DestTweenState().quad_states.erase(AMV_DestTweenState().quad_states.begin()+i); }
|
||||
std::size_t GetQuadState(std::size_t i)
|
||||
size_t GetQuadState(size_t i)
|
||||
{ return AMV_DestTweenState().quad_states[i]; }
|
||||
void SetQuadState(std::size_t i, std::size_t s)
|
||||
void SetQuadState(size_t i, size_t s)
|
||||
{ AMV_DestTweenState().quad_states[i]= s; }
|
||||
bool _use_animation_state;
|
||||
bool _decode_movie;
|
||||
@@ -174,7 +174,7 @@ private:
|
||||
|
||||
bool _skip_next_update;
|
||||
float _secs_into_state;
|
||||
std::size_t _cur_state;
|
||||
size_t _cur_state;
|
||||
std::vector<State> _states;
|
||||
};
|
||||
|
||||
|
||||
+3
-3
@@ -361,7 +361,7 @@ void AdjustSync::GetSyncChangeTextSong( std::vector<RString> &vsAddTo )
|
||||
const std::vector<TimingSegment*> &bpmTest = testing.GetTimingSegments(SEGMENT_BPM);
|
||||
const std::vector<TimingSegment*> &bpmOrig = original.GetTimingSegments(SEGMENT_BPM);
|
||||
SEGMENTS_MISMATCH_MESSAGE(bpmOrig, bpmTest, bpm);
|
||||
for(std::size_t i= 0; i < bpmTest.size() && i < bpmOrig.size(); i++)
|
||||
for(size_t i= 0; i < bpmTest.size() && i < bpmOrig.size(); i++)
|
||||
{
|
||||
float fNew = Quantize( ToBPM(bpmTest[i])->GetBPM(), 0.001f );
|
||||
float fOld = Quantize( ToBPM(bpmOrig[i])->GetBPM(), 0.001f );
|
||||
@@ -385,7 +385,7 @@ void AdjustSync::GetSyncChangeTextSong( std::vector<RString> &vsAddTo )
|
||||
const std::vector<TimingSegment*> &stopOrig = original.GetTimingSegments(SEGMENT_STOP);
|
||||
|
||||
SEGMENTS_MISMATCH_MESSAGE(stopOrig, stopTest, stop);
|
||||
for(std::size_t i= 0; i < stopTest.size() && i < stopOrig.size(); i++)
|
||||
for(size_t i= 0; i < stopTest.size() && i < stopOrig.size(); i++)
|
||||
{
|
||||
float fOld = Quantize( ToStop(stopOrig[i])->GetPause(), 0.001f );
|
||||
float fNew = Quantize( ToStop(stopTest[i])->GetPause(), 0.001f );
|
||||
@@ -408,7 +408,7 @@ void AdjustSync::GetSyncChangeTextSong( std::vector<RString> &vsAddTo )
|
||||
const std::vector<TimingSegment*> &delyOrig = original.GetTimingSegments(SEGMENT_DELAY);
|
||||
|
||||
SEGMENTS_MISMATCH_MESSAGE(delyOrig, delyTest, delay);
|
||||
for(std::size_t i= 0; i < delyTest.size() && i < delyOrig.size(); i++)
|
||||
for(size_t i= 0; i < delyTest.size() && i < delyOrig.size(); i++)
|
||||
{
|
||||
if( delyTest[i] == delyOrig[i] )
|
||||
continue;
|
||||
|
||||
@@ -53,15 +53,15 @@ static ThemeMetric<float> TIPSY_OFFSET_TIMER_FREQUENCY( "ArrowEffects", "TipsyOf
|
||||
static ThemeMetric<float> TIPSY_OFFSET_COLUMN_FREQUENCY( "ArrowEffects", "TipsyOffsetColumnFrequency" );
|
||||
static ThemeMetric<float> TIPSY_OFFSET_ARROW_MAGNITUDE( "ArrowEffects", "TipsyOffsetArrowMagnitude" );
|
||||
|
||||
static RString TPSTL_NAME(std::size_t i) { return ssprintf("Tornado%cPositionScaleToLow", dimension_names[i]); }
|
||||
static RString TPSTL_NAME(size_t i) { return ssprintf("Tornado%cPositionScaleToLow", dimension_names[i]); }
|
||||
static ThemeMetric1D<float> TORNADO_POSITION_SCALE_TO_LOW("ArrowEffects", TPSTL_NAME, 3);
|
||||
static RString TPSTH_NAME(std::size_t i) { return ssprintf("Tornado%cPositionScaleToHigh", dimension_names[i]); }
|
||||
static RString TPSTH_NAME(size_t i) { return ssprintf("Tornado%cPositionScaleToHigh", dimension_names[i]); }
|
||||
static ThemeMetric1D<float> TORNADO_POSITION_SCALE_TO_HIGH("ArrowEffects", TPSTH_NAME, 3);
|
||||
static RString TOF_NAME(std::size_t i) { return ssprintf("Tornado%cOffsetFrequency", dimension_names[i]); }
|
||||
static RString TOF_NAME(size_t i) { return ssprintf("Tornado%cOffsetFrequency", dimension_names[i]); }
|
||||
static ThemeMetric1D<float> TORNADO_OFFSET_FREQUENCY("ArrowEffects", TOF_NAME, 3);
|
||||
static RString TOSFL_NAME(std::size_t i) { return ssprintf("Tornado%cOffsetScaleFromLow", dimension_names[i]); }
|
||||
static RString TOSFL_NAME(size_t i) { return ssprintf("Tornado%cOffsetScaleFromLow", dimension_names[i]); }
|
||||
static ThemeMetric1D<float> TORNADO_OFFSET_SCALE_FROM_LOW("ArrowEffects", TOSFL_NAME, 3);
|
||||
static RString TOSFH_NAME(std::size_t i) { return ssprintf("Tornado%cOffsetScaleFromHigh", dimension_names[i]); }
|
||||
static RString TOSFH_NAME(size_t i) { return ssprintf("Tornado%cOffsetScaleFromHigh", dimension_names[i]); }
|
||||
static ThemeMetric1D<float> TORNADO_OFFSET_SCALE_FROM_HIGH("ArrowEffects", TOSFH_NAME, 3);
|
||||
|
||||
static ThemeMetric<float> DRUNK_COLUMN_FREQUENCY( "ArrowEffects", "DrunkColumnFrequency" );
|
||||
|
||||
+3
-3
@@ -66,7 +66,7 @@ public:
|
||||
void SetMaxHeight( float fMaxHeight );
|
||||
void SetMaxDimUseZoom(bool use);
|
||||
void SetWrapWidthPixels( int iWrapWidthPixels );
|
||||
void CropLineToWidth(std::size_t l, int width);
|
||||
void CropLineToWidth(size_t l, int width);
|
||||
void CropToWidth(int width);
|
||||
|
||||
virtual bool EarlyAbortDraw() const override;
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
};
|
||||
|
||||
Attribute GetDefaultAttribute() const;
|
||||
void AddAttribute( std::size_t iPos, const Attribute &attr );
|
||||
void AddAttribute( size_t iPos, const Attribute &attr );
|
||||
void ClearAttributes();
|
||||
|
||||
// Commands
|
||||
@@ -133,7 +133,7 @@ protected:
|
||||
std::vector<RageSpriteVertex> m_aVertices;
|
||||
|
||||
std::vector<FontPageTextures*> m_vpFontPageTextures;
|
||||
std::map<std::size_t, Attribute> m_mAttributes;
|
||||
std::map<size_t, Attribute> m_mAttributes;
|
||||
bool m_bHasGlowAttribute;
|
||||
|
||||
TextGlowMode m_TextGlowMode;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
ThemeMetric<float> METER_WIDTH ("CombinedLifeMeterTug","MeterWidth");
|
||||
|
||||
static void TugMeterPercentChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
static void TugMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
{
|
||||
sNameOut = "TugMeterPercentChange" + ScoreEventToString( (ScoreEvent)i );
|
||||
switch( i )
|
||||
|
||||
+2
-2
@@ -44,9 +44,9 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, std::v
|
||||
if( sSource.empty() )
|
||||
return;
|
||||
|
||||
std::size_t startpos = 0;
|
||||
size_t startpos = 0;
|
||||
do {
|
||||
std::size_t pos = startpos;
|
||||
size_t pos = startpos;
|
||||
while( pos < sSource.size() )
|
||||
{
|
||||
if( sSource[pos] == Delimitor )
|
||||
|
||||
+2
-2
@@ -790,7 +790,7 @@ void Course::GetTrailUnsortedEndless( const std::vector<CourseEntry> &entries, T
|
||||
ASSERT(e->iChooseIndex >= 0);
|
||||
// If we're trying to pick BEST100 when only 99 songs exist,
|
||||
// we have a problem, so bail out
|
||||
if (static_cast<std::size_t>(e->iChooseIndex) >= vpSongs.size()) {
|
||||
if (static_cast<size_t>(e->iChooseIndex) >= vpSongs.size()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1317,7 +1317,7 @@ public:
|
||||
DEFINE_METHOD( GetCourseType, GetCourseType() )
|
||||
static int GetCourseEntry(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t id= static_cast<std::size_t>(IArg(1));
|
||||
size_t id= static_cast<size_t>(IArg(1));
|
||||
if(id >= p->m_vEntries.size())
|
||||
{
|
||||
lua_pushnil(L);
|
||||
|
||||
+9
-9
@@ -146,7 +146,7 @@ typedef char TCHAR;
|
||||
typedef unsigned char uch; // unsigned 8-bit value
|
||||
typedef unsigned short ush; // unsigned 16-bit value
|
||||
typedef unsigned long ulg; // unsigned 32-bit value
|
||||
typedef std::size_t extent; // file size
|
||||
typedef size_t extent; // file size
|
||||
typedef unsigned Pos; // must be at least 32 bits
|
||||
typedef unsigned IPos; // A Pos is an index in the character window. Pos is used only for parameter passing
|
||||
|
||||
@@ -349,7 +349,7 @@ typedef struct iztimes {
|
||||
typedef struct zlist {
|
||||
ush vem, ver, flg, how; // See central header in zipfile.c for what vem..off are
|
||||
ulg tim, crc, siz, len;
|
||||
std::size_t nam, ext, cext, com; // offset of ext must be >= LOCHEAD
|
||||
size_t nam, ext, cext, com; // offset of ext must be >= LOCHEAD
|
||||
ush dsk, att, lflg; // offset of lflg must be >= LOCHEAD
|
||||
ulg atx, off;
|
||||
char name[MAX_PATH]; // File name in zip file
|
||||
@@ -402,12 +402,12 @@ int putlocal(struct zlist *z, WRITEFUNC wfunc,void *param)
|
||||
PUTLG(z->len, f);
|
||||
PUTSH(z->nam, f);
|
||||
PUTSH(z->ext, f);
|
||||
std::size_t res = (std::size_t)wfunc(param, z->iname, (unsigned int)z->nam);
|
||||
size_t res = (size_t)wfunc(param, z->iname, (unsigned int)z->nam);
|
||||
if (res!=z->nam)
|
||||
return ZE_TEMP;
|
||||
if (z->ext)
|
||||
{
|
||||
res = (std::size_t)wfunc(param, z->extra, (unsigned int)z->ext);
|
||||
res = (size_t)wfunc(param, z->extra, (unsigned int)z->ext);
|
||||
if (res!=z->ext)
|
||||
return ZE_TEMP;
|
||||
}
|
||||
@@ -443,15 +443,15 @@ int putcentral(struct zlist *z, WRITEFUNC wfunc, void *param)
|
||||
PUTSH(z->att, f);
|
||||
PUTLG(z->atx, f);
|
||||
PUTLG(z->off, f);
|
||||
if ((std::size_t)wfunc(param, z->iname, (unsigned int)z->nam) != z->nam ||
|
||||
(z->cext && (std::size_t)wfunc(param, z->cextra, (unsigned int)z->cext) != z->cext) ||
|
||||
(z->com && (std::size_t)wfunc(param, z->comment, (unsigned int)z->com) != z->com))
|
||||
if ((size_t)wfunc(param, z->iname, (unsigned int)z->nam) != z->nam ||
|
||||
(z->cext && (size_t)wfunc(param, z->cextra, (unsigned int)z->cext) != z->cext) ||
|
||||
(z->com && (size_t)wfunc(param, z->comment, (unsigned int)z->com) != z->com))
|
||||
return ZE_TEMP;
|
||||
return ZE_OK;
|
||||
}
|
||||
|
||||
|
||||
int putend(int n, ulg s, ulg c, std::size_t m, char *z, WRITEFUNC wfunc, void *param)
|
||||
int putend(int n, ulg s, ulg c, size_t m, char *z, WRITEFUNC wfunc, void *param)
|
||||
{
|
||||
// write the end of the central-directory-data to file *f.
|
||||
PUTLG(ENDSIG, f);
|
||||
@@ -532,7 +532,7 @@ const ulg crc_table[256] = {
|
||||
#define DO4(buf) DO2(buf); DO2(buf)
|
||||
#define DO8(buf) DO4(buf); DO4(buf)
|
||||
|
||||
ulg crc32(ulg crc, const uch *buf, std::size_t len)
|
||||
ulg crc32(ulg crc, const uch *buf, size_t len)
|
||||
{
|
||||
if (buf== nullptr) return 0L;
|
||||
crc = crc ^ 0xffffffffL;
|
||||
|
||||
+88
-88
@@ -31,29 +31,29 @@ struct SplineSolutionCache
|
||||
void solve_diagonals_straight(std::vector<float>& diagonals, std::vector<float>& multiples);
|
||||
void solve_diagonals_looped(std::vector<float>& diagonals, std::vector<float>& multiples);
|
||||
private:
|
||||
void prep_inner(std::size_t last, std::vector<float>& out);
|
||||
void prep_inner(size_t last, std::vector<float>& out);
|
||||
bool find_in_cache(std::list<Entry>& cache, std::vector<float>& outd, std::vector<float>& outm);
|
||||
void add_to_cache(std::list<Entry>& cache, std::vector<float>& outd, std::vector<float>& outm);
|
||||
std::list<Entry> straight_diagonals;
|
||||
std::list<Entry> looped_diagonals;
|
||||
};
|
||||
|
||||
const std::size_t solution_cache_limit= 16;
|
||||
const size_t solution_cache_limit= 16;
|
||||
|
||||
bool SplineSolutionCache::find_in_cache(std::list<Entry>& cache, std::vector<float>& outd, std::vector<float>& outm)
|
||||
{
|
||||
std::size_t out_size= outd.size();
|
||||
size_t out_size= outd.size();
|
||||
for(std::list<Entry>::iterator entry= cache.begin();
|
||||
entry != cache.end(); ++entry)
|
||||
{
|
||||
if(out_size == entry->diagonals.size())
|
||||
{
|
||||
for(std::size_t i= 0; i < out_size; ++i)
|
||||
for(size_t i= 0; i < out_size; ++i)
|
||||
{
|
||||
outd[i]= entry->diagonals[i];
|
||||
}
|
||||
outm.resize(entry->multiples.size());
|
||||
for(std::size_t i= 0; i < entry->multiples.size(); ++i)
|
||||
for(size_t i= 0; i < entry->multiples.size(); ++i)
|
||||
{
|
||||
outm[i]= entry->multiples[i];
|
||||
}
|
||||
@@ -74,9 +74,9 @@ void SplineSolutionCache::add_to_cache(std::list<Entry>& cache, std::vector<floa
|
||||
cache.front().multiples= outm;
|
||||
}
|
||||
|
||||
void SplineSolutionCache::prep_inner(std::size_t last, std::vector<float>& out)
|
||||
void SplineSolutionCache::prep_inner(size_t last, std::vector<float>& out)
|
||||
{
|
||||
for(std::size_t i= 1; i < last; ++i)
|
||||
for(size_t i= 1; i < last; ++i)
|
||||
{
|
||||
out[i]= 4.0f;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ void SplineSolutionCache::solve_diagonals_straight(std::vector<float>& diagonals
|
||||
// | 0 0 b 0 | -> | 0 0 b 0 | -> | 0 0 b 0 |
|
||||
// | 0 0 0 c | -> | 0 0 0 c | -> | 0 0 0 c |
|
||||
|
||||
std::size_t last= diagonals.size();
|
||||
size_t last= diagonals.size();
|
||||
diagonals[0]= 2.0f;
|
||||
prep_inner(last-1, diagonals);
|
||||
diagonals[last-1]= 2.0f;
|
||||
@@ -111,7 +111,7 @@ void SplineSolutionCache::solve_diagonals_straight(std::vector<float>& diagonals
|
||||
// Operation: Add row[0] * -.5 to row[1] to zero [r1][c0].
|
||||
diagonals[1]-= .5f;
|
||||
multiples.push_back(.5f);
|
||||
for(std::size_t i= 1; i < last-1; ++i)
|
||||
for(size_t i= 1; i < last-1; ++i)
|
||||
{
|
||||
// Operation: Add row[i] / -[ri][ci] to row[i+1] to zero [ri+1][ci].
|
||||
const float diag_recip= 1.0f / diagonals[i];
|
||||
@@ -119,7 +119,7 @@ void SplineSolutionCache::solve_diagonals_straight(std::vector<float>& diagonals
|
||||
multiples.push_back(diag_recip);
|
||||
}
|
||||
// Stage two.
|
||||
for(std::size_t i= last-1; i > 0; --i)
|
||||
for(size_t i= last-1; i > 0; --i)
|
||||
{
|
||||
// Operation: Add row [i] / -[ri][ci] to row[i-1] to zero [ri-1][ci].
|
||||
multiples.push_back(1.0f / diagonals[i]);
|
||||
@@ -164,7 +164,7 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector<float>& diagonals,
|
||||
// | 0 0 0 c w | -> | 0 0 0 c w | -> | 0 0 0 c w | -> | 0 0 0 c 0 |
|
||||
// | 0 0 0 0 f | -> | 0 0 0 0 f | -> | 0 0 0 0 f | -> | 0 0 0 0 f |
|
||||
|
||||
std::size_t last= diagonals.size();
|
||||
size_t last= diagonals.size();
|
||||
diagonals[0]= 4.0f;
|
||||
prep_inner(last, diagonals);
|
||||
// right_column is sized to not store the diagonal .
|
||||
@@ -173,7 +173,7 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector<float>& diagonals,
|
||||
right_column[last-2]= 1.0f;
|
||||
|
||||
// Stage one.
|
||||
for(std::size_t i= 0; i < last-2; ++i)
|
||||
for(size_t i= 0; i < last-2; ++i)
|
||||
{
|
||||
// Operation: Add row[i] / -[ri][ci] to row[i+1] to zero [ri+1][ci].
|
||||
const float diag_recip= 1.0f / diagonals[i];
|
||||
@@ -189,7 +189,7 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector<float>& diagonals,
|
||||
multiples.push_back(diag_recip);
|
||||
}
|
||||
// Stage two.
|
||||
for(std::size_t i= last-2; i > 0; --i)
|
||||
for(size_t i= last-2; i > 0; --i)
|
||||
{
|
||||
// Operation: Add row[i] / -[ri][ci] to row[i-1] to zero [ri-1][ci].
|
||||
const float diag_recip= 1.0f / diagonals[i];
|
||||
@@ -204,8 +204,8 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector<float>& diagonals,
|
||||
multiples.push_back(diag_recip);
|
||||
}
|
||||
// Stage three.
|
||||
const std::size_t end= last-1;
|
||||
for(std::size_t i= 0; i < end; ++i)
|
||||
const size_t end= last-1;
|
||||
for(size_t i= 0; i < end; ++i)
|
||||
{
|
||||
// Operation: Add row[e] * (right_column[i] / [re][ce]) to row[i] to
|
||||
// zero right_column[i].
|
||||
@@ -255,7 +255,7 @@ float loop_space_difference(float a, float b, float spatial_extent)
|
||||
void CubicSpline::solve_looped()
|
||||
{
|
||||
if(check_minimum_size()) { return; }
|
||||
std::size_t last= m_points.size();
|
||||
size_t last= m_points.size();
|
||||
std::vector<float> results(m_points.size());
|
||||
std::vector<float> diagonals(m_points.size());
|
||||
std::vector<float> multiples;
|
||||
@@ -272,14 +272,14 @@ void CubicSpline::solve_looped()
|
||||
// SplineSolutionCache's Stage one loop ends at last-2 because it has to
|
||||
// handle right_column. This does not handle right_column, so the loop
|
||||
// goes to last-1.
|
||||
for(std::size_t i= 0; i < last-1; ++i)
|
||||
for(size_t i= 0; i < last-1; ++i)
|
||||
{
|
||||
// Operation: Add row[i] * -multiples[i] to row[i+1].
|
||||
results[i+1]-= results[i] * multiples[i];
|
||||
}
|
||||
std::size_t next_mult= last-1;
|
||||
size_t next_mult= last-1;
|
||||
// Stage two.
|
||||
for(std::size_t i= last-2; i > 0; --i)
|
||||
for(size_t i= last-2; i > 0; --i)
|
||||
{
|
||||
// Operation: Add row[i] * -multiples[nm] to row[i-1].
|
||||
results[i-1]-= results[i] * multiples[next_mult];
|
||||
@@ -290,8 +290,8 @@ void CubicSpline::solve_looped()
|
||||
results[last-1]-= results[0] * multiples[next_mult];
|
||||
++next_mult;
|
||||
// Stage three.
|
||||
const std::size_t end= last-1;
|
||||
for(std::size_t i= 0; i < end; ++i)
|
||||
const size_t end= last-1;
|
||||
for(size_t i= 0; i < end; ++i)
|
||||
{
|
||||
// Operation: Add row[e] * -multiples[nm] to row[i].
|
||||
results[i]-= results[end] * multiples[next_mult];
|
||||
@@ -304,7 +304,7 @@ void CubicSpline::solve_looped()
|
||||
void CubicSpline::solve_straight()
|
||||
{
|
||||
if(check_minimum_size()) { return; }
|
||||
std::size_t last= m_points.size();
|
||||
size_t last= m_points.size();
|
||||
std::vector<float> results(m_points.size());
|
||||
std::vector<float> diagonals(m_points.size());
|
||||
std::vector<float> multiples;
|
||||
@@ -317,14 +317,14 @@ void CubicSpline::solve_straight()
|
||||
// Steps explained in detail in SplineSolutionCache.
|
||||
// Only the operations on the results column are performed here.
|
||||
// Stage one.
|
||||
for(std::size_t i= 0; i < last-1; ++i)
|
||||
for(size_t i= 0; i < last-1; ++i)
|
||||
{
|
||||
// Operation: Add row[i] * -multiples[i] to row[i+1].
|
||||
results[i+1]-= results[i] * multiples[i];
|
||||
}
|
||||
std::size_t next_mult= last-1;
|
||||
size_t next_mult= last-1;
|
||||
// Stage two.
|
||||
for(std::size_t i= last-1; i > 0; --i)
|
||||
for(size_t i= last-1; i > 0; --i)
|
||||
{
|
||||
// Operation: Add row[i] * -multiples[nm] to row [i-1].
|
||||
results[i-1]-= results[i] * multiples[next_mult];
|
||||
@@ -337,8 +337,8 @@ void CubicSpline::solve_straight()
|
||||
void CubicSpline::solve_polygonal()
|
||||
{
|
||||
if(check_minimum_size()) { return; }
|
||||
std::size_t last= m_points.size() - 1;
|
||||
for(std::size_t i= 0; i < last; ++i)
|
||||
size_t last= m_points.size() - 1;
|
||||
for(size_t i= 0; i < last; ++i)
|
||||
{
|
||||
m_points[i].b= loop_space_difference(
|
||||
m_points[i+1].a, m_points[i].a, m_spatial_extent);
|
||||
@@ -349,7 +349,7 @@ void CubicSpline::solve_polygonal()
|
||||
|
||||
bool CubicSpline::check_minimum_size()
|
||||
{
|
||||
std::size_t last= m_points.size();
|
||||
size_t last= m_points.size();
|
||||
if(last < 2)
|
||||
{
|
||||
m_points[0].b= m_points[0].c= m_points[0].d= 0.0f;
|
||||
@@ -368,7 +368,7 @@ bool CubicSpline::check_minimum_size()
|
||||
}
|
||||
float a= m_points[0].a;
|
||||
bool all_points_identical= true;
|
||||
for(std::size_t i= 0; i < m_points.size(); ++i)
|
||||
for(size_t i= 0; i < m_points.size(); ++i)
|
||||
{
|
||||
m_points[i].b= m_points[i].c= m_points[i].d= 0.0f;
|
||||
if(m_points[i].a != a) { all_points_identical= false; }
|
||||
@@ -376,27 +376,27 @@ bool CubicSpline::check_minimum_size()
|
||||
return all_points_identical;
|
||||
}
|
||||
|
||||
void CubicSpline::prep_inner(std::size_t last, std::vector<float>& results)
|
||||
void CubicSpline::prep_inner(size_t last, std::vector<float>& results)
|
||||
{
|
||||
for(std::size_t i= 1; i < last - 1; ++i)
|
||||
for(size_t i= 1; i < last - 1; ++i)
|
||||
{
|
||||
results[i]= 3 * loop_space_difference(
|
||||
m_points[i+1].a, m_points[i-1].a, m_spatial_extent);
|
||||
}
|
||||
}
|
||||
|
||||
void CubicSpline::set_results(std::size_t last, std::vector<float>& diagonals, std::vector<float>& results)
|
||||
void CubicSpline::set_results(size_t last, std::vector<float>& diagonals, std::vector<float>& results)
|
||||
{
|
||||
// No more operations left, everything not a diagonal should be zero now.
|
||||
for(std::size_t i= 0; i < last; ++i)
|
||||
for(size_t i= 0; i < last; ++i)
|
||||
{
|
||||
results[i]/= diagonals[i];
|
||||
}
|
||||
// Now we can go through and set the b, c, d values of each point.
|
||||
// b, c, d values of the last point are not set because they are unused.
|
||||
for(std::size_t i= 0; i < last; ++i)
|
||||
for(size_t i= 0; i < last; ++i)
|
||||
{
|
||||
std::size_t next= (i+1) % last;
|
||||
size_t next= (i+1) % last;
|
||||
float diff= loop_space_difference(
|
||||
m_points[next].a, m_points[i].a, m_spatial_extent);
|
||||
m_points[i].b= results[i];
|
||||
@@ -411,14 +411,14 @@ void CubicSpline::set_results(std::size_t last, std::vector<float>& diagonals, s
|
||||
// Solving is now complete.
|
||||
}
|
||||
|
||||
void CubicSpline::p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float& tfrac) const
|
||||
void CubicSpline::p_and_tfrac_from_t(float t, bool loop, size_t& p, float& tfrac) const
|
||||
{
|
||||
if(loop)
|
||||
{
|
||||
float max_t= static_cast<float>(m_points.size());
|
||||
t= std::fmod(t, max_t);
|
||||
if(t < 0.0f) { t+= max_t; }
|
||||
p= static_cast<std::size_t>(t);
|
||||
p= static_cast<size_t>(t);
|
||||
tfrac= t - static_cast<float>(p);
|
||||
}
|
||||
else
|
||||
@@ -429,14 +429,14 @@ void CubicSpline::p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float&
|
||||
p= 0;
|
||||
tfrac= 0;
|
||||
}
|
||||
else if(static_cast<std::size_t>(flort) >= m_points.size() - 1)
|
||||
else if(static_cast<size_t>(flort) >= m_points.size() - 1)
|
||||
{
|
||||
p= m_points.size() - 1;
|
||||
tfrac= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
p= static_cast<std::size_t>(flort);
|
||||
p= static_cast<size_t>(flort);
|
||||
tfrac= t - static_cast<float>(p);
|
||||
}
|
||||
}
|
||||
@@ -444,7 +444,7 @@ void CubicSpline::p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float&
|
||||
|
||||
#define RETURN_IF_EMPTY if(m_points.empty()) { return 0.0f; }
|
||||
#define DECLARE_P_AND_TFRAC \
|
||||
std::size_t p= 0; float tfrac= 0.0f; \
|
||||
size_t p= 0; float tfrac= 0.0f; \
|
||||
p_and_tfrac_from_t(t, loop, p, tfrac);
|
||||
|
||||
float CubicSpline::evaluate(float t, bool loop) const
|
||||
@@ -483,13 +483,13 @@ float CubicSpline::evaluate_third_derivative(float t, bool loop) const
|
||||
#undef RETURN_IF_EMPTY
|
||||
#undef DECLARE_P_AND_TFRAC
|
||||
|
||||
void CubicSpline::set_point(std::size_t i, float v)
|
||||
void CubicSpline::set_point(size_t i, float v)
|
||||
{
|
||||
ASSERT_M(i < m_points.size(), "CubicSpline::set_point requires the index to be less than the number of points.");
|
||||
m_points[i].a= v;
|
||||
}
|
||||
|
||||
void CubicSpline::set_coefficients(std::size_t i, float b, float c, float d)
|
||||
void CubicSpline::set_coefficients(size_t i, float b, float c, float d)
|
||||
{
|
||||
ASSERT_M(i < m_points.size(), "CubicSpline: point index must be less than the number of points.");
|
||||
m_points[i].b= b;
|
||||
@@ -497,7 +497,7 @@ void CubicSpline::set_coefficients(std::size_t i, float b, float c, float d)
|
||||
m_points[i].d= d;
|
||||
}
|
||||
|
||||
void CubicSpline::get_coefficients(std::size_t i, float& b, float& c, float& d) const
|
||||
void CubicSpline::get_coefficients(size_t i, float& b, float& c, float& d) const
|
||||
{
|
||||
ASSERT_M(i < m_points.size(), "CubicSpline: point index must be less than the number of points.");
|
||||
b= m_points[i].b;
|
||||
@@ -505,26 +505,26 @@ void CubicSpline::get_coefficients(std::size_t i, float& b, float& c, float& d)
|
||||
d= m_points[i].d;
|
||||
}
|
||||
|
||||
void CubicSpline::set_point_and_coefficients(std::size_t i, float a, float b,
|
||||
void CubicSpline::set_point_and_coefficients(size_t i, float a, float b,
|
||||
float c, float d)
|
||||
{
|
||||
set_coefficients(i, b, c, d);
|
||||
m_points[i].a= a;
|
||||
}
|
||||
|
||||
void CubicSpline::get_point_and_coefficients(std::size_t i, float& a, float& b,
|
||||
void CubicSpline::get_point_and_coefficients(size_t i, float& a, float& b,
|
||||
float& c, float& d) const
|
||||
{
|
||||
get_coefficients(i, b, c, d);
|
||||
a= m_points[i].a;
|
||||
}
|
||||
|
||||
void CubicSpline::resize(std::size_t s)
|
||||
void CubicSpline::resize(size_t s)
|
||||
{
|
||||
m_points.resize(s);
|
||||
}
|
||||
|
||||
std::size_t CubicSpline::size() const
|
||||
size_t CubicSpline::size() const
|
||||
{
|
||||
return m_points.size();
|
||||
}
|
||||
@@ -555,27 +555,27 @@ void CubicSplineN::weighted_average(CubicSplineN& out,
|
||||
// Behavior for splines of different sizes: Use a size between the two.
|
||||
// Points that exist in both will be averaged.
|
||||
// Points that only exist in one will come only from that one.
|
||||
const std::size_t from_size= from.size();
|
||||
const std::size_t to_size= to.size();
|
||||
std::size_t out_size= to_size;
|
||||
std::size_t limit= to_size;
|
||||
const size_t from_size= from.size();
|
||||
const size_t to_size= to.size();
|
||||
size_t out_size= to_size;
|
||||
size_t limit= to_size;
|
||||
if(from_size < to_size)
|
||||
{
|
||||
out_size= from_size + static_cast<std::size_t>(
|
||||
out_size= from_size + static_cast<size_t>(
|
||||
static_cast<float>(to_size - from_size) * between);
|
||||
}
|
||||
else if(to_size < from_size)
|
||||
{
|
||||
limit= from_size;
|
||||
out_size= to_size + static_cast<std::size_t>(
|
||||
out_size= to_size + static_cast<size_t>(
|
||||
static_cast<float>(from_size - to_size) * between);
|
||||
}
|
||||
CLAMP(out_size, 0, limit);
|
||||
out.resize(out_size);
|
||||
|
||||
for(std::size_t spli= 0; spli < out.m_splines.size(); ++spli)
|
||||
for(size_t spli= 0; spli < out.m_splines.size(); ++spli)
|
||||
{
|
||||
for(std::size_t p= 0; p < out_size; ++p)
|
||||
for(size_t p= 0; p < out_size; ++p)
|
||||
{
|
||||
float fc[4]= {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
float tc[4]= {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
@@ -683,42 +683,42 @@ CSN_EVAL_RV_SOMETHING(evaluate_derivative);
|
||||
|
||||
#undef CSN_EVAL_RV_SOMETHING
|
||||
|
||||
void CubicSplineN::set_point(std::size_t i, const std::vector<float>& v)
|
||||
void CubicSplineN::set_point(size_t i, const std::vector<float>& v)
|
||||
{
|
||||
ASSERT_M(v.size() == m_splines.size(), "CubicSplineN::set_point requires the passed point to be the same dimension as the spline.");
|
||||
for(std::size_t n= 0; n < m_splines.size(); ++n)
|
||||
for(size_t n= 0; n < m_splines.size(); ++n)
|
||||
{
|
||||
m_splines[n].set_point(i, v[n]);
|
||||
}
|
||||
m_dirty= true;
|
||||
}
|
||||
|
||||
void CubicSplineN::set_coefficients(std::size_t i, const std::vector<float>& b,
|
||||
void CubicSplineN::set_coefficients(size_t i, const std::vector<float>& b,
|
||||
const std::vector<float>& c, const std::vector<float>& d)
|
||||
{
|
||||
ASSERT_M(b.size() == c.size() && c.size() == d.size() &&
|
||||
d.size() == m_splines.size(), "CubicSplineN: coefficient vectors must be "
|
||||
"the same dimension as the spline.");
|
||||
for(std::size_t n= 0; n < m_splines.size(); ++n)
|
||||
for(size_t n= 0; n < m_splines.size(); ++n)
|
||||
{
|
||||
m_splines[n].set_coefficients(i, b[n], c[n], d[n]);
|
||||
}
|
||||
m_dirty= true;
|
||||
}
|
||||
|
||||
void CubicSplineN::get_coefficients(std::size_t i, std::vector<float>& b,
|
||||
void CubicSplineN::get_coefficients(size_t i, std::vector<float>& b,
|
||||
std::vector<float>& c, std::vector<float>& d)
|
||||
{
|
||||
ASSERT_M(b.size() == c.size() && c.size() == d.size() &&
|
||||
d.size() == m_splines.size(), "CubicSplineN: coefficient vectors must be "
|
||||
"the same dimension as the spline.");
|
||||
for(std::size_t n= 0; n < m_splines.size(); ++n)
|
||||
for(size_t n= 0; n < m_splines.size(); ++n)
|
||||
{
|
||||
m_splines[n].get_coefficients(i, b[n], c[n], d[n]);
|
||||
}
|
||||
}
|
||||
|
||||
void CubicSplineN::set_spatial_extent(std::size_t i, float extent)
|
||||
void CubicSplineN::set_spatial_extent(size_t i, float extent)
|
||||
{
|
||||
ASSERT_M(i < m_splines.size(), "CubicSplineN: index of spline to set extent"
|
||||
" of is out of range.");
|
||||
@@ -726,14 +726,14 @@ void CubicSplineN::set_spatial_extent(std::size_t i, float extent)
|
||||
m_dirty= true;
|
||||
}
|
||||
|
||||
float CubicSplineN::get_spatial_extent(std::size_t i)
|
||||
float CubicSplineN::get_spatial_extent(size_t i)
|
||||
{
|
||||
ASSERT_M(i < m_splines.size(), "CubicSplineN: index of spline to get extent"
|
||||
" of is out of range.");
|
||||
return m_splines[i].m_spatial_extent;
|
||||
}
|
||||
|
||||
void CubicSplineN::resize(std::size_t s)
|
||||
void CubicSplineN::resize(size_t s)
|
||||
{
|
||||
for(spline_cont_t::iterator spline= m_splines.begin();
|
||||
spline != m_splines.end(); ++spline)
|
||||
@@ -743,7 +743,7 @@ void CubicSplineN::resize(std::size_t s)
|
||||
m_dirty= true;
|
||||
}
|
||||
|
||||
std::size_t CubicSplineN::size() const
|
||||
size_t CubicSplineN::size() const
|
||||
{
|
||||
if(!m_splines.empty())
|
||||
{
|
||||
@@ -757,13 +757,13 @@ bool CubicSplineN::empty() const
|
||||
return m_splines.empty() || m_splines[0].empty();
|
||||
}
|
||||
|
||||
void CubicSplineN::redimension(std::size_t d)
|
||||
void CubicSplineN::redimension(size_t d)
|
||||
{
|
||||
m_splines.resize(d);
|
||||
m_dirty= true;
|
||||
}
|
||||
|
||||
std::size_t CubicSplineN::dimension() const
|
||||
size_t CubicSplineN::dimension() const
|
||||
{
|
||||
return m_splines.size();
|
||||
}
|
||||
@@ -791,18 +791,18 @@ SET_GET_MEM(m_dirty, dirty);
|
||||
|
||||
struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
{
|
||||
static std::size_t dimension_index(T* p, lua_State* L, int s)
|
||||
static size_t dimension_index(T* p, lua_State* L, int s)
|
||||
{
|
||||
std::size_t i= static_cast<std::size_t>(IArg(s)-1);
|
||||
size_t i= static_cast<size_t>(IArg(s)-1);
|
||||
if(i >= p->dimension())
|
||||
{
|
||||
luaL_error(L, "Spline dimension index out of range.");
|
||||
}
|
||||
return i;
|
||||
}
|
||||
static std::size_t point_index(T* p, lua_State* L, int s)
|
||||
static size_t point_index(T* p, lua_State* L, int s)
|
||||
{
|
||||
std::size_t i= static_cast<std::size_t>(IArg(s)-1);
|
||||
size_t i= static_cast<size_t>(IArg(s)-1);
|
||||
if(i >= p->size())
|
||||
{
|
||||
luaL_error(L, "Spline point index out of range.");
|
||||
@@ -820,7 +820,7 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
std::vector<float> pos; \
|
||||
p->something(FArg(1), pos); \
|
||||
lua_createtable(L, pos.size(), 0); \
|
||||
for(std::size_t i= 0; i < pos.size(); ++i) \
|
||||
for(size_t i= 0; i < pos.size(); ++i) \
|
||||
{ \
|
||||
lua_pushnumber(L, pos[i]); \
|
||||
lua_rawseti(L, -2, i+1); \
|
||||
@@ -834,13 +834,13 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
#undef LCSN_EVAL_SOMETHING
|
||||
|
||||
static void get_element_table_from_stack(T* p, lua_State* L, int s,
|
||||
std::size_t limit, std::vector<float>& ret)
|
||||
size_t limit, std::vector<float>& ret)
|
||||
{
|
||||
std::size_t elements= lua_objlen(L, s);
|
||||
size_t elements= lua_objlen(L, s);
|
||||
// Too many elements is not an error because allowing it allows the user
|
||||
// to reuse the same position data set after changing the dimension size.
|
||||
// The same is true for too few elements.
|
||||
for(std::size_t e= 0; e < elements; ++e)
|
||||
for(size_t e= 0; e < elements; ++e)
|
||||
{
|
||||
lua_rawgeti(L, s, e+1);
|
||||
ret.push_back(FArg(-1));
|
||||
@@ -851,7 +851,7 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
}
|
||||
ret.resize(limit);
|
||||
}
|
||||
static void set_point_from_stack(T* p, lua_State* L, std::size_t i, int s)
|
||||
static void set_point_from_stack(T* p, lua_State* L, size_t i, int s)
|
||||
{
|
||||
if(!lua_istable(L, s))
|
||||
{
|
||||
@@ -863,17 +863,17 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
}
|
||||
static int set_point(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t i= point_index(p, L, 1);
|
||||
size_t i= point_index(p, L, 1);
|
||||
set_point_from_stack(p, L, i, 2);
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static void set_coefficients_from_stack(T* p, lua_State* L, std::size_t i, int s)
|
||||
static void set_coefficients_from_stack(T* p, lua_State* L, size_t i, int s)
|
||||
{
|
||||
if(!lua_istable(L, s) || !lua_istable(L, s+1) || !lua_istable(L, s+2))
|
||||
{
|
||||
luaL_error(L, "Spline coefficient args must be three tables.");
|
||||
}
|
||||
std::size_t limit= p->dimension();
|
||||
size_t limit= p->dimension();
|
||||
std::vector<float> b; get_element_table_from_stack(p, L, s, limit, b);
|
||||
std::vector<float> c; get_element_table_from_stack(p, L, s+1, limit, c);
|
||||
std::vector<float> d; get_element_table_from_stack(p, L, s+2, limit, d);
|
||||
@@ -881,24 +881,24 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
}
|
||||
static int set_coefficients(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t i= point_index(p, L, 1);
|
||||
size_t i= point_index(p, L, 1);
|
||||
set_coefficients_from_stack(p, L, i, 2);
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static int get_coefficients(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t i= point_index(p, L, 1);
|
||||
std::size_t limit= p->dimension();
|
||||
size_t i= point_index(p, L, 1);
|
||||
size_t limit= p->dimension();
|
||||
std::vector<std::vector<float> > coeff(3);
|
||||
coeff[0].resize(limit);
|
||||
coeff[1].resize(limit);
|
||||
coeff[2].resize(limit);
|
||||
p->get_coefficients(i, coeff[0], coeff[1], coeff[2]);
|
||||
lua_createtable(L, 3, 0);
|
||||
for(std::size_t co= 0; co < coeff.size(); ++co)
|
||||
for(size_t co= 0; co < coeff.size(); ++co)
|
||||
{
|
||||
lua_createtable(L, limit, 0);
|
||||
for(std::size_t v= 0; v < limit; ++v)
|
||||
for(size_t v= 0; v < limit; ++v)
|
||||
{
|
||||
lua_pushnumber(L, coeff[co][v]);
|
||||
lua_rawseti(L, -2, v+1);
|
||||
@@ -909,13 +909,13 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
}
|
||||
static int set_spatial_extent(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t i= dimension_index(p, L, 1);
|
||||
size_t i= dimension_index(p, L, 1);
|
||||
p->set_spatial_extent(i, FArg(2));
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static int get_spatial_extent(T* p, lua_State* L)
|
||||
{
|
||||
std::size_t i= dimension_index(p, L, 1);
|
||||
size_t i= dimension_index(p, L, 1);
|
||||
lua_pushnumber(L, p->get_spatial_extent(i));
|
||||
return 1;
|
||||
}
|
||||
@@ -931,7 +931,7 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
{
|
||||
luaL_error(L, "A spline cannot have less than 0 points.");
|
||||
}
|
||||
p->resize(static_cast<std::size_t>(siz));
|
||||
p->resize(static_cast<size_t>(siz));
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static int get_size(T* p, lua_State* L)
|
||||
@@ -951,7 +951,7 @@ struct LunaCubicSplineN : Luna<CubicSplineN>
|
||||
{
|
||||
luaL_error(L, "A spline cannot have less than 0 dimensions.");
|
||||
}
|
||||
p->redimension(static_cast<std::size_t>(dim));
|
||||
p->redimension(static_cast<size_t>(dim));
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static int get_dimension(T* p, lua_State* L)
|
||||
|
||||
+19
-19
@@ -14,24 +14,24 @@ CubicSpline() :m_spatial_extent(0.0f) {}
|
||||
void solve_looped();
|
||||
void solve_straight();
|
||||
void solve_polygonal();
|
||||
void p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float& tfrac) const;
|
||||
void p_and_tfrac_from_t(float t, bool loop, size_t& p, float& tfrac) const;
|
||||
float evaluate(float t, bool loop) const;
|
||||
float evaluate_derivative(float t, bool loop) const;
|
||||
float evaluate_second_derivative(float t, bool loop) const;
|
||||
float evaluate_third_derivative(float t, bool loop) const;
|
||||
void set_point(std::size_t i, float v);
|
||||
void set_coefficients(std::size_t i, float b, float c, float d);
|
||||
void get_coefficients(std::size_t i, float& b, float& c, float& d) const;
|
||||
void set_point_and_coefficients(std::size_t i, float a, float b, float c, float d);
|
||||
void get_point_and_coefficients(std::size_t i, float& a, float& b, float& c, float& d) const;
|
||||
void resize(std::size_t s);
|
||||
std::size_t size() const;
|
||||
void set_point(size_t i, float v);
|
||||
void set_coefficients(size_t i, float b, float c, float d);
|
||||
void get_coefficients(size_t i, float& b, float& c, float& d) const;
|
||||
void set_point_and_coefficients(size_t i, float a, float b, float c, float d);
|
||||
void get_point_and_coefficients(size_t i, float& a, float& b, float& c, float& d) const;
|
||||
void resize(size_t s);
|
||||
size_t size() const;
|
||||
bool empty() const;
|
||||
float m_spatial_extent;
|
||||
private:
|
||||
bool check_minimum_size();
|
||||
void prep_inner(std::size_t last, std::vector<float>& results);
|
||||
void set_results(std::size_t last, std::vector<float>& diagonals, std::vector<float>& results);
|
||||
void prep_inner(size_t last, std::vector<float>& results);
|
||||
void set_results(size_t last, std::vector<float>& diagonals, std::vector<float>& results);
|
||||
|
||||
struct SplinePoint
|
||||
{
|
||||
@@ -54,17 +54,17 @@ struct CubicSplineN
|
||||
void evaluate_third_derivative(float t, std::vector<float>& v) const;
|
||||
void evaluate(float t, RageVector3& v) const;
|
||||
void evaluate_derivative(float t, RageVector3& v) const;
|
||||
void set_point(std::size_t i, const std::vector<float>& v);
|
||||
void set_coefficients(std::size_t i, const std::vector<float>& b,
|
||||
void set_point(size_t i, const std::vector<float>& v);
|
||||
void set_coefficients(size_t i, const std::vector<float>& b,
|
||||
const std::vector<float>& c, const std::vector<float>& d);
|
||||
void get_coefficients(std::size_t i, std::vector<float>& b,
|
||||
void get_coefficients(size_t i, std::vector<float>& b,
|
||||
std::vector<float>& c, std::vector<float>& d);
|
||||
void set_spatial_extent(std::size_t i, float extent);
|
||||
float get_spatial_extent(std::size_t i);
|
||||
void resize(std::size_t s);
|
||||
std::size_t size() const;
|
||||
void redimension(std::size_t d);
|
||||
std::size_t dimension() const;
|
||||
void set_spatial_extent(size_t i, float extent);
|
||||
float get_spatial_extent(size_t i);
|
||||
void resize(size_t s);
|
||||
size_t size() const;
|
||||
void redimension(size_t d);
|
||||
size_t dimension() const;
|
||||
bool empty() const;
|
||||
float get_max_t() const {
|
||||
if(m_loop) { return static_cast<float>(size()); }
|
||||
|
||||
@@ -216,13 +216,13 @@ void StepsDisplayList::UpdatePositions()
|
||||
|
||||
void StepsDisplayList::PositionItems()
|
||||
{
|
||||
for( std::size_t i = 0; i < MAX_METERS; ++i )
|
||||
for( size_t i = 0; i < MAX_METERS; ++i )
|
||||
{
|
||||
bool bUnused = ( i >= m_Rows.size() );
|
||||
m_Lines[i].m_Meter.SetVisible( !bUnused );
|
||||
}
|
||||
|
||||
for( std::size_t m = 0; m < m_Rows.size(); ++m )
|
||||
for( size_t m = 0; m < m_Rows.size(); ++m )
|
||||
{
|
||||
Row &row = m_Rows[m];
|
||||
bool bHidden = row.m_bHidden;
|
||||
@@ -240,7 +240,7 @@ void StepsDisplayList::PositionItems()
|
||||
m_Lines[m].m_Meter.SetY( row.m_fY );
|
||||
}
|
||||
|
||||
for( std::size_t m=0; m < MAX_METERS; ++m )
|
||||
for( size_t m=0; m < MAX_METERS; ++m )
|
||||
{
|
||||
bool bHidden = true;
|
||||
if( m_bShown && m < m_Rows.size() )
|
||||
@@ -306,7 +306,7 @@ void StepsDisplayList::SetFromGameState()
|
||||
UpdatePositions();
|
||||
PositionItems();
|
||||
|
||||
for( std::size_t m = 0; m < MAX_METERS; ++m )
|
||||
for( size_t m = 0; m < MAX_METERS; ++m )
|
||||
m_Lines[m].m_Meter.FinishTweening();
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ void StepsDisplayList::TweenOnScreen()
|
||||
FOREACH_HumanPlayer( pn )
|
||||
ON_COMMAND( m_Cursors[pn] );
|
||||
|
||||
for( std::size_t m = 0; m < MAX_METERS; ++m )
|
||||
for( size_t m = 0; m < MAX_METERS; ++m )
|
||||
ON_COMMAND( m_Lines[m].m_Meter );
|
||||
|
||||
this->SetHibernate( 0.5f );
|
||||
|
||||
@@ -24,7 +24,7 @@ void DynamicActorScroller::LoadFromNode( const XNode *pNode )
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("%s: DynamicActorScroller: loaded %i nodes; require exactly one", ActorUtil::GetWhere(pNode).c_str(), (int)m_SubActors.size());
|
||||
// Remove all but one.
|
||||
for( std::size_t i=1; i<m_SubActors.size(); i++ )
|
||||
for( size_t i=1; i<m_SubActors.size(); i++ )
|
||||
{
|
||||
delete m_SubActors[i];
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ XToString( EditMenuAction );
|
||||
XToLocalizedString( EditMenuAction );
|
||||
StringToX( EditMenuAction );
|
||||
|
||||
static RString ARROWS_X_NAME( std::size_t i ) { return ssprintf("Arrows%dX",int(i+1)); }
|
||||
static RString ROW_Y_NAME( std::size_t i ) { return ssprintf("Row%dY",int(i+1)); }
|
||||
static RString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); }
|
||||
static RString ROW_Y_NAME( size_t i ) { return ssprintf("Row%dY",int(i+1)); }
|
||||
|
||||
void EditMenu::StripLockedStepsAndDifficulty( std::vector<StepsAndDifficulty> &v )
|
||||
{
|
||||
|
||||
+4
-4
@@ -259,7 +259,7 @@ int Font::GetLineHeightInSourcePixels( const std::wstring &szLine ) const
|
||||
}
|
||||
|
||||
// width is a pointer so that we can return the used width through it.
|
||||
std::size_t Font::GetGlyphsThatFit(const std::wstring& line, int* width) const
|
||||
size_t Font::GetGlyphsThatFit(const std::wstring& line, int* width) const
|
||||
{
|
||||
if(*width == 0)
|
||||
{
|
||||
@@ -267,7 +267,7 @@ std::size_t Font::GetGlyphsThatFit(const std::wstring& line, int* width) const
|
||||
return line.size();
|
||||
}
|
||||
int curr_width= 0;
|
||||
std::size_t i= 0;
|
||||
size_t i= 0;
|
||||
for(i= 0; i < line.size() && curr_width < *width; ++i)
|
||||
{
|
||||
curr_width+= GetGlyph(line[i]).m_iHadvance;
|
||||
@@ -441,11 +441,11 @@ void Font::GetFontPaths( const RString &sFontIniPath, std::vector<RString> &asTe
|
||||
|
||||
RString Font::GetPageNameFromFileName( const RString &sFilename )
|
||||
{
|
||||
std::size_t begin = sFilename.find_first_of( '[' );
|
||||
size_t begin = sFilename.find_first_of( '[' );
|
||||
if( begin == std::string::npos )
|
||||
return "main";
|
||||
|
||||
std::size_t end = sFilename.find_first_of( ']', begin );
|
||||
size_t end = sFilename.find_first_of( ']', begin );
|
||||
if( end == std::string::npos )
|
||||
return "main";
|
||||
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ public:
|
||||
|
||||
int GetLineWidthInSourcePixels( const std::wstring &szLine ) const;
|
||||
int GetLineHeightInSourcePixels( const std::wstring &szLine ) const;
|
||||
std::size_t GetGlyphsThatFit(const std::wstring& line, int* width) const;
|
||||
size_t GetGlyphsThatFit(const std::wstring& line, int* width) const;
|
||||
|
||||
bool FontCompleteForString( const std::wstring &str ) const;
|
||||
|
||||
|
||||
+2
-2
@@ -361,7 +361,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
}
|
||||
else
|
||||
{
|
||||
for(std::size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2)
|
||||
for(size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2)
|
||||
{
|
||||
m_SetEnv[cmd.m_vsArgs[i]]= cmd.m_vsArgs[i+1];
|
||||
}
|
||||
@@ -451,7 +451,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
}
|
||||
else
|
||||
{
|
||||
for(std::size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2)
|
||||
for(size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2)
|
||||
{
|
||||
if(IPreference::GetPreferenceByName(cmd.m_vsArgs[i]) == nullptr)
|
||||
{
|
||||
|
||||
+7
-7
@@ -3270,7 +3270,7 @@ void GameManager::GetStylesForGame( const Game *pGame, std::vector<const Style*>
|
||||
|
||||
const Game *GameManager::GetGameForStyle( const Style *pStyle )
|
||||
{
|
||||
for( std::size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
for( size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
{
|
||||
const Game *pGame = g_Games[g];
|
||||
for( int s=0; pGame->m_apStyles[s]; ++s )
|
||||
@@ -3284,7 +3284,7 @@ const Game *GameManager::GetGameForStyle( const Style *pStyle )
|
||||
|
||||
const Style* GameManager::GetEditorStyleForStepsType( StepsType st )
|
||||
{
|
||||
for( std::size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
for( size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
{
|
||||
const Game *pGame = g_Games[g];
|
||||
for( int s=0; pGame->m_apStyles[s]; ++s )
|
||||
@@ -3395,7 +3395,7 @@ const Style *GameManager::GetFirstCompatibleStyle( const Game *pGame, int iNumPl
|
||||
|
||||
void GameManager::GetEnabledGames( std::vector<const Game*>& aGamesOut )
|
||||
{
|
||||
for( std::size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
for( size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
{
|
||||
const Game *pGame = g_Games[g];
|
||||
if( IsGameEnabled( pGame ) )
|
||||
@@ -3408,7 +3408,7 @@ const Game* GameManager::GetDefaultGame()
|
||||
const Game *pDefault = nullptr;
|
||||
if( pDefault == nullptr )
|
||||
{
|
||||
for( std::size_t i=0; pDefault == nullptr && i < ARRAYLEN(g_Games); ++i )
|
||||
for( size_t i=0; pDefault == nullptr && i < ARRAYLEN(g_Games); ++i )
|
||||
{
|
||||
if( IsGameEnabled(g_Games[i]) )
|
||||
pDefault = g_Games[i];
|
||||
@@ -3423,7 +3423,7 @@ const Game* GameManager::GetDefaultGame()
|
||||
|
||||
int GameManager::GetIndexFromGame( const Game* pGame )
|
||||
{
|
||||
for( std::size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
for( size_t g=0; g<ARRAYLEN(g_Games); ++g )
|
||||
{
|
||||
if( g_Games[g] == pGame )
|
||||
return g;
|
||||
@@ -3472,7 +3472,7 @@ RString GameManager::StyleToLocalizedString( const Style* style )
|
||||
|
||||
const Game* GameManager::StringToGame( RString sGame )
|
||||
{
|
||||
for( std::size_t i=0; i<ARRAYLEN(g_Games); ++i )
|
||||
for( size_t i=0; i<ARRAYLEN(g_Games); ++i )
|
||||
if( !sGame.CompareNoCase(g_Games[i]->m_szName) )
|
||||
return g_Games[i];
|
||||
|
||||
@@ -3544,7 +3544,7 @@ public:
|
||||
std::vector<const Game*> aGames;
|
||||
p->GetEnabledGames( aGames );
|
||||
lua_createtable(L, aGames.size(), 0);
|
||||
for(std::size_t i= 0; i < aGames.size(); ++i)
|
||||
for(size_t i= 0; i < aGames.size(); ++i)
|
||||
{
|
||||
lua_pushstring(L, aGames[i]->m_szName);
|
||||
lua_rawseti(L, -2, i+1);
|
||||
|
||||
@@ -915,7 +915,7 @@ int LuaFunc_get_sound_driver_list(lua_State* L)
|
||||
{
|
||||
std::vector<RString> driver_names = RageSoundDriver::GetSoundDriverList();
|
||||
lua_createtable(L, driver_names.size(), 0);
|
||||
for(std::size_t n= 0; n < driver_names.size(); ++n)
|
||||
for(size_t n= 0; n < driver_names.size(); ++n)
|
||||
{
|
||||
lua_pushstring(L, driver_names[n].c_str());
|
||||
lua_rawseti(L, -2, n+1);
|
||||
|
||||
+3
-3
@@ -1484,7 +1484,7 @@ int GameState::prepare_song_for_gameplay()
|
||||
copy_exts.push_back("lrc");
|
||||
std::vector<RString> files_in_dir;
|
||||
FILEMAN->GetDirListingWithMultipleExtensions(from_dir, copy_exts, files_in_dir);
|
||||
for(std::size_t i= 0; i < files_in_dir.size(); ++i)
|
||||
for(size_t i= 0; i < files_in_dir.size(); ++i)
|
||||
{
|
||||
RString& fname= files_in_dir[i];
|
||||
if(!FileCopy(from_dir + fname, to_dir + fname))
|
||||
@@ -3336,7 +3336,7 @@ public:
|
||||
{
|
||||
int i= IArg(1) - 1;
|
||||
if(i < 0) { lua_pushnil(L); return 1; }
|
||||
std::size_t si= static_cast<std::size_t>(i);
|
||||
size_t si= static_cast<size_t>(i);
|
||||
if(si >= p->m_autogen_fargs.size()) { lua_pushnil(L); return 1; }
|
||||
lua_pushnumber(L, p->GetAutoGenFarg(si));
|
||||
return 1;
|
||||
@@ -3349,7 +3349,7 @@ public:
|
||||
luaL_error(L, "%i is not a valid autogen arg index.", i);
|
||||
}
|
||||
float v= FArg(2);
|
||||
std::size_t si= static_cast<std::size_t>(i);
|
||||
size_t si= static_cast<size_t>(i);
|
||||
while(si >= p->m_autogen_fargs.size())
|
||||
{
|
||||
p->m_autogen_fargs.push_back(0.0f);
|
||||
|
||||
+1
-1
@@ -417,7 +417,7 @@ public:
|
||||
|
||||
// Autogen stuff. This should probably be moved to its own singleton or
|
||||
// something when autogen is generalized and more customizable. -Kyz
|
||||
float GetAutoGenFarg(std::size_t i)
|
||||
float GetAutoGenFarg(size_t i)
|
||||
{
|
||||
if(i >= m_autogen_fargs.size()) { return 0.0f; }
|
||||
return m_autogen_fargs[i];
|
||||
|
||||
@@ -43,7 +43,7 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset
|
||||
void GhostArrowRow::SetColumnRenderers(std::vector<NoteColumnRenderer>& renderers)
|
||||
{
|
||||
ASSERT_M(renderers.size() == m_Ghost.size(), "Notefield has different number of columns than ghost row.");
|
||||
for(std::size_t c= 0; c < m_Ghost.size(); ++c)
|
||||
for(size_t c= 0; c < m_Ghost.size(); ++c)
|
||||
{
|
||||
m_Ghost[c]->SetFakeParent(&(renderers[c]));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void GradeDisplay::Load( RString sMetricsGroup )
|
||||
|
||||
void GradeDisplay::SetGrade( Grade grade )
|
||||
{
|
||||
std::size_t i = 0;
|
||||
size_t i = 0;
|
||||
FOREACH_PossibleGrade( g )
|
||||
{
|
||||
if(i >= m_vSpr.size())
|
||||
|
||||
+3
-3
@@ -547,7 +547,7 @@ public:
|
||||
static int GetHighestScoreOfName( T* p, lua_State *L )
|
||||
{
|
||||
RString name= SArg(1);
|
||||
for(std::size_t i= 0; i < p->vHighScores.size(); ++i)
|
||||
for(size_t i= 0; i < p->vHighScores.size(); ++i)
|
||||
{
|
||||
if(name == p->vHighScores[i].GetName())
|
||||
{
|
||||
@@ -562,8 +562,8 @@ public:
|
||||
static int GetRankOfName( T* p, lua_State *L )
|
||||
{
|
||||
RString name= SArg(1);
|
||||
std::size_t rank= 0;
|
||||
for(std::size_t i= 0; i < p->vHighScores.size(); ++i)
|
||||
size_t rank= 0;
|
||||
for(size_t i= 0; i < p->vHighScores.size(); ++i)
|
||||
{
|
||||
if(name == p->vHighScores[i].GetName())
|
||||
{
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ RageTextureID ImageCache::LoadCachedImage( RString sImageDir, RString sImagePath
|
||||
{
|
||||
RageTextureID ID( GetImageCachePath(sImageDir,sImagePath) );
|
||||
|
||||
std::size_t Found = sImagePath.find("_blank");
|
||||
size_t Found = sImagePath.find("_blank");
|
||||
if( sImagePath == "" || Found!=RString::npos )
|
||||
return ID;
|
||||
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ bool IniFile::ReadFile( RageFileBasic &f )
|
||||
if(keychild == nullptr)
|
||||
{ break; }
|
||||
// New value.
|
||||
std::size_t iEqualIndex = line.find("=");
|
||||
size_t iEqualIndex = line.find("=");
|
||||
if( iEqualIndex != std::string::npos )
|
||||
{
|
||||
RString valuename = line.Left((int) iEqualIndex);
|
||||
|
||||
+6
-6
@@ -987,7 +987,7 @@ bool InputMapper::IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const
|
||||
}
|
||||
std::vector<GameInput> GameI;
|
||||
MenuToGame( MenuI, pn, GameI );
|
||||
for( std::size_t i=0; i<GameI.size(); i++ )
|
||||
for( size_t i=0; i<GameI.size(); i++ )
|
||||
if( IsBeingPressed(GameI[i]) )
|
||||
return true;
|
||||
|
||||
@@ -997,7 +997,7 @@ bool InputMapper::IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const
|
||||
bool InputMapper::IsBeingPressed(const std::vector<GameInput>& GameI, MultiPlayer mp, const DeviceInputList *pButtonState ) const
|
||||
{
|
||||
bool pressed= false;
|
||||
for(std::size_t i= 0; i < GameI.size(); ++i)
|
||||
for(size_t i= 0; i < GameI.size(); ++i)
|
||||
{
|
||||
pressed |= IsBeingPressed(GameI[i], mp, pButtonState);
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ void InputMapper::RepeatStopKey( GameButton MenuI, PlayerNumber pn )
|
||||
}
|
||||
std::vector<GameInput> GameI;
|
||||
MenuToGame( MenuI, pn, GameI );
|
||||
for( std::size_t i=0; i<GameI.size(); i++ )
|
||||
for( size_t i=0; i<GameI.size(); i++ )
|
||||
RepeatStopKey( GameI[i] );
|
||||
}
|
||||
|
||||
@@ -1063,7 +1063,7 @@ float InputMapper::GetSecsHeld( GameButton MenuI, PlayerNumber pn ) const
|
||||
|
||||
std::vector<GameInput> GameI;
|
||||
MenuToGame( MenuI, pn, GameI );
|
||||
for( std::size_t i=0; i<GameI.size(); i++ )
|
||||
for( size_t i=0; i<GameI.size(); i++ )
|
||||
fMaxSecsHeld = std::max( fMaxSecsHeld, GetSecsHeld(GameI[i]) );
|
||||
|
||||
return fMaxSecsHeld;
|
||||
@@ -1091,7 +1091,7 @@ void InputMapper::ResetKeyRepeat( GameButton MenuI, PlayerNumber pn )
|
||||
}
|
||||
std::vector<GameInput> GameI;
|
||||
MenuToGame( MenuI, pn, GameI );
|
||||
for( std::size_t i=0; i<GameI.size(); i++ )
|
||||
for( size_t i=0; i<GameI.size(); i++ )
|
||||
ResetKeyRepeat( GameI[i] );
|
||||
}
|
||||
|
||||
@@ -1122,7 +1122,7 @@ float InputMapper::GetLevel( GameButton MenuI, PlayerNumber pn ) const
|
||||
MenuToGame( MenuI, pn, GameI );
|
||||
|
||||
float fLevel = 0;
|
||||
for( std::size_t i=0; i<GameI.size(); i++ )
|
||||
for( size_t i=0; i<GameI.size(); i++ )
|
||||
fLevel = std::max( fLevel, GetLevel(GameI[i]) );
|
||||
|
||||
return fLevel;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
static RString LIFE_PERCENT_CHANGE_NAME( std::size_t i ) { return "LifePercentChange" + ScoreEventToString( (ScoreEvent)i ); }
|
||||
static RString LIFE_PERCENT_CHANGE_NAME( size_t i ) { return "LifePercentChange" + ScoreEventToString( (ScoreEvent)i ); }
|
||||
|
||||
LifeMeterBar::LifeMeterBar()
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ static const float g_fTimeMeterSecondsChangeInit[] =
|
||||
};
|
||||
static_assert( ARRAYLEN(g_fTimeMeterSecondsChangeInit) == NUM_ScoreEvent );
|
||||
|
||||
static void TimeMeterSecondsChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
static void TimeMeterSecondsChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
{
|
||||
sNameOut = "TimeMeterSecondsChange" + ScoreEventToString( (ScoreEvent)i );
|
||||
defaultValueOut = g_fTimeMeterSecondsChangeInit[i];
|
||||
|
||||
@@ -87,7 +87,7 @@ static void GetUsedGameInputs( std::vector<GameInput> &vGameInputsOut )
|
||||
{
|
||||
std::vector<GameInput> gi;
|
||||
style->StyleInputToGameInput( iCol, pn, gi );
|
||||
for(std::size_t i= 0; i < gi.size(); ++i)
|
||||
for(size_t i= 0; i < gi.size(); ++i)
|
||||
{
|
||||
if(gi[i].IsValid())
|
||||
{
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ namespace LuaHelpers
|
||||
template<> bool FromStack<unsigned int>( Lua *L, unsigned int &Object, int iOffset ) { Object = lua_tointeger( L, iOffset ); return true; }
|
||||
template<> bool FromStack<RString>( Lua *L, RString &Object, int iOffset )
|
||||
{
|
||||
std::size_t iLen;
|
||||
size_t iLen;
|
||||
const char *pStr = lua_tolstring( L, iOffset, &iLen );
|
||||
if( pStr != nullptr )
|
||||
Object.assign( pStr, iLen );
|
||||
|
||||
@@ -18,25 +18,25 @@
|
||||
|
||||
MemoryCardManager* MEMCARDMAN = nullptr; // global and accessible from anywhere in our program
|
||||
|
||||
static void MemoryCardOsMountPointInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut )
|
||||
static void MemoryCardOsMountPointInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut )
|
||||
{
|
||||
sNameOut = ssprintf( "MemoryCardOsMountPointP%d", int(i+1) );
|
||||
defaultValueOut = "";
|
||||
}
|
||||
|
||||
static void MemoryCardUsbBusInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut )
|
||||
static void MemoryCardUsbBusInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut )
|
||||
{
|
||||
sNameOut = ssprintf( "MemoryCardUsbBusP%d", int(i+1) );
|
||||
defaultValueOut = -1;
|
||||
}
|
||||
|
||||
static void MemoryCardUsbPortInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut )
|
||||
static void MemoryCardUsbPortInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut )
|
||||
{
|
||||
sNameOut = ssprintf( "MemoryCardUsbPortP%d",int(i+1) );
|
||||
defaultValueOut = -1;
|
||||
}
|
||||
|
||||
static void MemoryCardUsbLevelInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut )
|
||||
static void MemoryCardUsbLevelInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut )
|
||||
{
|
||||
sNameOut = ssprintf( "MemoryCardUsbLevelP%d", int(i+1) );
|
||||
defaultValueOut = -1;
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
|
||||
RString WARNING_COMMAND_NAME( std::size_t i ) { return ssprintf("Warning%dCommand",int(i)); }
|
||||
RString WARNING_COMMAND_NAME( size_t i ) { return ssprintf("Warning%dCommand",int(i)); }
|
||||
|
||||
static const float TIMER_PAUSE_SECONDS = 99.99f;
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
RString WARNING_COMMAND_NAME( std::size_t i );
|
||||
RString WARNING_COMMAND_NAME( size_t i );
|
||||
|
||||
class MenuTimer : public ActorFrame
|
||||
{
|
||||
|
||||
+3
-3
@@ -605,7 +605,7 @@ void Model::AdvanceFrame( float fDeltaTime )
|
||||
|
||||
void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vector<myBone_t> &vpBones )
|
||||
{
|
||||
for( std::size_t i = 0; i < pAnimation->Bones.size(); ++i )
|
||||
for( size_t i = 0; i < pAnimation->Bones.size(); ++i )
|
||||
{
|
||||
const msBone *pBone = &pAnimation->Bones[i];
|
||||
if( pBone->PositionKeys.size() == 0 && pBone->RotationKeys.size() == 0 )
|
||||
@@ -616,7 +616,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vector<m
|
||||
|
||||
// search for the adjacent position keys
|
||||
const msPositionKey *pLastPositionKey = nullptr, *pThisPositionKey = nullptr;
|
||||
for( std::size_t j = 0; j < pBone->PositionKeys.size(); ++j )
|
||||
for( size_t j = 0; j < pBone->PositionKeys.size(); ++j )
|
||||
{
|
||||
const msPositionKey *pPositionKey = &pBone->PositionKeys[j];
|
||||
if( pPositionKey->fTime >= fFrame )
|
||||
@@ -640,7 +640,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vector<m
|
||||
|
||||
// search for the adjacent rotation keys
|
||||
const msRotationKey *pLastRotationKey = nullptr, *pThisRotationKey = nullptr;
|
||||
for( std::size_t j = 0; j < pBone->RotationKeys.size(); ++j )
|
||||
for( size_t j = 0; j < pBone->RotationKeys.size(); ++j )
|
||||
{
|
||||
const msRotationKey *pRotationKey = &pBone->RotationKeys[j];
|
||||
if( pRotationKey->fTime >= fFrame )
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename U, int n>
|
||||
inline void Assign_n( ModsLevel level, U (T::*member)[n], std::size_t index, const U &val )
|
||||
inline void Assign_n( ModsLevel level, U (T::*member)[n], size_t index, const U &val )
|
||||
{
|
||||
DEBUG_ASSERT( index < n );
|
||||
if( level != ModsLevel_Song )
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ static Preference<bool> g_bPrecacheAllSorts( "PreCacheAllWheelSorts", false);
|
||||
#define WHEEL_TEXT(s) THEME->GetString( "MusicWheel", ssprintf("%sText",s.c_str()) );
|
||||
#define CUSTOM_ITEM_WHEEL_TEXT(s) THEME->GetString( "MusicWheel", ssprintf("CustomItem%sText",s.c_str()) );
|
||||
|
||||
static RString SECTION_COLORS_NAME( std::size_t i ) { return ssprintf("SectionColor%d",int(i+1)); }
|
||||
static RString SECTION_COLORS_NAME( size_t i ) { return ssprintf("SectionColor%d",int(i+1)); }
|
||||
static RString CHOICE_NAME( RString s ) { return ssprintf("Choice%s",s.c_str()); }
|
||||
static RString CUSTOM_WHEEL_ITEM_NAME( RString s ) { return ssprintf("CustomWheelItem%s",s.c_str()); }
|
||||
static RString CUSTOM_WHEEL_ITEM_COLOR( RString s ) { return ssprintf("%sColor",s.c_str()); }
|
||||
@@ -458,7 +458,7 @@ void MusicWheel::GetSongList( std::vector<Song*> &arraySongs, SortOrder so )
|
||||
if(GAMESTATE->IsPlayerEnabled(pn))
|
||||
{
|
||||
Profile* prof= PROFILEMAN->GetProfile(pn);
|
||||
for(std::size_t i= 0; i < prof->m_songs.size(); ++i)
|
||||
for(size_t i= 0; i < prof->m_songs.size(); ++i)
|
||||
{
|
||||
apAllSongs.push_back(prof->m_songs[i]);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ bool NetworkManager::IsUrlAllowed(const std::string& url)
|
||||
// subdomain wildcards; ".domain" doesn't match "*.domain", but "a.domain" does
|
||||
if (allowedHost.substr(0, 2) == "*." && host.length() >= allowedHost.length())
|
||||
{
|
||||
std::size_t pos = host.length() - allowedHost.length() + 1;
|
||||
size_t pos = host.length() - allowedHost.length() + 1;
|
||||
if (host.substr(pos) == allowedHost.substr(1))
|
||||
return true;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ int WebSocketHandle::Send(lua_State *L)
|
||||
void *udata = luaL_checkudata(L, 1, "WebSocketHandle");
|
||||
auto handle = *static_cast<WebSocketHandlePtr*>(udata);
|
||||
|
||||
std::size_t len;
|
||||
size_t len;
|
||||
const char *s = luaL_checklstring(L, 2, &len);
|
||||
std::string data(s, len);
|
||||
|
||||
@@ -453,7 +453,7 @@ public:
|
||||
{
|
||||
if (lua_isstring(L, -1))
|
||||
{
|
||||
std::size_t len;
|
||||
size_t len;
|
||||
const char *s = lua_tolstring(L, -1, &len);
|
||||
args.body = std::string(s, len);
|
||||
}
|
||||
@@ -469,7 +469,7 @@ public:
|
||||
{
|
||||
if (lua_isstring(L, -1))
|
||||
{
|
||||
std::size_t len;
|
||||
size_t len;
|
||||
const char *s = lua_tolstring(L, -1, &len);
|
||||
args.multipartBoundary = std::string(s, len);
|
||||
}
|
||||
|
||||
+3
-3
@@ -1411,12 +1411,12 @@ template<typename ND, typename iter, typename TN>
|
||||
if(added)
|
||||
{
|
||||
int avg_row= 0;
|
||||
for(std::size_t p= 0; p < m_PrevCurrentRows.size(); ++p)
|
||||
for(size_t p= 0; p < m_PrevCurrentRows.size(); ++p)
|
||||
{
|
||||
avg_row+= m_PrevCurrentRows[p];
|
||||
}
|
||||
avg_row/= m_PrevCurrentRows.size();
|
||||
for(std::size_t a= 0; a < added_or_removed_tracks.size(); ++a)
|
||||
for(size_t a= 0; a < added_or_removed_tracks.size(); ++a)
|
||||
{
|
||||
int track_id= added_or_removed_tracks[a];
|
||||
m_PrevCurrentRows.insert(m_PrevCurrentRows.begin()+track_id, avg_row);
|
||||
@@ -1427,7 +1427,7 @@ template<typename ND, typename iter, typename TN>
|
||||
}
|
||||
else
|
||||
{
|
||||
for(std::size_t a= 0; a < added_or_removed_tracks.size(); ++a)
|
||||
for(size_t a= 0; a < added_or_removed_tracks.size(); ++a)
|
||||
{
|
||||
int track_id= added_or_removed_tracks[a];
|
||||
m_PrevCurrentRows.erase(m_PrevCurrentRows.begin()+track_id);
|
||||
|
||||
@@ -868,7 +868,7 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin
|
||||
}
|
||||
// prev_limb_panels keeps track of which panel in the track list the limb
|
||||
// hit last.
|
||||
std::vector<std::size_t> prev_limb_panels(num_kickbox_limbs, 0);
|
||||
std::vector<size_t> prev_limb_panels(num_kickbox_limbs, 0);
|
||||
std::vector<int> panel_repeat_counts(num_kickbox_limbs, 0);
|
||||
std::vector<int> panel_repeat_goals(num_kickbox_limbs, 0);
|
||||
RandomGen rnd(nonrandom_seed);
|
||||
@@ -965,7 +965,7 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin
|
||||
default:
|
||||
break;
|
||||
}
|
||||
std::size_t this_panel= prev_limb_panels[this_limb];
|
||||
size_t this_panel= prev_limb_panels[this_limb];
|
||||
if(panel_repeat_counts[this_limb] + 1 > panel_repeat_goals[this_limb])
|
||||
{
|
||||
// Use a different panel.
|
||||
@@ -1047,7 +1047,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds,
|
||||
float total_taps= 0;
|
||||
const float voltage_window_beats= 8.0f;
|
||||
const int voltage_window= BeatToNoteRow(voltage_window_beats);
|
||||
std::size_t max_notes_in_voltage_window= 0;
|
||||
size_t max_notes_in_voltage_window= 0;
|
||||
int num_chaos_rows= 0;
|
||||
crv_state state;
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds,
|
||||
state.num_notes_on_curr_row= 0;
|
||||
state.num_holds_on_curr_row= 0;
|
||||
state.judgable= timing->IsJudgableAtRow(curr_row);
|
||||
for(std::size_t n= 0; n < state.hold_ends.size(); ++n)
|
||||
for(size_t n= 0; n < state.hold_ends.size(); ++n)
|
||||
{
|
||||
if(state.hold_ends[n] < curr_row)
|
||||
{
|
||||
@@ -1068,7 +1068,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds,
|
||||
--n;
|
||||
}
|
||||
}
|
||||
for(std::size_t n= 0; n < recent_notes.size(); ++n)
|
||||
for(size_t n= 0; n < recent_notes.size(); ++n)
|
||||
{
|
||||
if(recent_notes[n].row < curr_row - voltage_window)
|
||||
{
|
||||
@@ -2115,7 +2115,7 @@ static void HyperShuffleNotes( NoteData &inout, int iStartIndex, int iEndIndex)
|
||||
std::shuffle(viTargetTracks.begin(), viTargetTracks.end(), g_RandomNumberGenerator);
|
||||
|
||||
// Go through the tracks in their shuffled order and drop tap notes.
|
||||
for(std::size_t i = 0; i < viTargetTracks.size(); i++)
|
||||
for(size_t i = 0; i < viTargetTracks.size(); i++)
|
||||
{
|
||||
const int targetTrack = viTargetTracks[i];
|
||||
const TapNote current_tn = vtnTargetTaps[i];
|
||||
|
||||
@@ -253,8 +253,8 @@ static void DoRowEndRadarActualCalc(garv_state& state, RadarValues& out)
|
||||
{
|
||||
if(state.worst_tns_on_row >= state.hands_tns)
|
||||
{
|
||||
std::size_t holds_down= 0;
|
||||
for(std::size_t n= 0; n < state.hold_ends.size(); ++n)
|
||||
size_t holds_down= 0;
|
||||
for(size_t n= 0; n < state.hold_ends.size(); ++n)
|
||||
{
|
||||
holds_down+= (state.curr_row <= state.hold_ends[n].last_held_row);
|
||||
}
|
||||
@@ -307,7 +307,7 @@ void NoteDataWithScoring::GetActualRadarValues(const NoteData &in,
|
||||
state.num_notes_on_curr_row= 0;
|
||||
state.num_holds_on_curr_row= 0;
|
||||
state.judgable= timing->IsJudgableAtRow(state.curr_row);
|
||||
for(std::size_t n= 0; n < state.hold_ends.size(); ++n)
|
||||
for(size_t n= 0; n < state.hold_ends.size(); ++n)
|
||||
{
|
||||
if(state.hold_ends[n].end_row < state.curr_row)
|
||||
{
|
||||
|
||||
+6
-6
@@ -37,7 +37,7 @@ static ThemeMetric<float> BAR_8TH_ALPHA( "NoteField", "Bar8thAlpha" );
|
||||
static ThemeMetric<float> BAR_16TH_ALPHA( "NoteField", "Bar16thAlpha" );
|
||||
static ThemeMetric<float> FADE_FAIL_TIME( "NoteField", "FadeFailTime" );
|
||||
|
||||
static RString RoutineNoteSkinName( std::size_t i ) { return ssprintf("RoutineNoteSkinP%i",int(i+1)); }
|
||||
static RString RoutineNoteSkinName( size_t i ) { return ssprintf("RoutineNoteSkinP%i",int(i+1)); }
|
||||
static ThemeMetric1D<RString> ROUTINE_NOTESKIN( "NoteField", RoutineNoteSkinName, NUM_PLAYERS );
|
||||
|
||||
NoteField::NoteField()
|
||||
@@ -314,7 +314,7 @@ void NoteField::InitColumnRenderers()
|
||||
m_FieldRenderArgs.ghost_row= &(m_pCurDisplay->m_GhostArrowRow);
|
||||
m_FieldRenderArgs.note_data= m_pNoteData;
|
||||
m_ColumnRenderers.resize(GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer);
|
||||
for(std::size_t ncr= 0; ncr < m_ColumnRenderers.size(); ++ncr)
|
||||
for(size_t ncr= 0; ncr < m_ColumnRenderers.size(); ++ncr)
|
||||
{
|
||||
FOREACH_EnabledPlayer(pn)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ void NoteField::Update( float fDeltaTime )
|
||||
ActorFrame::Update( fDeltaTime );
|
||||
ArrowEffects::SetCurrentOptions(&m_pPlayerState->m_PlayerOptions.GetCurrent());
|
||||
|
||||
for(std::size_t c= 0; c < m_ColumnRenderers.size(); ++c)
|
||||
for(size_t c= 0; c < m_ColumnRenderers.size(); ++c)
|
||||
{
|
||||
m_ColumnRenderers[c].Update(fDeltaTime);
|
||||
}
|
||||
@@ -826,7 +826,7 @@ void NoteField::DrawPrimitives()
|
||||
{
|
||||
const std::vector<TimingSegment *> &tSigs = *segs[SEGMENT_TIME_SIG];
|
||||
int iMeasureIndex = 0;
|
||||
for (std::size_t i = 0; i < tSigs.size(); i++)
|
||||
for (size_t i = 0; i < tSigs.size(); i++)
|
||||
{
|
||||
const TimeSignatureSegment *ts = ToTimeSignature(tSigs[i]);
|
||||
int iSegmentEndRow = (i + 1 == tSigs.size()) ? m_FieldRenderArgs.last_row : tSigs[i+1]->GetRow();
|
||||
@@ -882,7 +882,7 @@ void NoteField::DrawPrimitives()
|
||||
#define draw_all_segments(str_exp, name, caps_name) \
|
||||
horiz_align= caps_name##_IS_LEFT_SIDE ? align_right : align_left; \
|
||||
side_sign= caps_name##_IS_LEFT_SIDE ? -1 : 1; \
|
||||
for(std::size_t i= 0; i < segs[SEGMENT_##caps_name]->size(); ++i) \
|
||||
for(size_t i= 0; i < segs[SEGMENT_##caps_name]->size(); ++i) \
|
||||
{ \
|
||||
const name##Segment* seg= To##name((*segs[SEGMENT_##caps_name])[i]); \
|
||||
if(seg->GetRow() >= m_FieldRenderArgs.first_row && \
|
||||
@@ -1289,7 +1289,7 @@ public:
|
||||
static int get_column_actors(T* p, lua_State* L)
|
||||
{
|
||||
lua_createtable(L, p->m_ColumnRenderers.size(), 0);
|
||||
for(std::size_t i= 0; i < p->m_ColumnRenderers.size(); ++i)
|
||||
for(size_t i= 0; i < p->m_ColumnRenderers.size(); ++i)
|
||||
{
|
||||
p->m_ColumnRenderers[i].PushSelf(L);
|
||||
lua_rawseti(L, -2, i+1);
|
||||
|
||||
@@ -213,7 +213,7 @@ void NoteSkinManager::GetNoteSkinNames( const Game* pGame, std::vector<RString>
|
||||
|
||||
bool NoteSkinManager::NoteSkinNameInList(const RString name, std::vector<RString> name_list)
|
||||
{
|
||||
for(std::size_t i= 0; i < name_list.size(); ++i)
|
||||
for(size_t i= 0; i < name_list.size(); ++i)
|
||||
{
|
||||
if(0 == strcasecmp(name, name_list[i]))
|
||||
{
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ void NotesLoader::GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, R
|
||||
|
||||
for( unsigned i=0; i<ARRAYLEN(sLeftSeps); i++ )
|
||||
{
|
||||
std::size_t iBeginIndex = sFullTitle.find( sLeftSeps[i] );
|
||||
size_t iBeginIndex = sFullTitle.find( sLeftSeps[i] );
|
||||
if( iBeginIndex == std::string::npos )
|
||||
continue;
|
||||
sMainTitleOut = sFullTitle.Left( (int) iBeginIndex );
|
||||
|
||||
@@ -412,14 +412,14 @@ struct bmsCommandTree
|
||||
return;
|
||||
|
||||
// LTrim the statement to allow indentation
|
||||
std::size_t hash = statement.find('#');
|
||||
size_t hash = statement.find('#');
|
||||
|
||||
if (hash == RString::npos)
|
||||
return;
|
||||
|
||||
statement = statement.substr(hash);
|
||||
|
||||
std::size_t space = statement.find(' ');
|
||||
size_t space = statement.find(' ');
|
||||
RString name = statement.substr(0, space);
|
||||
RString value = "";
|
||||
|
||||
@@ -653,7 +653,7 @@ int BMSSong::AllocateKeysound( RString filename, RString path )
|
||||
if( !IsAFile(dir + normalizedFilename) )
|
||||
{
|
||||
std::vector<RString> const& exts= ActorUtil::GetTypeExtensionList(FT_Sound);
|
||||
for(std::size_t i = 0; i < exts.size(); ++i)
|
||||
for(size_t i = 0; i < exts.size(); ++i)
|
||||
{
|
||||
RString fn = SetExtension( normalizedFilename, exts[i] );
|
||||
if( IsAFile(dir + fn) )
|
||||
@@ -720,7 +720,7 @@ bool BMSSong::GetBackground( RString filename, RString path, RString &bgfile )
|
||||
std::vector<RString> exts;
|
||||
ActorUtil::AddTypeExtensionsToList(FT_Movie, exts);
|
||||
ActorUtil::AddTypeExtensionsToList(FT_Bitmap, exts);
|
||||
for(std::size_t i = 0; i < exts.size(); ++i)
|
||||
for(size_t i = 0; i < exts.size(); ++i)
|
||||
{
|
||||
RString fn = SetExtension( normalizedFilename, exts[i] );
|
||||
if( IsAFile(dir + fn) )
|
||||
|
||||
@@ -130,7 +130,7 @@ static void DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2O
|
||||
* @param pos the position of the step data.
|
||||
* @return true if it's a 192nd note, false otherwise.
|
||||
*/
|
||||
static bool Is192( const RString &sStepData, std::size_t pos )
|
||||
static bool Is192( const RString &sStepData, size_t pos )
|
||||
{
|
||||
while( pos < sStepData.size() )
|
||||
{
|
||||
@@ -254,7 +254,7 @@ static NoteData ParseNoteData(RString &step1, RString &step2,
|
||||
double fCurrentBeat = 0;
|
||||
double fCurrentIncrementer = 1.0/8 * BEATS_PER_MEASURE;
|
||||
|
||||
for( std::size_t i=0; i<sStepData.size(); )
|
||||
for( size_t i=0; i<sStepData.size(); )
|
||||
{
|
||||
char c = sStepData[i++];
|
||||
switch( c )
|
||||
@@ -732,14 +732,14 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, std::set<RString>
|
||||
* to pick up images used here as song images (eg. banners). */
|
||||
RString param = sParams[1];
|
||||
/* "{foo} ... {foo2}" */
|
||||
std::size_t pos = 0;
|
||||
size_t pos = 0;
|
||||
while( pos < RString::npos )
|
||||
{
|
||||
|
||||
std::size_t startpos = param.find('{', pos);
|
||||
size_t startpos = param.find('{', pos);
|
||||
if( startpos == RString::npos )
|
||||
break;
|
||||
std::size_t endpos = param.find('}', startpos);
|
||||
size_t endpos = param.find('}', startpos);
|
||||
if( endpos == RString::npos )
|
||||
break;
|
||||
|
||||
|
||||
@@ -1406,9 +1406,9 @@ void SMLoader::ParseBGChangesString(const RString& _sChanges, std::vector<std::v
|
||||
|
||||
// strip newlines (basically operates as both split and join at the same time)
|
||||
RString sChanges;
|
||||
std::size_t start = 0;
|
||||
size_t start = 0;
|
||||
do {
|
||||
std::size_t pos = _sChanges.find_first_of("\r\n", start);
|
||||
size_t pos = _sChanges.find_first_of("\r\n", start);
|
||||
if (RString::npos == pos)
|
||||
pos = _sChanges.size();
|
||||
|
||||
@@ -1447,7 +1447,7 @@ void SMLoader::ParseBGChangesString(const RString& _sChanges, std::vector<std::v
|
||||
// the string itself matches
|
||||
if (f.EqualsNoCase(sChanges.substr(start, f.size()).c_str()))
|
||||
{
|
||||
std::size_t nextpos = start + f.size();
|
||||
size_t nextpos = start + f.size();
|
||||
|
||||
// is this name followed by end-of-string, equals, or comma?
|
||||
if ((nextpos == sChanges.size()) || (sChanges[nextpos] == '=') || (sChanges[nextpos] == ','))
|
||||
@@ -1485,8 +1485,8 @@ void SMLoader::ParseBGChangesString(const RString& _sChanges, std::vector<std::v
|
||||
if(0 == pnum) vvsAddTo.push_back(std::vector<RString>()); // first value of this set. create our vector
|
||||
|
||||
{
|
||||
std::size_t eqpos = sChanges.find('=', start);
|
||||
std::size_t compos = sChanges.find(',', start);
|
||||
size_t eqpos = sChanges.find('=', start);
|
||||
size_t compos = sChanges.find(',', start);
|
||||
|
||||
if ((eqpos == RString::npos) && (compos == RString::npos))
|
||||
{
|
||||
|
||||
@@ -366,11 +366,11 @@ void SetRadarValues(StepsTagInfo& info)
|
||||
// Instead of trying to use the version to figure out how many
|
||||
// categories to expect, look at the number of values and split them
|
||||
// evenly. -Kyz
|
||||
std::size_t cats_per_player= values.size() / NUM_PlayerNumber;
|
||||
size_t cats_per_player= values.size() / NUM_PlayerNumber;
|
||||
RadarValues v[NUM_PLAYERS];
|
||||
FOREACH_PlayerNumber(pn)
|
||||
{
|
||||
for(std::size_t i= 0; i < cats_per_player; ++i)
|
||||
for(size_t i= 0; i < cats_per_player; ++i)
|
||||
{
|
||||
v[pn][i]= StringToFloat(values[pn * cats_per_player + i]);
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ RString OptionRow::GetThemedItemText( int iChoice ) const
|
||||
return s;
|
||||
}
|
||||
|
||||
RString ITEMS_LONG_ROW_X_NAME( std::size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); }
|
||||
RString MOD_ICON_X_NAME( std::size_t p ) { return ssprintf("ModIconP%dX",int(p+1)); }
|
||||
RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); }
|
||||
RString MOD_ICON_X_NAME( size_t p ) { return ssprintf("ModIconP%dX",int(p+1)); }
|
||||
|
||||
OptionRow::OptionRow( const OptionRowType *pSource )
|
||||
{
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ class OptionRowHandler;
|
||||
class GameCommand;
|
||||
struct OptionRowDefinition;
|
||||
|
||||
RString ITEMS_LONG_ROW_X_NAME( std::size_t p );
|
||||
RString MOD_ICON_X_NAME( std::size_t p );
|
||||
RString ITEMS_LONG_ROW_X_NAME( size_t p );
|
||||
RString MOD_ICON_X_NAME( size_t p );
|
||||
|
||||
class OptionRowType
|
||||
{
|
||||
|
||||
@@ -210,7 +210,7 @@ inline void VerifySelected(SelectType st, std::vector<bool> &selected, const RSt
|
||||
int num_selected = 0;
|
||||
if( st == SELECT_ONE )
|
||||
{
|
||||
std::size_t first_selected= std::numeric_limits<std::size_t>::max();
|
||||
size_t first_selected= std::numeric_limits<size_t>::max();
|
||||
if(selected.empty())
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("Option row %s requires only one "
|
||||
@@ -218,12 +218,12 @@ inline void VerifySelected(SelectType st, std::vector<bool> &selected, const RSt
|
||||
"elements.", sName.c_str());
|
||||
return;
|
||||
}
|
||||
for(std::size_t e= 0; e < selected.size(); ++e)
|
||||
for(size_t e= 0; e < selected.size(); ++e)
|
||||
{
|
||||
if(selected[e])
|
||||
{
|
||||
num_selected++;
|
||||
if(first_selected == std::numeric_limits<std::size_t>::max())
|
||||
if(first_selected == std::numeric_limits<size_t>::max())
|
||||
{
|
||||
first_selected= e;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ inline void VerifySelected(SelectType st, std::vector<bool> &selected, const RSt
|
||||
LuaHelpers::ReportScriptErrorFmt("Option row %s requires only one "
|
||||
"thing to be selected, but %i out of %i things are selected.",
|
||||
sName.c_str(), num_selected, static_cast<int>(selected.size()));
|
||||
for(std::size_t e= 0; e < selected.size(); ++e)
|
||||
for(size_t e= 0; e < selected.size(); ++e)
|
||||
{
|
||||
if(selected[e] && e != first_selected)
|
||||
{
|
||||
|
||||
@@ -106,19 +106,19 @@
|
||||
{ \
|
||||
int original_top= lua_gettop(L); \
|
||||
lua_createtable(L, p->m_ ## member.size(), 0); \
|
||||
for(std::size_t n= 0; n < p->m_ ## member.size(); ++n) \
|
||||
for(size_t n= 0; n < p->m_ ## member.size(); ++n) \
|
||||
{ \
|
||||
lua_pushnumber(L, p->m_ ## member[n]); \
|
||||
lua_rawseti(L, -2, n+1); \
|
||||
} \
|
||||
if(lua_istable(L, 1) && original_top >= 1) \
|
||||
{ \
|
||||
std::size_t size= lua_objlen(L, 1); \
|
||||
size_t size= lua_objlen(L, 1); \
|
||||
if(valid(L, 1)) \
|
||||
{ \
|
||||
p->m_ ## member.clear(); \
|
||||
p->m_ ## member.reserve(size); \
|
||||
for(std::size_t n= 1; n <= size; ++n) \
|
||||
for(size_t n= 1; n <= size; ++n) \
|
||||
{ \
|
||||
lua_pushnumber(L, n); \
|
||||
lua_gettable(L, 1); \
|
||||
|
||||
+2
-2
@@ -232,7 +232,7 @@ void OptionsList::Load( RString sType, PlayerNumber pn )
|
||||
m_Rows[sLineName] = pHand;
|
||||
m_asLoadedRows.push_back( sLineName );
|
||||
|
||||
for( std::size_t i = 0; i < pHand->m_Def.m_vsChoices.size(); ++i )
|
||||
for( size_t i = 0; i < pHand->m_Def.m_vsChoices.size(); ++i )
|
||||
{
|
||||
RString sScreen = pHand->GetScreen(i);
|
||||
if( !sScreen.empty() )
|
||||
@@ -573,7 +573,7 @@ void OptionsList::SetDefaultCurrentRow()
|
||||
|
||||
int OptionsList::FindScreenInHandler( const OptionRowHandler *pHandler, RString sScreen )
|
||||
{
|
||||
for( std::size_t i = 0; i < pHandler->m_Def.m_vsChoices.size(); ++i )
|
||||
for( size_t i = 0; i < pHandler->m_Def.m_vsChoices.size(); ++i )
|
||||
{
|
||||
if( pHandler->GetScreen(i) == sScreen )
|
||||
return i;
|
||||
|
||||
+9
-9
@@ -46,8 +46,8 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
RString ATTACK_DISPLAY_X_NAME( std::size_t p, std::size_t both_sides );
|
||||
void TimingWindowSecondsInit( std::size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut );
|
||||
RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides );
|
||||
void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut );
|
||||
|
||||
/**
|
||||
* @brief Helper class to ensure that each row is only judged once without taking too much memory.
|
||||
@@ -58,9 +58,9 @@ class JudgedRows
|
||||
int m_iStart;
|
||||
int m_iOffset;
|
||||
|
||||
void Resize( std::size_t iMin )
|
||||
void Resize( size_t iMin )
|
||||
{
|
||||
std::size_t iNewSize = std::max( 2*m_vRows.size(), iMin );
|
||||
size_t iNewSize = std::max( 2*m_vRows.size(), iMin );
|
||||
std::vector<bool> vNewRows( m_vRows.begin() + m_iOffset, m_vRows.end() );
|
||||
vNewRows.reserve( iNewSize );
|
||||
vNewRows.insert( vNewRows.end(), m_vRows.begin(), m_vRows.begin() + m_iOffset );
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
RString ATTACK_DISPLAY_X_NAME( std::size_t p, std::size_t both_sides ) { return "AttackDisplayXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); }
|
||||
RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ) { return "AttackDisplayXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); }
|
||||
|
||||
/**
|
||||
* @brief Distance to search for a note in Step(), in seconds.
|
||||
@@ -106,7 +106,7 @@ RString ATTACK_DISPLAY_X_NAME( std::size_t p, std::size_t both_sides ) { return
|
||||
* TODO: This should be calculated based on the max size of the current judgment windows. */
|
||||
static const float StepSearchDistance = 1.0f;
|
||||
|
||||
void TimingWindowSecondsInit( std::size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
{
|
||||
sNameOut = "TimingWindowSeconds" + TimingWindowToString( static_cast<TimingWindow>(i) );
|
||||
switch( i )
|
||||
@@ -2182,7 +2182,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
|
||||
std::vector<GameInput> GameI;
|
||||
GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( t, pn, GameI );
|
||||
float secs_held= 0.0f;
|
||||
for(std::size_t i= 0; i < GameI.size(); ++i)
|
||||
for(size_t i= 0; i < GameI.size(); ++i)
|
||||
{
|
||||
secs_held= std::max(secs_held, INPUTMAPPER->GetSecsHeld( GameI[i] ));
|
||||
}
|
||||
@@ -2881,7 +2881,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
|
||||
GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI );
|
||||
if( PREFSMAN->m_fPadStickSeconds > 0.f )
|
||||
{
|
||||
for(std::size_t i= 0; i < GameI.size(); ++i)
|
||||
for(size_t i= 0; i < GameI.size(); ++i)
|
||||
{
|
||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld(GameI[i], m_pPlayerState->m_mp);
|
||||
if(fSecsHeld >= PREFSMAN->m_fPadStickSeconds)
|
||||
@@ -2909,7 +2909,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
|
||||
GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI );
|
||||
if( PREFSMAN->m_fPadStickSeconds > 0.0f )
|
||||
{
|
||||
for(std::size_t i= 0; i < GameI.size(); ++i)
|
||||
for(size_t i= 0; i < GameI.size(); ++i)
|
||||
{
|
||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld(GameI[i], m_pPlayerState->m_mp);
|
||||
if(fSecsHeld >= PREFSMAN->m_fPadStickSeconds)
|
||||
|
||||
@@ -793,7 +793,7 @@ public:
|
||||
static int GetComboList( T* p, lua_State *L )
|
||||
{
|
||||
lua_createtable(L, p->m_ComboList.size(), 0);
|
||||
for( std::size_t i= 0; i < p->m_ComboList.size(); ++i)
|
||||
for( size_t i= 0; i < p->m_ComboList.size(); ++i)
|
||||
{
|
||||
lua_createtable(L, 0, 6);
|
||||
lua_pushstring(L, "StartSecond");
|
||||
|
||||
+5
-5
@@ -154,9 +154,9 @@ public:
|
||||
typedef Preference<T> PreferenceT;
|
||||
std::vector<PreferenceT*> m_v;
|
||||
|
||||
Preference1D( void pfn(std::size_t i, RString &sNameOut, T &defaultValueOut ), std::size_t N, PreferenceType type = PreferenceType::Mutable )
|
||||
Preference1D( void pfn(size_t i, RString &sNameOut, T &defaultValueOut ), size_t N, PreferenceType type = PreferenceType::Mutable )
|
||||
{
|
||||
for( std::size_t i=0; i<N; ++i )
|
||||
for( size_t i=0; i<N; ++i )
|
||||
{
|
||||
RString sName;
|
||||
T defaultValue;
|
||||
@@ -167,14 +167,14 @@ public:
|
||||
|
||||
~Preference1D()
|
||||
{
|
||||
for( std::size_t i=0; i<m_v.size(); ++i )
|
||||
for( size_t i=0; i<m_v.size(); ++i )
|
||||
RageUtil::SafeDelete( m_v[i] );
|
||||
}
|
||||
const Preference<T>& operator[]( std::size_t i ) const
|
||||
const Preference<T>& operator[]( size_t i ) const
|
||||
{
|
||||
return *m_v[i];
|
||||
}
|
||||
Preference<T>& operator[]( std::size_t i )
|
||||
Preference<T>& operator[]( size_t i )
|
||||
{
|
||||
return *m_v[i];
|
||||
}
|
||||
|
||||
+5
-5
@@ -86,7 +86,7 @@ void Profile::ClearSongs()
|
||||
return;
|
||||
}
|
||||
Song* gamestate_curr_song= GAMESTATE->m_pCurSong;
|
||||
for(std::size_t i= 0; i < m_songs.size(); ++i)
|
||||
for(size_t i= 0; i < m_songs.size(); ++i)
|
||||
{
|
||||
Song* curr_song= m_songs[i];
|
||||
if(curr_song == gamestate_curr_song)
|
||||
@@ -925,10 +925,10 @@ void Profile::MergeScoresFromOtherProfile(Profile* other, bool skip_totals,
|
||||
{
|
||||
// The old screenshot count is stored so we know where to start in the
|
||||
// list when copying the screenshot images.
|
||||
std::size_t old_count= m_vScreenshots.size();
|
||||
size_t old_count= m_vScreenshots.size();
|
||||
m_vScreenshots.insert(m_vScreenshots.end(),
|
||||
other->m_vScreenshots.begin(), other->m_vScreenshots.end());
|
||||
for(std::size_t sid= old_count; sid < m_vScreenshots.size(); ++sid)
|
||||
for(size_t sid= old_count; sid < m_vScreenshots.size(); ++sid)
|
||||
{
|
||||
RString old_path= from_dir + "Screenshots/" + m_vScreenshots[sid].sFileName;
|
||||
RString new_path= to_dir + "Screenshots/" + m_vScreenshots[sid].sFileName;
|
||||
@@ -1199,7 +1199,7 @@ void Profile::LoadSongsFromDir(RString const& dir, ProfileSlot prof_slot)
|
||||
StripMacResourceForks(song_folders);
|
||||
LOG->Trace("Found %i songs in profile.", int(song_folders.size()));
|
||||
// Only songs that are successfully loaded count towards the limit. -Kyz
|
||||
for(std::size_t song_index= 0; song_index < song_folders.size()
|
||||
for(size_t song_index= 0; song_index < song_folders.size()
|
||||
&& m_songs.size() < PREFSMAN->m_custom_songs_max_count;
|
||||
++song_index)
|
||||
{
|
||||
@@ -2787,7 +2787,7 @@ public:
|
||||
{
|
||||
lua_createtable(L, p->m_songs.size(), 0);
|
||||
int song_tab= lua_gettop(L);
|
||||
for(std::size_t i= 0; i < p->m_songs.size(); ++i)
|
||||
for(size_t i= 0; i < p->m_songs.size(); ++i)
|
||||
{
|
||||
p->m_songs[i]->PushSelf(L);
|
||||
lua_rawseti(L, song_tab, i+1);
|
||||
|
||||
+11
-11
@@ -34,7 +34,7 @@ ProfileManager* PROFILEMAN = nullptr; // global and accessible from anywhere in
|
||||
#define ID_DIGITS_STR "8"
|
||||
#define MAX_ID 99999999
|
||||
|
||||
static void DefaultLocalProfileIDInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut )
|
||||
static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut )
|
||||
{
|
||||
sNameOut = ssprintf( "DefaultLocalProfileIDP%d", int(i+1) );
|
||||
defaultValueOut = "";
|
||||
@@ -942,7 +942,7 @@ void ProfileManager::MergeLocalProfileIntoMachine(RString const& from_id, bool s
|
||||
|
||||
void ProfileManager::ChangeProfileType(int index, ProfileType new_type)
|
||||
{
|
||||
if(index < 0 || static_cast<std::size_t>(index) >= g_vLocalProfile.size())
|
||||
if(index < 0 || static_cast<size_t>(index) >= g_vLocalProfile.size())
|
||||
{ return; }
|
||||
if(new_type == g_vLocalProfile[index].profile.m_Type)
|
||||
{ return; }
|
||||
@@ -954,7 +954,7 @@ void ProfileManager::ChangeProfileType(int index, ProfileType new_type)
|
||||
|
||||
void ProfileManager::MoveProfileTopBottom(int index, bool top)
|
||||
{
|
||||
if (index < 0 || static_cast<std::size_t>(index) >= g_vLocalProfile.size())
|
||||
if (index < 0 || static_cast<size_t>(index) >= g_vLocalProfile.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -962,7 +962,7 @@ void ProfileManager::MoveProfileTopBottom(int index, bool top)
|
||||
int swindex = 0;
|
||||
// There may be guest profiles at the top of the list, so we need to skip over them if moving to the top.
|
||||
// If we're moving the profile to the bottom we should stop once we find the first test profile.
|
||||
for (std::size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
for (size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
{
|
||||
ProfileType type= g_vLocalProfile[i].profile.m_Type;
|
||||
if (!top)
|
||||
@@ -996,14 +996,14 @@ void ProfileManager::MoveProfileTopBottom(int index, bool top)
|
||||
|
||||
void ProfileManager::MoveProfileSorted(int index, bool bAscending) {
|
||||
|
||||
if (index < 0 || static_cast<std::size_t>(index) >= g_vLocalProfile.size())
|
||||
if (index < 0 || static_cast<size_t>(index) >= g_vLocalProfile.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int swindex = 0;
|
||||
// There may be guest profiles at the top of the list, so we need to skip over them.
|
||||
for (std::size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
for (size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
{
|
||||
ProfileType type= g_vLocalProfile[i].profile.m_Type;
|
||||
if (type != ProfileType_Guest)
|
||||
@@ -1038,7 +1038,7 @@ void ProfileManager::MoveProfileSorted(int index, bool bAscending) {
|
||||
|
||||
void ProfileManager::MoveProfilePriority(int index, bool up)
|
||||
{
|
||||
if(index < 0 || static_cast<std::size_t>(index) >= g_vLocalProfile.size())
|
||||
if(index < 0 || static_cast<size_t>(index) >= g_vLocalProfile.size())
|
||||
{ return; }
|
||||
// Changing the priority is complicated a bit because the profiles might
|
||||
// all have the same priority. So this function has to assign priorities
|
||||
@@ -1047,7 +1047,7 @@ void ProfileManager::MoveProfilePriority(int index, bool up)
|
||||
int swindex= index + ((up * -2) + 1);
|
||||
ProfileType type= g_vLocalProfile[index].profile.m_Type;
|
||||
int priority= 0;
|
||||
for(std::size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
for(size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
{
|
||||
DirAndProfile* curr= &g_vLocalProfile[i];
|
||||
if(curr->profile.m_Type == type)
|
||||
@@ -1055,7 +1055,7 @@ void ProfileManager::MoveProfilePriority(int index, bool up)
|
||||
if(curr->profile.m_ListPriority != priority)
|
||||
{
|
||||
curr->profile.m_ListPriority= priority;
|
||||
if(i != static_cast<std::size_t>(index) && i != static_cast<std::size_t>(swindex))
|
||||
if(i != static_cast<size_t>(index) && i != static_cast<size_t>(swindex))
|
||||
{
|
||||
curr->profile.SaveTypeToDir(curr->sDir);
|
||||
}
|
||||
@@ -1068,7 +1068,7 @@ void ProfileManager::MoveProfilePriority(int index, bool up)
|
||||
}
|
||||
}
|
||||
// Only swap if both indices are valid and the types match.
|
||||
if(swindex >= 0 && static_cast<std::size_t>(swindex) < g_vLocalProfile.size() &&
|
||||
if(swindex >= 0 && static_cast<size_t>(swindex) < g_vLocalProfile.size() &&
|
||||
g_vLocalProfile[swindex].profile.m_Type ==
|
||||
g_vLocalProfile[index].profile.m_Type)
|
||||
{
|
||||
@@ -1280,7 +1280,7 @@ int ProfileManager::GetNumLocalProfiles() const
|
||||
void ProfileManager::SetStatsPrefix(RString const& prefix)
|
||||
{
|
||||
m_stats_prefix= prefix;
|
||||
for(std::size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
for(size_t i= 0; i < g_vLocalProfile.size(); ++i)
|
||||
{
|
||||
g_vLocalProfile[i].profile.HandleStatsPrefixChange(g_vLocalProfile[i].sDir, PREFSMAN->m_bSignProfileData);
|
||||
}
|
||||
|
||||
+2
-2
@@ -978,8 +978,8 @@ void RageCompiledGeometry::Set( const std::vector<msMesh> &vMeshes, bool bNeedsN
|
||||
{
|
||||
m_bNeedsNormals = bNeedsNormals;
|
||||
|
||||
std::size_t totalVerts = 0;
|
||||
std::size_t totalTriangles = 0;
|
||||
size_t totalVerts = 0;
|
||||
size_t totalTriangles = 0;
|
||||
|
||||
m_bAnyNeedsTextureMatrixScale = false;
|
||||
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ public:
|
||||
virtual void Draw( int iMeshIndex ) const = 0;
|
||||
|
||||
protected:
|
||||
std::size_t GetTotalVertices() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iVertexStart + m_vMeshInfo.back().iVertexCount; }
|
||||
std::size_t GetTotalTriangles() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iTriangleStart + m_vMeshInfo.back().iTriangleCount; }
|
||||
size_t GetTotalVertices() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iVertexStart + m_vMeshInfo.back().iVertexCount; }
|
||||
size_t GetTotalTriangles() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iTriangleStart + m_vMeshInfo.back().iTriangleCount; }
|
||||
|
||||
struct MeshInfo
|
||||
{
|
||||
|
||||
+15
-15
@@ -48,8 +48,8 @@ const D3DFORMAT g_DefaultAdapterFormat = D3DFMT_X8R8G8B8;
|
||||
/* Direct3D doesn't associate a palette with textures. Instead, we load a
|
||||
* palette into a slot. We need to keep track of which texture's palette is
|
||||
* stored in what slot. */
|
||||
std::map<std::uintptr_t, std::size_t> g_TexResourceToPaletteIndex;
|
||||
std::list<std::size_t> g_PaletteIndex;
|
||||
std::map<std::uintptr_t, size_t> g_TexResourceToPaletteIndex;
|
||||
std::list<size_t> g_PaletteIndex;
|
||||
struct TexturePalette { PALETTEENTRY p[256]; };
|
||||
std::map<std::uintptr_t, TexturePalette> g_TexResourceToTexturePalette;
|
||||
|
||||
@@ -67,7 +67,7 @@ static void SetPalette( std::uintptr_t TexResource )
|
||||
UINT iPalIndex = static_cast<UINT>(g_PaletteIndex.front());
|
||||
|
||||
// If any other texture is currently using this slot, mark that palette unloaded.
|
||||
for( std::map<std::uintptr_t, std::size_t>::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i )
|
||||
for( std::map<std::uintptr_t, size_t>::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i )
|
||||
{
|
||||
if( i->second != iPalIndex )
|
||||
continue;
|
||||
@@ -85,7 +85,7 @@ static void SetPalette( std::uintptr_t TexResource )
|
||||
const int iPalIndex = g_TexResourceToPaletteIndex[TexResource];
|
||||
|
||||
// Find this palette index in the least-recently-used queue and move it to the end.
|
||||
for(std::list<std::size_t>::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i)
|
||||
for(std::list<size_t>::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i)
|
||||
{
|
||||
if( *i != iPalIndex )
|
||||
continue;
|
||||
@@ -331,7 +331,7 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP)
|
||||
}
|
||||
|
||||
// Test each back buffer format until we find something that works.
|
||||
for( std::size_t i=0; i < vBackBufferFormats.size(); i++ )
|
||||
for( size_t i=0; i < vBackBufferFormats.size(); i++ )
|
||||
{
|
||||
D3DFORMAT fmtBackBuffer = vBackBufferFormats[i];
|
||||
|
||||
@@ -786,18 +786,18 @@ public:
|
||||
}
|
||||
void Change( const std::vector<msMesh> &vMeshes )
|
||||
{
|
||||
for( std::size_t i=0; i<vMeshes.size(); i++ )
|
||||
for( size_t i=0; i<vMeshes.size(); i++ )
|
||||
{
|
||||
const MeshInfo& meshInfo = m_vMeshInfo[i];
|
||||
const msMesh& mesh = vMeshes[i];
|
||||
const std::vector<RageModelVertex> &Vertices = mesh.Vertices;
|
||||
const std::vector<msTriangle> &Triangles = mesh.Triangles;
|
||||
|
||||
for( std::size_t j=0; j<Vertices.size(); j++ )
|
||||
for( size_t j=0; j<Vertices.size(); j++ )
|
||||
m_vVertex[meshInfo.iVertexStart+j] = Vertices[j];
|
||||
|
||||
for( std::size_t j=0; j<Triangles.size(); j++ )
|
||||
for( std::size_t k=0; k<3; k++ )
|
||||
for( size_t j=0; j<Triangles.size(); j++ )
|
||||
for( size_t k=0; k<3; k++ )
|
||||
m_vTriangles[meshInfo.iTriangleStart+j].nVertexIndices[k] = (std::uint16_t) meshInfo.iVertexStart + Triangles[j].nVertexIndices[k];
|
||||
}
|
||||
}
|
||||
@@ -855,8 +855,8 @@ void RageDisplay_D3D::DrawQuadsInternal( const RageSpriteVertex v[], int iNumVer
|
||||
|
||||
// make a temporary index buffer
|
||||
static std::vector<std::uint16_t> vIndices;
|
||||
std::size_t uOldSize = vIndices.size();
|
||||
std::size_t uNewSize = std::max(uOldSize, static_cast<std::size_t>(iNumIndices));
|
||||
size_t uOldSize = vIndices.size();
|
||||
size_t uNewSize = std::max(uOldSize, static_cast<size_t>(iNumIndices));
|
||||
vIndices.resize( uNewSize );
|
||||
for( std::uint16_t i=(std::uint16_t)uOldSize/6; i<(std::uint16_t)iNumQuads; i++ )
|
||||
{
|
||||
@@ -891,8 +891,8 @@ void RageDisplay_D3D::DrawQuadStripInternal( const RageSpriteVertex v[], int iNu
|
||||
|
||||
// make a temporary index buffer
|
||||
static std::vector<std::uint16_t> vIndices;
|
||||
std::size_t uOldSize = vIndices.size();
|
||||
std::size_t uNewSize = std::max(uOldSize, static_cast<std::size_t>(iNumIndices));
|
||||
size_t uOldSize = vIndices.size();
|
||||
size_t uNewSize = std::max(uOldSize, static_cast<size_t>(iNumIndices));
|
||||
vIndices.resize( uNewSize );
|
||||
for( std::uint16_t i=(std::uint16_t)uOldSize/6; i<(std::uint16_t)iNumQuads; i++ )
|
||||
{
|
||||
@@ -926,8 +926,8 @@ void RageDisplay_D3D::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[]
|
||||
|
||||
// make a temporary index buffer
|
||||
static std::vector<std::uint16_t> vIndices;
|
||||
std::size_t uOldSize = vIndices.size();
|
||||
std::size_t uNewSize = std::max(uOldSize, static_cast<std::size_t>(iNumIndices));
|
||||
size_t uOldSize = vIndices.size();
|
||||
size_t uNewSize = std::max(uOldSize, static_cast<size_t>(iNumIndices));
|
||||
vIndices.resize( uNewSize );
|
||||
for( std::uint16_t i=(std::uint16_t)uOldSize/12; i<(std::uint16_t)iNumPieces; i++ )
|
||||
{
|
||||
|
||||
@@ -264,12 +264,12 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende
|
||||
}
|
||||
|
||||
sort( extensions.begin(), extensions.end() );
|
||||
std::size_t next = 0;
|
||||
size_t next = 0;
|
||||
while( next < extensions.size() )
|
||||
{
|
||||
std::size_t last = next;
|
||||
size_t last = next;
|
||||
string type;
|
||||
for( std::size_t i = next; i<extensions.size(); ++i )
|
||||
for( size_t i = next; i<extensions.size(); ++i )
|
||||
{
|
||||
std::vector<string> segments;
|
||||
split(extensions[i], '_', segments);
|
||||
@@ -311,12 +311,12 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende
|
||||
std::vector<RString> asExtensions;
|
||||
split( szExtensionString, " ", asExtensions );
|
||||
sort( asExtensions.begin(), asExtensions.end() );
|
||||
std::size_t iNextToPrint = 0;
|
||||
size_t iNextToPrint = 0;
|
||||
while( iNextToPrint < asExtensions.size() )
|
||||
{
|
||||
std::size_t iLastToPrint = iNextToPrint;
|
||||
size_t iLastToPrint = iNextToPrint;
|
||||
RString sType;
|
||||
for( std::size_t i = iNextToPrint; i<asExtensions.size(); ++i )
|
||||
for( size_t i = iNextToPrint; i<asExtensions.size(); ++i )
|
||||
{
|
||||
std::vector<RString> asBits;
|
||||
split( asExtensions[i], "_", asBits );
|
||||
|
||||
@@ -497,12 +497,12 @@ RString RageDisplay_Legacy::Init( const VideoModeParams &p, bool bAllowUnacceler
|
||||
std::vector<RString> asExtensions;
|
||||
split( szExtensionString, " ", asExtensions );
|
||||
sort( asExtensions.begin(), asExtensions.end() );
|
||||
std::size_t iNextToPrint = 0;
|
||||
size_t iNextToPrint = 0;
|
||||
while( iNextToPrint < asExtensions.size() )
|
||||
{
|
||||
std::size_t iLastToPrint = iNextToPrint;
|
||||
size_t iLastToPrint = iNextToPrint;
|
||||
RString sType;
|
||||
for( std::size_t i = iNextToPrint; i<asExtensions.size(); ++i )
|
||||
for( size_t i = iNextToPrint; i<asExtensions.size(); ++i )
|
||||
{
|
||||
std::vector<RString> asBits;
|
||||
split( asExtensions[i], "_", asBits );
|
||||
|
||||
+4
-4
@@ -146,7 +146,7 @@ void RageFile::SetError( const RString &err )
|
||||
m_sError = err;
|
||||
}
|
||||
|
||||
int RageFile::Read( void *pBuffer, std::size_t iBytes )
|
||||
int RageFile::Read( void *pBuffer, size_t iBytes )
|
||||
{
|
||||
ASSERT_READ;
|
||||
return m_File->Read( pBuffer, iBytes );
|
||||
@@ -182,14 +182,14 @@ int RageFile::Read( RString &buffer, int bytes )
|
||||
return m_File->Read( buffer, bytes );
|
||||
}
|
||||
|
||||
int RageFile::Write( const void *buffer, std::size_t bytes )
|
||||
int RageFile::Write( const void *buffer, size_t bytes )
|
||||
{
|
||||
ASSERT_WRITE;
|
||||
return m_File->Write( buffer, bytes );
|
||||
}
|
||||
|
||||
|
||||
int RageFile::Write( const void *buffer, std::size_t bytes, int nmemb )
|
||||
int RageFile::Write( const void *buffer, size_t bytes, int nmemb )
|
||||
{
|
||||
ASSERT_WRITE;
|
||||
return m_File->Write( buffer, bytes, nmemb );
|
||||
@@ -206,7 +206,7 @@ int RageFile::Flush()
|
||||
return m_File->Flush();
|
||||
}
|
||||
|
||||
int RageFile::Read( void *buffer, std::size_t bytes, int nmemb )
|
||||
int RageFile::Read( void *buffer, size_t bytes, int nmemb )
|
||||
{
|
||||
ASSERT_READ;
|
||||
return m_File->Read( buffer, bytes, nmemb );
|
||||
|
||||
+4
-4
@@ -62,15 +62,15 @@ public:
|
||||
int GetFD();
|
||||
|
||||
/* Raw I/O: */
|
||||
int Read( void *buffer, std::size_t bytes );
|
||||
int Read( void *buffer, size_t bytes );
|
||||
int Read( RString &buffer, int bytes = -1 );
|
||||
int Write( const void *buffer, std::size_t bytes );
|
||||
int Write( const void *buffer, size_t bytes );
|
||||
int Write( const RString& string ) { return Write( string.data(), string.size() ); }
|
||||
int Flush();
|
||||
|
||||
/* These are just here to make wrappers (eg. vorbisfile, SDL_rwops) easier. */
|
||||
int Write( const void *buffer, std::size_t bytes, int nmemb );
|
||||
int Read( void *buffer, std::size_t bytes, int nmemb );
|
||||
int Write( const void *buffer, size_t bytes, int nmemb );
|
||||
int Read( void *buffer, size_t bytes, int nmemb );
|
||||
int Seek( int offset, int whence );
|
||||
|
||||
/* Line-based I/O: */
|
||||
|
||||
@@ -102,7 +102,7 @@ int RageFileObj::Seek( int offset, int whence )
|
||||
return Seek( (int) offset );
|
||||
}
|
||||
|
||||
int RageFileObj::Read( void *pBuffer, std::size_t iBytes )
|
||||
int RageFileObj::Read( void *pBuffer, size_t iBytes )
|
||||
{
|
||||
int iRet = 0;
|
||||
|
||||
@@ -189,7 +189,7 @@ int RageFileObj::Read( RString &sBuffer, int iBytes )
|
||||
return iRet;
|
||||
}
|
||||
|
||||
int RageFileObj::Read( void *pBuffer, std::size_t iBytes, int iNmemb )
|
||||
int RageFileObj::Read( void *pBuffer, size_t iBytes, int iNmemb )
|
||||
{
|
||||
const int iRet = Read( pBuffer, iBytes*iNmemb );
|
||||
if( iRet == -1 )
|
||||
@@ -231,7 +231,7 @@ int RageFileObj::EmptyWriteBuf()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RageFileObj::Write( const void *pBuffer, std::size_t iBytes )
|
||||
int RageFileObj::Write( const void *pBuffer, size_t iBytes )
|
||||
{
|
||||
if( m_pWriteBuffer != nullptr )
|
||||
{
|
||||
@@ -269,7 +269,7 @@ int RageFileObj::Write( const void *pBuffer, std::size_t iBytes )
|
||||
return iRet;
|
||||
}
|
||||
|
||||
int RageFileObj::Write( const void *pBuffer, std::size_t iBytes, int iNmemb )
|
||||
int RageFileObj::Write( const void *pBuffer, size_t iBytes, int iNmemb )
|
||||
{
|
||||
/* Simple write. We never return partial writes. */
|
||||
int iRet = Write( pBuffer, iBytes*iNmemb ) / iBytes;
|
||||
|
||||
+10
-10
@@ -31,14 +31,14 @@ public:
|
||||
* 0 on end of stream, or -1 on error. Note that reading less than iSize
|
||||
* does not necessarily mean that the end of the stream has been reached;
|
||||
* keep reading until 0 is returned. */
|
||||
virtual int Read( void *pBuffer, std::size_t iBytes ) = 0;
|
||||
virtual int Read( void *pBuffer, size_t iBytes ) = 0;
|
||||
virtual int Read( RString &buffer, int bytes = -1 ) = 0;
|
||||
virtual int Read( void *buffer, std::size_t bytes, int nmemb ) = 0;
|
||||
virtual int Read( void *buffer, size_t bytes, int nmemb ) = 0;
|
||||
|
||||
/* Write iSize bytes of data from pBuf. Return 0 on success, -1 on error. */
|
||||
virtual int Write( const void *pBuffer, std::size_t iBytes ) = 0;
|
||||
virtual int Write( const void *pBuffer, size_t iBytes ) = 0;
|
||||
virtual int Write( const RString &sString ) = 0;
|
||||
virtual int Write( const void *buffer, std::size_t bytes, int nmemb ) = 0;
|
||||
virtual int Write( const void *buffer, size_t bytes, int nmemb ) = 0;
|
||||
|
||||
/* Due to buffering, writing may not happen by the end of a Write() call, so not
|
||||
* all errors may be returned by it. Data will be flushed when the stream (or its
|
||||
@@ -81,13 +81,13 @@ public:
|
||||
int Seek( int offset, int whence );
|
||||
int Tell() const { return m_iFilePos; }
|
||||
|
||||
int Read( void *pBuffer, std::size_t iBytes );
|
||||
int Read( void *pBuffer, size_t iBytes );
|
||||
int Read( RString &buffer, int bytes = -1 );
|
||||
int Read( void *buffer, std::size_t bytes, int nmemb );
|
||||
int Read( void *buffer, size_t bytes, int nmemb );
|
||||
|
||||
int Write( const void *pBuffer, std::size_t iBytes );
|
||||
int Write( const void *pBuffer, size_t iBytes );
|
||||
int Write( const RString &sString ) { return Write( sString.data(), sString.size() ); }
|
||||
int Write( const void *buffer, std::size_t bytes, int nmemb );
|
||||
int Write( const void *buffer, size_t bytes, int nmemb );
|
||||
|
||||
int Flush();
|
||||
|
||||
@@ -104,8 +104,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual int SeekInternal( int /* iOffset */ ) { FAIL_M( "Seeking unimplemented" ); }
|
||||
virtual int ReadInternal( void *pBuffer, std::size_t iBytes ) = 0;
|
||||
virtual int WriteInternal( const void *pBuffer, std::size_t iBytes ) = 0;
|
||||
virtual int ReadInternal( void *pBuffer, size_t iBytes ) = 0;
|
||||
virtual int WriteInternal( const void *pBuffer, size_t iBytes ) = 0;
|
||||
virtual int FlushInternal() { return 0; }
|
||||
|
||||
void EnableReadBuffering();
|
||||
|
||||
@@ -79,13 +79,13 @@ RageFileObjInflate::~RageFileObjInflate()
|
||||
delete m_pInflate;
|
||||
}
|
||||
|
||||
int RageFileObjInflate::ReadInternal( void *buf, std::size_t bytes )
|
||||
int RageFileObjInflate::ReadInternal( void *buf, size_t bytes )
|
||||
{
|
||||
/* Don't read more than m_iUncompressedSize of data. If we don't do this, it's
|
||||
* possible for a .gz to contain a header claiming 500k of data, but to actually
|
||||
* contain much more deflated data. */
|
||||
ASSERT_M( m_iFilePos <= m_iUncompressedSize, ssprintf("%i, %i",m_iFilePos, m_iUncompressedSize) );
|
||||
bytes = std::min( bytes, std::size_t(m_iUncompressedSize-m_iFilePos) );
|
||||
bytes = std::min( bytes, size_t(m_iUncompressedSize-m_iFilePos) );
|
||||
|
||||
bool done=false;
|
||||
int ret = 0;
|
||||
@@ -224,7 +224,7 @@ RageFileObjDeflate::~RageFileObjDeflate()
|
||||
delete m_pDeflate;
|
||||
}
|
||||
|
||||
int RageFileObjDeflate::WriteInternal( const void *pBuffer, std::size_t iBytes )
|
||||
int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes )
|
||||
{
|
||||
if( iBytes == 0 )
|
||||
{
|
||||
|
||||
@@ -18,8 +18,8 @@ public:
|
||||
RageFileObjInflate( RageFileBasic *pFile, int iUncompressedSize );
|
||||
RageFileObjInflate( const RageFileObjInflate &cpy );
|
||||
~RageFileObjInflate();
|
||||
int ReadInternal( void *pBuffer, std::size_t iBytes );
|
||||
int WriteInternal( const void * /* pBuffer */, std::size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; }
|
||||
int ReadInternal( void *pBuffer, size_t iBytes );
|
||||
int WriteInternal( const void * /* pBuffer */, size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; }
|
||||
int SeekInternal( int iOffset );
|
||||
int GetFileSize() const { return m_iUncompressedSize; }
|
||||
int GetFD() { return m_pFile->GetFD(); }
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
void DeleteFileWhenFinished() { m_bFileOwned = true; }
|
||||
|
||||
protected:
|
||||
int ReadInternal( void * /* pBuffer */, std::size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; }
|
||||
int WriteInternal( const void *pBuffer, std::size_t iBytes );
|
||||
int ReadInternal( void * /* pBuffer */, size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; }
|
||||
int WriteInternal( const void *pBuffer, size_t iBytes );
|
||||
int FlushInternal();
|
||||
|
||||
RageFileBasic *m_pFile;
|
||||
|
||||
@@ -389,7 +389,7 @@ RageFileObjDirect::~RageFileObjDirect()
|
||||
DoRemove( MakeTempFilename(m_sPath) );
|
||||
}
|
||||
|
||||
int RageFileObjDirect::ReadInternal( void *pBuf, std::size_t iBytes )
|
||||
int RageFileObjDirect::ReadInternal( void *pBuf, size_t iBytes )
|
||||
{
|
||||
int iRet = DoRead( m_iFD, pBuf, iBytes );
|
||||
if( iRet == -1 )
|
||||
@@ -402,7 +402,7 @@ int RageFileObjDirect::ReadInternal( void *pBuf, std::size_t iBytes )
|
||||
}
|
||||
|
||||
// write(), but retry a couple times on EINTR.
|
||||
static int RetriedWrite( int iFD, const void *pBuf, std::size_t iCount )
|
||||
static int RetriedWrite( int iFD, const void *pBuf, size_t iCount )
|
||||
{
|
||||
int iTries = 3, iRet;
|
||||
do
|
||||
@@ -426,7 +426,7 @@ int RageFileObjDirect::FlushInternal()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RageFileObjDirect::WriteInternal( const void *pBuf, std::size_t iBytes )
|
||||
int RageFileObjDirect::WriteInternal( const void *pBuf, size_t iBytes )
|
||||
{
|
||||
if( WriteFailed() )
|
||||
{
|
||||
|
||||
@@ -37,8 +37,8 @@ class RageFileObjDirect: public RageFileObj
|
||||
public:
|
||||
RageFileObjDirect( const RString &sPath, int iFD, int iMode );
|
||||
virtual ~RageFileObjDirect();
|
||||
virtual int ReadInternal( void *pBuffer, std::size_t iBytes );
|
||||
virtual int WriteInternal( const void *pBuffer, std::size_t iBytes );
|
||||
virtual int ReadInternal( void *pBuffer, size_t iBytes );
|
||||
virtual int WriteInternal( const void *pBuffer, size_t iBytes );
|
||||
virtual int FlushInternal();
|
||||
virtual int SeekInternal( int offset );
|
||||
virtual RageFileObjDirect *Copy() const;
|
||||
|
||||
@@ -53,12 +53,12 @@ RageFileObjMem::~RageFileObjMem()
|
||||
RageFileObjMemFile::ReleaseReference( m_pFile );
|
||||
}
|
||||
|
||||
int RageFileObjMem::ReadInternal( void *buffer, std::size_t bytes )
|
||||
int RageFileObjMem::ReadInternal( void *buffer, size_t bytes )
|
||||
{
|
||||
LockMut(m_pFile->m_Mutex);
|
||||
|
||||
m_iFilePos = std::min( m_iFilePos, GetFileSize() );
|
||||
bytes = std::min( bytes, (std::size_t) GetFileSize() - m_iFilePos );
|
||||
bytes = std::min( bytes, (size_t) GetFileSize() - m_iFilePos );
|
||||
if( bytes == 0 )
|
||||
return 0;
|
||||
memcpy( buffer, &m_pFile->m_sBuf[m_iFilePos], bytes );
|
||||
@@ -67,7 +67,7 @@ int RageFileObjMem::ReadInternal( void *buffer, std::size_t bytes )
|
||||
return bytes;
|
||||
}
|
||||
|
||||
int RageFileObjMem::WriteInternal( const void *buffer, std::size_t bytes )
|
||||
int RageFileObjMem::WriteInternal( const void *buffer, size_t bytes )
|
||||
{
|
||||
m_pFile->m_Mutex.Lock();
|
||||
m_pFile->m_sBuf.replace( m_iFilePos, bytes, (const char *) buffer, bytes );
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
RageFileObjMem( const RageFileObjMem &cpy );
|
||||
~RageFileObjMem();
|
||||
|
||||
int ReadInternal( void *buffer, std::size_t bytes );
|
||||
int WriteInternal( const void *buffer, std::size_t bytes );
|
||||
int ReadInternal( void *buffer, size_t bytes );
|
||||
int WriteInternal( const void *buffer, size_t bytes );
|
||||
int SeekInternal( int offset );
|
||||
int GetFileSize() const;
|
||||
RageFileObjMem *Copy() const;
|
||||
|
||||
@@ -116,7 +116,7 @@ void RageFileDriverReadAhead::FillBuffer( int iBytes )
|
||||
RageFileManagerReadAhead::CacheHintStreaming( m_pFile );
|
||||
}
|
||||
|
||||
int RageFileDriverReadAhead::ReadInternal( void *pBuffer, std::size_t iBytes )
|
||||
int RageFileDriverReadAhead::ReadInternal( void *pBuffer, size_t iBytes )
|
||||
{
|
||||
int iRet = -1;
|
||||
if( m_bReadAheadNeeded && m_iFilePos < (int) m_sBuffer.size() )
|
||||
|
||||
@@ -24,8 +24,8 @@ public:
|
||||
virtual RString GetError() const { return m_pFile->GetError(); }
|
||||
virtual void ClearError() { return m_pFile->ClearError(); }
|
||||
|
||||
int ReadInternal( void *pBuffer, std::size_t iBytes );
|
||||
int WriteInternal( const void *pBuffer, std::size_t iBytes ) { return m_pFile->Write( pBuffer, iBytes ); }
|
||||
int ReadInternal( void *pBuffer, size_t iBytes );
|
||||
int WriteInternal( const void *pBuffer, size_t iBytes ) { return m_pFile->Write( pBuffer, iBytes ); }
|
||||
int SeekInternal( int iOffset );
|
||||
int GetFileSize() const { return m_pFile->GetFileSize(); }
|
||||
int GetFD() { return m_pFile->GetFD(); }
|
||||
|
||||
@@ -34,7 +34,7 @@ RageFileDriverSlice *RageFileDriverSlice::Copy() const
|
||||
return pRet;
|
||||
}
|
||||
|
||||
int RageFileDriverSlice::ReadInternal( void *buf, std::size_t bytes )
|
||||
int RageFileDriverSlice::ReadInternal( void *buf, size_t bytes )
|
||||
{
|
||||
/* Make sure we're reading from the right place. We might have been constructed
|
||||
* with a file not pointing to iOffset. */
|
||||
|
||||
@@ -18,8 +18,8 @@ public:
|
||||
|
||||
void DeleteFileWhenFinished() { m_bFileOwned = true; }
|
||||
|
||||
int ReadInternal( void *pBuffer, std::size_t iBytes );
|
||||
int WriteInternal( const void * /* pBuffer */, std::size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; }
|
||||
int ReadInternal( void *pBuffer, size_t iBytes );
|
||||
int WriteInternal( const void * /* pBuffer */, size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; }
|
||||
int SeekInternal( int iOffset );
|
||||
int GetFileSize() const { return m_iFileSize; }
|
||||
int GetFD() { return m_pFile->GetFD(); }
|
||||
|
||||
@@ -782,7 +782,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
int ReadInternal( void *pBuffer, std::size_t iBytes )
|
||||
int ReadInternal( void *pBuffer, size_t iBytes )
|
||||
{
|
||||
RString sError;
|
||||
int iRet = m_pWorker->Read( m_pFile, pBuffer, iBytes, sError );
|
||||
@@ -799,7 +799,7 @@ protected:
|
||||
return iRet;
|
||||
}
|
||||
|
||||
int WriteInternal( const void *pBuffer, std::size_t iBytes )
|
||||
int WriteInternal( const void *pBuffer, size_t iBytes )
|
||||
{
|
||||
RString sError;
|
||||
int iRet = m_pWorker->Write( m_pFile, pBuffer, iBytes, sError );
|
||||
|
||||
@@ -115,7 +115,7 @@ void RageFileManager::ReleaseFileDriver( RageFileDriver *pDriver )
|
||||
g_Mutex->Unlock();
|
||||
}
|
||||
|
||||
std::size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, std::size_t n)
|
||||
size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
|
||||
{
|
||||
RageFile *f = static_cast<RageFile*>(pOpaque);
|
||||
|
||||
@@ -128,7 +128,7 @@ std::size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, std::size_t n
|
||||
return f->Read(pBuf, n);
|
||||
}
|
||||
|
||||
std::size_t zipWriteFile(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, std::size_t n)
|
||||
size_t zipWriteFile(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n)
|
||||
{
|
||||
RageFile *f = static_cast<RageFile*>(pOpaque);
|
||||
|
||||
@@ -192,7 +192,7 @@ bool RageFileManager::Unzip(const std::string &zipPath, std::string targetPath,
|
||||
|
||||
for (int i = 0; i < strip; i++)
|
||||
{
|
||||
std::size_t pos = filename.find('/');
|
||||
size_t pos = filename.find('/');
|
||||
if (pos != std::string::npos)
|
||||
pos++;
|
||||
filename.erase(0, pos);
|
||||
@@ -302,7 +302,7 @@ static RageFileDriverMountpoints *g_Mountpoints = nullptr;
|
||||
static RString ExtractDirectory( RString sPath )
|
||||
{
|
||||
// return the directory containing sPath
|
||||
std::size_t n = sPath.find_last_of("/");
|
||||
size_t n = sPath.find_last_of("/");
|
||||
if( n != sPath.npos )
|
||||
sPath.erase(n);
|
||||
else
|
||||
|
||||
@@ -118,7 +118,7 @@ static std::vector<RageFileReadAheadThread *> g_apReadAheads;
|
||||
void RageFileManagerReadAhead::Init() { }
|
||||
void RageFileManagerReadAhead::Shutdown()
|
||||
{
|
||||
for( std::size_t i = 0; i < g_apReadAheads.size(); ++i )
|
||||
for( size_t i = 0; i < g_apReadAheads.size(); ++i )
|
||||
delete g_apReadAheads[i];
|
||||
g_apReadAheads.clear();
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void RageFileManagerReadAhead::ReadAhead( RageFileBasic *pFile, int iBytes )
|
||||
RageFileReadAheadThread *pReadAhead = new RageFileReadAheadThread( iFD, iStart, iBytes );
|
||||
g_apReadAheads.push_back( pReadAhead );
|
||||
|
||||
for( std::size_t i = 0; i < g_apReadAheads.size(); ++i )
|
||||
for( size_t i = 0; i < g_apReadAheads.size(); ++i )
|
||||
{
|
||||
if( g_apReadAheads[i]->IsFinished() )
|
||||
{
|
||||
|
||||
@@ -586,7 +586,7 @@ RageSoundReader_Resample_Good::RageSoundReader_Resample_Good( RageSoundReader *p
|
||||
/* Call this if the input position is changed or reset. */
|
||||
void RageSoundReader_Resample_Good::Reset()
|
||||
{
|
||||
for( std::size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel )
|
||||
for( size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel )
|
||||
m_apResamplers[iChannel]->Reset();
|
||||
}
|
||||
|
||||
@@ -613,14 +613,14 @@ void RageSoundReader_Resample_Good::GetFactors( int &iDownFactor, int &iUpFactor
|
||||
/* Call this if the sample factor changes. */
|
||||
void RageSoundReader_Resample_Good::ReopenResampler()
|
||||
{
|
||||
for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
delete m_apResamplers[iChannel];
|
||||
m_apResamplers.clear();
|
||||
|
||||
int iDownFactor, iUpFactor;
|
||||
GetFactors( iDownFactor, iUpFactor );
|
||||
|
||||
for( std::size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel )
|
||||
for( size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel )
|
||||
{
|
||||
int iMinDownFactor = iDownFactor;
|
||||
int iMaxDownFactor = iDownFactor;
|
||||
@@ -634,13 +634,13 @@ void RageSoundReader_Resample_Good::ReopenResampler()
|
||||
if( m_fRate != -1 )
|
||||
iDownFactor = static_cast<int>((m_fRate * iDownFactor) + 0.5 );
|
||||
|
||||
for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
m_apResamplers[iChannel]->SetDownFactor( iDownFactor );
|
||||
}
|
||||
|
||||
RageSoundReader_Resample_Good::~RageSoundReader_Resample_Good()
|
||||
{
|
||||
for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
delete m_apResamplers[iChannel];
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ void RageSoundReader_Resample_Good::SetRate( float fRatio )
|
||||
/* Set m_fRate to the actual rate, after quantization by iUpFactor. */
|
||||
m_fRate = float(iDownFactor) / iUpFactor;
|
||||
|
||||
for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel )
|
||||
m_apResamplers[iChannel]->SetDownFactor( iDownFactor );
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ float RageSoundReader_Resample_Good::GetRate() const
|
||||
RageSoundReader_Resample_Good::RageSoundReader_Resample_Good( const RageSoundReader_Resample_Good &cpy ):
|
||||
RageSoundReader_Filter(cpy)
|
||||
{
|
||||
for( std::size_t i = 0; i < cpy.m_apResamplers.size(); ++i )
|
||||
for( size_t i = 0; i < cpy.m_apResamplers.size(); ++i )
|
||||
this->m_apResamplers.push_back( new RageSoundResampler_Polyphase(*cpy.m_apResamplers[i]) );
|
||||
this->m_iSampleRate = cpy.m_iSampleRate;
|
||||
this->m_fRate = cpy.m_fRate;
|
||||
|
||||
@@ -36,7 +36,7 @@ void RageSoundReader_SpeedChange::Reset()
|
||||
{
|
||||
m_fTrailingSpeedRatio = m_fSpeedRatio;
|
||||
m_iDataBufferAvailFrames = 0;
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ChannelInfo &c = m_Channels[i];
|
||||
c.m_iCorrelatedPos = 0;
|
||||
@@ -102,7 +102,7 @@ int RageSoundReader_SpeedChange::FillData( int iMaxFrames )
|
||||
return iGotFrames;
|
||||
}
|
||||
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ChannelInfo &c = m_Channels[i];
|
||||
|
||||
@@ -134,7 +134,7 @@ void RageSoundReader_SpeedChange::EraseData( int iFramesToDelete )
|
||||
int iFramesToMove = m_iDataBufferAvailFrames - iFramesToDelete;
|
||||
m_iDataBufferAvailFrames -= iFramesToDelete;
|
||||
m_iUncorrelatedPos -= iFramesToDelete;
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ChannelInfo &c = m_Channels[i];
|
||||
if( iFramesToMove )
|
||||
@@ -154,7 +154,7 @@ int RageSoundReader_SpeedChange::Step()
|
||||
{
|
||||
/* Advance m_iCorrelatedPos past the data that was just copied, to point to the
|
||||
* sound that we would have played if we had continued copying at that point. */
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ASSERT( m_Channels[i].m_iCorrelatedPos + m_iPos <= m_iDataBufferAvailFrames );
|
||||
m_Channels[i].m_iCorrelatedPos += m_iPos;
|
||||
@@ -179,7 +179,7 @@ int RageSoundReader_SpeedChange::Step()
|
||||
|
||||
/* We don't need any data before the earlier of m_iUncorrelatedPos or m_iCorrelatedPos. */
|
||||
int iToDelete = m_iUncorrelatedPos;
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ChannelInfo &c = m_Channels[i];
|
||||
ASSERT( c.m_iCorrelatedPos <= m_iDataBufferAvailFrames );
|
||||
@@ -191,7 +191,7 @@ int RageSoundReader_SpeedChange::Step()
|
||||
/* Fill as much data as we might need to do the search and use the result. */
|
||||
{
|
||||
int iMaxPositionNeeded = m_iUncorrelatedPos + GetToleranceFrames() + GetWindowSizeFrames();
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
iMaxPositionNeeded = std::max( iMaxPositionNeeded, m_Channels[i].m_iCorrelatedPos + GetWindowSizeFrames() );
|
||||
|
||||
int iGot = FillData( iMaxPositionNeeded );
|
||||
@@ -212,7 +212,7 @@ int RageSoundReader_SpeedChange::Step()
|
||||
int iCorrelatedToMatch = GetWindowSizeFrames()/4;
|
||||
int iUncorrelatedToMatch = GetToleranceFrames() + iCorrelatedToMatch; // maximum distance to search
|
||||
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ChannelInfo &c = m_Channels[i];
|
||||
ASSERT( c.m_iCorrelatedPos >= 0 );
|
||||
@@ -229,7 +229,7 @@ int RageSoundReader_SpeedChange::Step()
|
||||
int RageSoundReader_SpeedChange::GetCursorAvail() const
|
||||
{
|
||||
int iCursorAvail = GetWindowSizeFrames() - m_iPos;
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
int iCursorAvailForChannel = (m_iDataBufferAvailFrames-m_Channels[i].m_iCorrelatedPos) - m_iPos;
|
||||
iCursorAvail = std::min( iCursorAvail, iCursorAvailForChannel );
|
||||
@@ -275,7 +275,7 @@ int RageSoundReader_SpeedChange::Read( float *pBuf, int iFrames )
|
||||
int iWindowSizeFrames = GetWindowSizeFrames();
|
||||
while( iFramesAvail-- )
|
||||
{
|
||||
for( std::size_t i = 0; i < m_Channels.size(); ++i )
|
||||
for( size_t i = 0; i < m_Channels.size(); ++i )
|
||||
{
|
||||
ChannelInfo &c = m_Channels[i];
|
||||
float i1 = c.m_DataBuffer[c.m_iCorrelatedPos+m_iPos];
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
||||
static std::size_t OggRageFile_read_func( void *ptr, std::size_t size, std::size_t nmemb, void *datasource )
|
||||
static size_t OggRageFile_read_func( void *ptr, size_t size, size_t nmemb, void *datasource )
|
||||
{
|
||||
RageFileBasic *f = (RageFileBasic *) datasource;
|
||||
return f->Read( ptr, size, nmemb );
|
||||
|
||||
@@ -859,7 +859,7 @@ RageSurface *RageSurfaceUtils::PalettizeToGrayscale( const RageSurface *src_surf
|
||||
const unsigned int Amask = ((1u << AlphaBits) - 1u) << Ashift; // alpha mask
|
||||
const unsigned int Aloss = 8u-AlphaBits;
|
||||
|
||||
for( std::size_t index = 0; index < TotalColors; ++index )
|
||||
for( size_t index = 0; index < TotalColors; ++index )
|
||||
{
|
||||
const unsigned int I = (index & Imask) >> Ishift;
|
||||
const unsigned int A = (index & Amask) >> Ashift;
|
||||
|
||||
@@ -68,7 +68,7 @@ void RageFile_JPEG_init_source( j_decompress_ptr cinfo )
|
||||
boolean RageFile_JPEG_fill_input_buffer( j_decompress_ptr cinfo )
|
||||
{
|
||||
RageFile_source_mgr *src = (RageFile_source_mgr *) cinfo->src;
|
||||
std::size_t nbytes = src->file->Read( src->buffer, sizeof(src->buffer) );
|
||||
size_t nbytes = src->file->Read( src->buffer, sizeof(src->buffer) );
|
||||
|
||||
if( nbytes <= 0 )
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ bool RageSurfaceUtils::SaveJPEG( RageSurface *surface, RageFile &f, bool bHighQu
|
||||
|
||||
/* Now we can initialize the JPEG compression object. */
|
||||
jpeg::jpeg_CreateCompress(&cinfo, JPEG_LIB_VERSION, \
|
||||
(std::size_t) sizeof(struct jpeg::jpeg_compress_struct));
|
||||
(size_t) sizeof(struct jpeg::jpeg_compress_struct));
|
||||
|
||||
cinfo.image_width = surface->w; /* image width and height, in pixels */
|
||||
cinfo.image_height = surface->h;
|
||||
|
||||
+67
-67
@@ -29,7 +29,7 @@ const RString CUSTOM_SONG_PATH= "/@mem/";
|
||||
|
||||
bool HexToBinary(const RString&, RString&);
|
||||
void utf8_sanitize(RString &);
|
||||
void UnicodeUpperLower(wchar_t *, std::size_t, const unsigned char *);
|
||||
void UnicodeUpperLower(wchar_t *, size_t, const unsigned char *);
|
||||
|
||||
RandomGen g_RandomNumberGenerator;
|
||||
|
||||
@@ -148,7 +148,7 @@ bool IsAnInt( const RString &s )
|
||||
if( !s.size() )
|
||||
return false;
|
||||
|
||||
for( std::size_t i=0; i < s.size(); ++i )
|
||||
for( size_t i=0; i < s.size(); ++i )
|
||||
if( s[i] < '0' || s[i] > '9' )
|
||||
return false;
|
||||
|
||||
@@ -160,7 +160,7 @@ bool IsHexVal( const RString &s )
|
||||
if( !s.size() )
|
||||
return false;
|
||||
|
||||
for( std::size_t i=0; i < s.size(); ++i )
|
||||
for( size_t i=0; i < s.size(); ++i )
|
||||
if( !(s[i] >= '0' && s[i] <= '9') &&
|
||||
!(toupper(s[i]) >= 'A' && toupper(s[i]) <= 'F'))
|
||||
return false;
|
||||
@@ -168,11 +168,11 @@ bool IsHexVal( const RString &s )
|
||||
return true;
|
||||
}
|
||||
|
||||
RString BinaryToHex( const void *pData_, std::size_t iNumBytes )
|
||||
RString BinaryToHex( const void *pData_, size_t iNumBytes )
|
||||
{
|
||||
const unsigned char *pData = (const unsigned char *) pData_;
|
||||
RString s;
|
||||
for( std::size_t i=0; i<iNumBytes; i++ )
|
||||
for( size_t i=0; i<iNumBytes; i++ )
|
||||
{
|
||||
unsigned val = pData[i];
|
||||
s += ssprintf( "%02x", val );
|
||||
@@ -310,10 +310,10 @@ RString Commify( int iNum )
|
||||
|
||||
RString Commify(const RString& num, const RString& sep, const RString& dot)
|
||||
{
|
||||
std::size_t num_start= 0;
|
||||
std::size_t num_end= num.size();
|
||||
std::size_t dot_pos= num.find(dot);
|
||||
std::size_t dash_pos= num.find('-');
|
||||
size_t num_start= 0;
|
||||
size_t num_end= num.size();
|
||||
size_t dot_pos= num.find(dot);
|
||||
size_t dash_pos= num.find('-');
|
||||
if(dot_pos != std::string::npos)
|
||||
{
|
||||
num_end= dot_pos;
|
||||
@@ -322,22 +322,22 @@ RString Commify(const RString& num, const RString& sep, const RString& dot)
|
||||
{
|
||||
num_start= dash_pos + 1;
|
||||
}
|
||||
std::size_t num_size= num_end - num_start;
|
||||
std::size_t commies= (num_size / 3) - (!(num_size % 3));
|
||||
size_t num_size= num_end - num_start;
|
||||
size_t commies= (num_size / 3) - (!(num_size % 3));
|
||||
if(commies < 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
std::size_t commified_len= num.size() + (commies * sep.size());
|
||||
size_t commified_len= num.size() + (commies * sep.size());
|
||||
RString ret;
|
||||
ret.resize(commified_len);
|
||||
std::size_t dest= 0;
|
||||
std::size_t next_comma= (num_size % 3) + (3 * (!(num_size % 3))) + num_start;
|
||||
for(std::size_t c= 0; c < num.size(); ++c)
|
||||
size_t dest= 0;
|
||||
size_t next_comma= (num_size % 3) + (3 * (!(num_size % 3))) + num_start;
|
||||
for(size_t c= 0; c < num.size(); ++c)
|
||||
{
|
||||
if(c == next_comma && c < num_end)
|
||||
{
|
||||
for(std::size_t s= 0; s < sep.size(); ++s)
|
||||
for(size_t s= 0; s < sep.size(); ++s)
|
||||
{
|
||||
ret[dest]= sep[s];
|
||||
++dest;
|
||||
@@ -477,17 +477,17 @@ RString ConvertI64FormatString( const RString &sStr )
|
||||
RString sRet;
|
||||
sRet.reserve( sStr.size() + 16 );
|
||||
|
||||
std::size_t iOffset = 0;
|
||||
size_t iOffset = 0;
|
||||
while( iOffset < sStr.size() )
|
||||
{
|
||||
std::size_t iPercent = sStr.find( '%', iOffset );
|
||||
size_t iPercent = sStr.find( '%', iOffset );
|
||||
if( iPercent != sStr.npos )
|
||||
{
|
||||
sRet.append( sStr, iOffset, iPercent - iOffset );
|
||||
iOffset = iPercent;
|
||||
}
|
||||
|
||||
std::size_t iEnd = sStr.find_first_of( "diouxXeEfFgGaAcsCSpnm%", iOffset + 1 );
|
||||
size_t iEnd = sStr.find_first_of( "diouxXeEfFgGaAcsCSpnm%", iOffset + 1 );
|
||||
if( iEnd != sStr.npos && iEnd - iPercent >= 3 && iPercent > 2 && sStr[iEnd-2] == 'l' && sStr[iEnd-1] == 'l' )
|
||||
{
|
||||
sRet.append( sStr, iPercent, iEnd - iPercent - 2 ); // %
|
||||
@@ -678,9 +678,9 @@ RString join( const RString &sDeliminator, const std::vector<RString> &sSource)
|
||||
return RString();
|
||||
|
||||
RString sTmp;
|
||||
std::size_t final_size= 0;
|
||||
std::size_t delim_size= sDeliminator.size();
|
||||
for(std::size_t n= 0; n < sSource.size()-1; ++n)
|
||||
size_t final_size= 0;
|
||||
size_t delim_size= sDeliminator.size();
|
||||
for(size_t n= 0; n < sSource.size()-1; ++n)
|
||||
{
|
||||
final_size+= sSource[n].size() + delim_size;
|
||||
}
|
||||
@@ -702,8 +702,8 @@ RString join( const RString &sDelimitor, std::vector<RString>::const_iterator be
|
||||
return RString();
|
||||
|
||||
RString sRet;
|
||||
std::size_t final_size= 0;
|
||||
std::size_t delim_size= sDelimitor.size();
|
||||
size_t final_size= 0;
|
||||
size_t delim_size= sDelimitor.size();
|
||||
for(std::vector<RString>::const_iterator curr= begin; curr != end; ++curr)
|
||||
{
|
||||
final_size+= curr->size();
|
||||
@@ -822,10 +822,10 @@ void do_split( const S &Source, const C Delimitor, std::vector<S> &AddIt, const
|
||||
if( Source.empty() )
|
||||
return;
|
||||
|
||||
std::size_t startpos = 0;
|
||||
size_t startpos = 0;
|
||||
|
||||
do {
|
||||
std::size_t pos;
|
||||
size_t pos;
|
||||
pos = Source.find( Delimitor, startpos );
|
||||
if( pos == Source.npos )
|
||||
pos = Source.size();
|
||||
@@ -907,7 +907,7 @@ void do_split( const S &Source, const S &Delimitor, int &begin, int &size, int l
|
||||
|
||||
/* Where's the string function to find within a substring?
|
||||
* C++ strings apparently are missing that ... */
|
||||
std::size_t pos;
|
||||
size_t pos;
|
||||
if( Delimitor.size() == 1 )
|
||||
pos = Source.find( Delimitor[0], begin );
|
||||
else
|
||||
@@ -996,11 +996,11 @@ RString SetExtension( const RString &sPath, const RString &sExt )
|
||||
|
||||
RString GetExtension( const RString &sPath )
|
||||
{
|
||||
std::size_t pos = sPath.rfind( '.' );
|
||||
size_t pos = sPath.rfind( '.' );
|
||||
if( pos == sPath.npos )
|
||||
return RString();
|
||||
|
||||
std::size_t slash = sPath.find( '/', pos );
|
||||
size_t slash = sPath.find( '/', pos );
|
||||
if( slash != sPath.npos )
|
||||
return RString(); /* rare: path/dir.ext/fn */
|
||||
|
||||
@@ -1046,11 +1046,11 @@ bool FindFirstFilenameContaining(const std::vector<RString>& filenames,
|
||||
RString& out, const std::vector<RString>& starts_with,
|
||||
const std::vector<RString>& contains, const std::vector<RString>& ends_with)
|
||||
{
|
||||
for(std::size_t i= 0; i < filenames.size(); ++i)
|
||||
for(size_t i= 0; i < filenames.size(); ++i)
|
||||
{
|
||||
RString lower= GetFileNameWithoutExtension(filenames[i]);
|
||||
lower.MakeLower();
|
||||
for(std::size_t s= 0; s < starts_with.size(); ++s)
|
||||
for(size_t s= 0; s < starts_with.size(); ++s)
|
||||
{
|
||||
if(!lower.compare(0, starts_with[s].size(), starts_with[s]))
|
||||
{
|
||||
@@ -1058,12 +1058,12 @@ bool FindFirstFilenameContaining(const std::vector<RString>& filenames,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
std::size_t lower_size= lower.size();
|
||||
for(std::size_t s= 0; s < ends_with.size(); ++s)
|
||||
size_t lower_size= lower.size();
|
||||
for(size_t s= 0; s < ends_with.size(); ++s)
|
||||
{
|
||||
if(lower_size >= ends_with[s].size())
|
||||
{
|
||||
std::size_t end_pos= lower_size - ends_with[s].size();
|
||||
size_t end_pos= lower_size - ends_with[s].size();
|
||||
if(!lower.compare(end_pos, std::string::npos, ends_with[s]))
|
||||
{
|
||||
out= filenames[i];
|
||||
@@ -1071,7 +1071,7 @@ bool FindFirstFilenameContaining(const std::vector<RString>& filenames,
|
||||
}
|
||||
}
|
||||
}
|
||||
for(std::size_t s= 0; s < contains.size(); ++s)
|
||||
for(size_t s= 0; s < contains.size(); ++s)
|
||||
{
|
||||
if(lower.find(contains[s]) != std::string::npos)
|
||||
{
|
||||
@@ -1111,7 +1111,7 @@ bool GetCommandlineArgument( const RString &option, RString *argument, int iInde
|
||||
{
|
||||
const RString CurArgument = g_argv[arg];
|
||||
|
||||
const std::size_t i = CurArgument.find( "=" );
|
||||
const size_t i = CurArgument.find( "=" );
|
||||
RString CurOption = CurArgument.substr(0,i);
|
||||
if( CurOption.CompareNoCase(optstr) )
|
||||
continue; // no match
|
||||
@@ -1151,7 +1151,7 @@ RString GetCwd()
|
||||
* http://www.theorem.com/java/CRC32.java,
|
||||
* http://www.faqs.org/rfcs/rfc1952.html
|
||||
*/
|
||||
void CRC32( unsigned int &iCRC, const void *pVoidBuffer, std::size_t iSize )
|
||||
void CRC32( unsigned int &iCRC, const void *pVoidBuffer, size_t iSize )
|
||||
{
|
||||
static unsigned tab[256];
|
||||
static bool initted = false;
|
||||
@@ -1663,7 +1663,7 @@ bool utf8_to_wchar_ec( const RString &s, unsigned &start, wchar_t &ch )
|
||||
}
|
||||
|
||||
/* Like utf8_to_wchar_ec, but only does enough error checking to prevent crashing. */
|
||||
bool utf8_to_wchar( const char *s, std::size_t iLength, unsigned &start, wchar_t &ch )
|
||||
bool utf8_to_wchar( const char *s, size_t iLength, unsigned &start, wchar_t &ch )
|
||||
{
|
||||
if( start >= iLength )
|
||||
return false;
|
||||
@@ -1791,7 +1791,7 @@ void utf8_remove_bom( RString &sLine )
|
||||
sLine.erase(0, 3);
|
||||
}
|
||||
|
||||
static int UnicodeDoUpper( char *p, std::size_t iLen, const unsigned char pMapping[256] )
|
||||
static int UnicodeDoUpper( char *p, size_t iLen, const unsigned char pMapping[256] )
|
||||
{
|
||||
// Note: this has problems with certain accented characters. -aj
|
||||
wchar_t wc = L'\0';
|
||||
@@ -1818,7 +1818,7 @@ static int UnicodeDoUpper( char *p, std::size_t iLen, const unsigned char pMappi
|
||||
/* Fast in-place MakeUpper and MakeLower. This only replaces characters with characters of the same UTF-8
|
||||
* length, so we never have to move the whole string. This is optimized for strings that have no
|
||||
* non-ASCII characters. */
|
||||
void MakeUpper( char *p, std::size_t iLen )
|
||||
void MakeUpper( char *p, size_t iLen )
|
||||
{
|
||||
char *pStart = p;
|
||||
char *pEnd = p + iLen;
|
||||
@@ -1838,7 +1838,7 @@ void MakeUpper( char *p, std::size_t iLen )
|
||||
}
|
||||
}
|
||||
|
||||
void MakeLower( char *p, std::size_t iLen )
|
||||
void MakeLower( char *p, size_t iLen )
|
||||
{
|
||||
char *pStart = p;
|
||||
char *pEnd = p + iLen;
|
||||
@@ -1858,7 +1858,7 @@ void MakeLower( char *p, std::size_t iLen )
|
||||
}
|
||||
}
|
||||
|
||||
void UnicodeUpperLower( wchar_t *p, std::size_t iLen, const unsigned char pMapping[256] )
|
||||
void UnicodeUpperLower( wchar_t *p, size_t iLen, const unsigned char pMapping[256] )
|
||||
{
|
||||
wchar_t *pEnd = p + iLen;
|
||||
while( p != pEnd )
|
||||
@@ -1876,12 +1876,12 @@ void UnicodeUpperLower( wchar_t *p, std::size_t iLen, const unsigned char pMappi
|
||||
}
|
||||
}
|
||||
|
||||
void MakeUpper( wchar_t *p, std::size_t iLen )
|
||||
void MakeUpper( wchar_t *p, size_t iLen )
|
||||
{
|
||||
UnicodeUpperLower( p, iLen, g_UpperCase );
|
||||
}
|
||||
|
||||
void MakeLower( wchar_t *p, std::size_t iLen )
|
||||
void MakeLower( wchar_t *p, size_t iLen )
|
||||
{
|
||||
UnicodeUpperLower( p, iLen, g_LowerCase );
|
||||
}
|
||||
@@ -1911,7 +1911,7 @@ RString FloatToString( const float &num )
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
int StringToInt( const std::string& str, std::size_t* pos, int base, int exceptVal )
|
||||
int StringToInt( const std::string& str, size_t* pos, int base, int exceptVal )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1926,7 +1926,7 @@ int StringToInt( const std::string& str, std::size_t* pos, int base, int exceptV
|
||||
return exceptVal;
|
||||
}
|
||||
|
||||
long StringToLong( const std::string& str, std::size_t* pos, int base, long exceptVal )
|
||||
long StringToLong( const std::string& str, size_t* pos, int base, long exceptVal )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1941,7 +1941,7 @@ long StringToLong( const std::string& str, std::size_t* pos, int base, long exce
|
||||
return exceptVal;
|
||||
}
|
||||
|
||||
long long StringToLLong( const std::string& str, std::size_t* pos, int base, long long exceptVal )
|
||||
long long StringToLLong( const std::string& str, size_t* pos, int base, long long exceptVal )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -2004,10 +2004,10 @@ void ReplaceEntityText( RString &sText, const std::map<RString, RString> &m )
|
||||
{
|
||||
RString sRet;
|
||||
|
||||
std::size_t iOffset = 0;
|
||||
size_t iOffset = 0;
|
||||
while( iOffset != sText.size() )
|
||||
{
|
||||
std::size_t iStart = sText.find( '&', iOffset );
|
||||
size_t iStart = sText.find( '&', iOffset );
|
||||
if( iStart == sText.npos )
|
||||
{
|
||||
// Optimization: if we didn't replace anything at all, do nothing.
|
||||
@@ -2024,7 +2024,7 @@ void ReplaceEntityText( RString &sText, const std::map<RString, RString> &m )
|
||||
iOffset += iStart-iOffset;
|
||||
|
||||
// Optimization: stop early on "&", so "&&&&&&&&&&&" isn't n^2.
|
||||
std::size_t iEnd = sText.find_first_of( "&;", iStart+1 );
|
||||
size_t iEnd = sText.find_first_of( "&;", iStart+1 );
|
||||
if( iEnd == sText.npos || sText[iEnd] == '&' )
|
||||
{
|
||||
// & with no matching ;, or two & in a row. Append the & and continue.
|
||||
@@ -2062,10 +2062,10 @@ void ReplaceEntityText( RString &sText, const std::map<char, RString> &m )
|
||||
|
||||
RString sRet;
|
||||
|
||||
std::size_t iOffset = 0;
|
||||
size_t iOffset = 0;
|
||||
while( iOffset != sText.size() )
|
||||
{
|
||||
std::size_t iStart = sText.find_first_of( sFind, iOffset );
|
||||
size_t iStart = sText.find_first_of( sFind, iOffset );
|
||||
if( iStart == sText.npos )
|
||||
{
|
||||
// Optimization: if we didn't replace anything at all, do nothing.
|
||||
@@ -2104,7 +2104,7 @@ void Replace_Unicode_Markers( RString &sText )
|
||||
{
|
||||
// Look for &#digits;
|
||||
bool bHex = false;
|
||||
std::size_t iPos = sText.find( "&#", iStart );
|
||||
size_t iPos = sText.find( "&#", iStart );
|
||||
if( iPos == sText.npos )
|
||||
{
|
||||
bHex = true;
|
||||
@@ -2160,11 +2160,11 @@ RString WcharDisplayText( wchar_t c )
|
||||
*/
|
||||
RString Basename( const RString &sDir )
|
||||
{
|
||||
std::size_t iEnd = sDir.find_last_not_of( "/\\" );
|
||||
size_t iEnd = sDir.find_last_not_of( "/\\" );
|
||||
if( iEnd == sDir.npos )
|
||||
return RString();
|
||||
|
||||
std::size_t iStart = sDir.find_last_of( "/\\", iEnd );
|
||||
size_t iStart = sDir.find_last_of( "/\\", iEnd );
|
||||
if( iStart == sDir.npos )
|
||||
iStart = 0;
|
||||
else
|
||||
@@ -2281,8 +2281,8 @@ void CollapsePath( RString &sPath, bool bRemoveLeadingDot )
|
||||
RString sOut;
|
||||
sOut.reserve( sPath.size() );
|
||||
|
||||
std::size_t iPos = 0;
|
||||
std::size_t iNext;
|
||||
size_t iPos = 0;
|
||||
size_t iNext;
|
||||
for( ; iPos < sPath.size(); iPos = iNext )
|
||||
{
|
||||
// Find the next slash.
|
||||
@@ -2318,7 +2318,7 @@ void CollapsePath( RString &sPath, bool bRemoveLeadingDot )
|
||||
}
|
||||
|
||||
// Search backwards for the previous path element.
|
||||
std::size_t iPrev = sOut.rfind( '/', sOut.size()-2 );
|
||||
size_t iPrev = sOut.rfind( '/', sOut.size()-2 );
|
||||
if( iPrev == RString::npos )
|
||||
iPrev = 0;
|
||||
else
|
||||
@@ -2493,7 +2493,7 @@ LuaFunction( lerp, lerp(FArg(1), FArg(2), FArg(3)) );
|
||||
int LuaFunc_BinaryToHex(lua_State* L);
|
||||
int LuaFunc_BinaryToHex(lua_State* L)
|
||||
{
|
||||
std::size_t l;
|
||||
size_t l;
|
||||
const char *s = luaL_checklstring(L, 1, &l);
|
||||
|
||||
RString hex = BinaryToHex(s, l);
|
||||
@@ -2561,7 +2561,7 @@ int LuaFunc_JsonEncode(lua_State* L)
|
||||
return Json::Value(val);
|
||||
}
|
||||
case LUA_TSTRING: {
|
||||
std::size_t len;
|
||||
size_t len;
|
||||
const char *s = lua_tolstring(L, index, &len);
|
||||
|
||||
return Json::Value(std::string(s, len));
|
||||
@@ -2575,7 +2575,7 @@ int LuaFunc_JsonEncode(lua_State* L)
|
||||
index = lua_gettop(L) + index + 1;
|
||||
}
|
||||
|
||||
std::size_t len = lua_objlen(L, index);
|
||||
size_t len = lua_objlen(L, index);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
@@ -2605,7 +2605,7 @@ int LuaFunc_JsonEncode(lua_State* L)
|
||||
luaL_error(L, "object keys must be strings");
|
||||
}
|
||||
|
||||
std::size_t keylen;
|
||||
size_t keylen;
|
||||
const char *key = lua_tolstring(L, -2, &keylen);
|
||||
obj[std::string(key, keylen)] = convert(-1);
|
||||
lua_pop(L, 1);
|
||||
@@ -2654,7 +2654,7 @@ int LuaFunc_JsonDecode(lua_State* L)
|
||||
luaL_error(L, "JsonDecode requires an argument");
|
||||
}
|
||||
|
||||
std::size_t datalen;
|
||||
size_t datalen;
|
||||
const char *data = lua_tolstring(L, 1, &datalen);
|
||||
|
||||
Json::Reader reader;
|
||||
@@ -2763,9 +2763,9 @@ int LuaFunc_multiapproach(lua_State* L)
|
||||
{
|
||||
luaL_error(L, "multiapproach: A table of current values, a table of goal values, and a table of speeds must be passed.");
|
||||
}
|
||||
std::size_t currents_len= lua_objlen(L, 1);
|
||||
std::size_t goals_len= lua_objlen(L, 2);
|
||||
std::size_t speeds_len= lua_objlen(L, 3);
|
||||
size_t currents_len= lua_objlen(L, 1);
|
||||
size_t goals_len= lua_objlen(L, 2);
|
||||
size_t speeds_len= lua_objlen(L, 3);
|
||||
float mult= 1.0f;
|
||||
if(lua_isnumber(L, 4))
|
||||
{
|
||||
@@ -2779,7 +2779,7 @@ int LuaFunc_multiapproach(lua_State* L)
|
||||
{
|
||||
luaL_error(L, "multiapproach: current, goal, and speed must all be tables.");
|
||||
}
|
||||
for(std::size_t i= 1; i <= currents_len; ++i)
|
||||
for(size_t i= 1; i <= currents_len; ++i)
|
||||
{
|
||||
lua_rawgeti(L, 1, i);
|
||||
lua_rawgeti(L, 2, i);
|
||||
|
||||
+11
-11
@@ -331,7 +331,7 @@ float fmodfp( float x, float y );
|
||||
int power_of_two( int input );
|
||||
bool IsAnInt( const RString &s );
|
||||
bool IsHexVal( const RString &s );
|
||||
RString BinaryToHex( const void *pData_, std::size_t iNumBytes );
|
||||
RString BinaryToHex( const void *pData_, size_t iNumBytes );
|
||||
RString BinaryToHex( const RString &sString );
|
||||
bool HexToBinary( const RString &s, unsigned char *stringOut );
|
||||
bool HexToBinary( const RString &s, RString *sOut );
|
||||
@@ -378,16 +378,16 @@ bool FindFirstFilenameContaining(
|
||||
extern const wchar_t INVALID_CHAR;
|
||||
|
||||
int utf8_get_char_len( char p );
|
||||
bool utf8_to_wchar( const char *s, std::size_t iLength, unsigned &start, wchar_t &ch );
|
||||
bool utf8_to_wchar( const char *s, size_t iLength, unsigned &start, wchar_t &ch );
|
||||
bool utf8_to_wchar_ec( const RString &s, unsigned &start, wchar_t &ch );
|
||||
void wchar_to_utf8( wchar_t ch, RString &out );
|
||||
wchar_t utf8_get_char( const RString &s );
|
||||
bool utf8_is_valid( const RString &s );
|
||||
void utf8_remove_bom( RString &s );
|
||||
void MakeUpper( char *p, std::size_t iLen );
|
||||
void MakeLower( char *p, std::size_t iLen );
|
||||
void MakeUpper( wchar_t *p, std::size_t iLen );
|
||||
void MakeLower( wchar_t *p, std::size_t iLen );
|
||||
void MakeUpper( char *p, size_t iLen );
|
||||
void MakeLower( char *p, size_t iLen );
|
||||
void MakeUpper( wchar_t *p, size_t iLen );
|
||||
void MakeLower( wchar_t *p, size_t iLen );
|
||||
|
||||
// TODO: Have the three functions below be moved to better locations.
|
||||
float StringToFloat( const RString &sString );
|
||||
@@ -401,9 +401,9 @@ inline bool operator>>(const RString& lhs, T& rhs)
|
||||
|
||||
// Exception-safe wrappers around stoi and friends
|
||||
// Additional argument exceptVal will be returned if the conversion couldn't be performed
|
||||
int StringToInt( const std::string& str, std::size_t* pos = 0, int base = 10, int exceptVal = 0 );
|
||||
long StringToLong( const std::string& str, std::size_t* pos = 0, int base = 10, long exceptVal = 0 );
|
||||
long long StringToLLong( const std::string& str, std::size_t* pos = 0, int base = 10, long long exceptVal = 0 );
|
||||
int StringToInt( const std::string& str, size_t* pos = 0, int base = 10, int exceptVal = 0 );
|
||||
long StringToLong( const std::string& str, size_t* pos = 0, int base = 10, long exceptVal = 0 );
|
||||
long long StringToLLong( const std::string& str, size_t* pos = 0, int base = 10, long long exceptVal = 0 );
|
||||
|
||||
RString WStringToRString( const std::wstring &sString );
|
||||
RString WcharToUTF8( wchar_t c );
|
||||
@@ -455,7 +455,7 @@ bool GetCommandlineArgument( const RString &option, RString *argument=nullptr, i
|
||||
extern int g_argc;
|
||||
extern char **g_argv;
|
||||
|
||||
void CRC32( unsigned int &iCRC, const void *pBuffer, std::size_t iSize );
|
||||
void CRC32( unsigned int &iCRC, const void *pBuffer, size_t iSize );
|
||||
unsigned int GetHashForString( const RString &s );
|
||||
unsigned int GetHashForFile( const RString &sPath );
|
||||
unsigned int GetHashForDirectory( const RString &sDir ); // a hash value that remains the same as long as nothing in the directory has changed
|
||||
@@ -571,7 +571,7 @@ struct char_traits_char_nocase: public std::char_traits<char>
|
||||
static inline bool lt( char c1, char c2 )
|
||||
{ return g_UpperCase[(unsigned char)c1] < g_UpperCase[(unsigned char)c2]; }
|
||||
|
||||
static int compare( const char* s1, const char* s2, std::size_t n )
|
||||
static int compare( const char* s1, const char* s2, size_t n )
|
||||
{
|
||||
int ret = 0;
|
||||
while( n-- )
|
||||
|
||||
@@ -51,19 +51,19 @@ static bool ConvertFromCharset( RString &sText, const char *szCharset )
|
||||
|
||||
/* Copy the string into a char* for iconv */
|
||||
ICONV_CONST char *szTextIn = const_cast<ICONV_CONST char*>( sText.data() );
|
||||
std::size_t iInLeft = sText.size();
|
||||
size_t iInLeft = sText.size();
|
||||
|
||||
/* Create a new string with enough room for the new conversion */
|
||||
RString sBuf;
|
||||
sBuf.resize( sText.size() * 5 );
|
||||
|
||||
char *sTextOut = const_cast<char*>( sBuf.data() );
|
||||
std::size_t iOutLeft = sBuf.size();
|
||||
std::size_t size = iconv( converter, &szTextIn, &iInLeft, &sTextOut, &iOutLeft );
|
||||
size_t iOutLeft = sBuf.size();
|
||||
size_t size = iconv( converter, &szTextIn, &iInLeft, &sTextOut, &iOutLeft );
|
||||
|
||||
iconv_close( converter );
|
||||
|
||||
if( size == (std::size_t)(-1) )
|
||||
if( size == (size_t)(-1) )
|
||||
{
|
||||
LOG->Trace( "%s\n", strerror( errno ) );
|
||||
return false; /* Returned an error */
|
||||
@@ -103,7 +103,7 @@ static bool ConvertFromCP( RString &sText, int iCodePage )
|
||||
|
||||
if( old == nullptr )
|
||||
return false;
|
||||
const std::size_t size = CFStringGetMaximumSizeForEncoding( CFStringGetLength(old), kCFStringEncodingUTF8 );
|
||||
const size_t size = CFStringGetMaximumSizeForEncoding( CFStringGetLength(old), kCFStringEncodingUTF8 );
|
||||
|
||||
char *buf = new char[size+1];
|
||||
buf[0] = '\0';
|
||||
|
||||
@@ -50,7 +50,7 @@ void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sCont
|
||||
* search instead of string match). */
|
||||
if( !sContaining.empty() )
|
||||
{
|
||||
std::size_t pos = sPath.find( sContaining, sBeginning.size() );
|
||||
size_t pos = sPath.find( sContaining, sBeginning.size() );
|
||||
if( pos == sPath.npos )
|
||||
continue; /* doesn't contain it */
|
||||
if( pos + sContaining.size() > unsigned(end_pos) )
|
||||
@@ -108,7 +108,7 @@ static void SplitPath( RString sPath, RString &sDir, RString &sName )
|
||||
if( sPath.Right(1) == "/" )
|
||||
sPath.erase( sPath.size()-1 );
|
||||
|
||||
std::size_t iSep = sPath.find_last_of( '/' );
|
||||
size_t iSep = sPath.find_last_of( '/' );
|
||||
if( iSep == RString::npos )
|
||||
{
|
||||
sDir = "";
|
||||
@@ -238,14 +238,14 @@ void FilenameDB::GetFilesEqualTo( const RString &sDir, const RString &sFile, std
|
||||
void FilenameDB::GetFilesSimpleMatch( const RString &sDir, const RString &sMask, std::vector<RString> &asOut, bool bOnlyDirs )
|
||||
{
|
||||
/* Does this contain a wildcard? */
|
||||
std::size_t first_pos = sMask.find_first_of( '*' );
|
||||
size_t first_pos = sMask.find_first_of( '*' );
|
||||
if( first_pos == sMask.npos )
|
||||
{
|
||||
/* No; just do a regular search. */
|
||||
GetFilesEqualTo( sDir, sMask, asOut, bOnlyDirs );
|
||||
return;
|
||||
}
|
||||
std::size_t second_pos = sMask.find_first_of( '*', first_pos+1 );
|
||||
size_t second_pos = sMask.find_first_of( '*', first_pos+1 );
|
||||
if( second_pos == sMask.npos )
|
||||
{
|
||||
/* Only one *: "A*B". */
|
||||
@@ -580,7 +580,7 @@ void FilenameDB::GetDirListing( const RString &sPath_, std::vector<RString> &asA
|
||||
ASSERT( !sPath.empty() );
|
||||
|
||||
/* Strip off the last path element and use it as a mask. */
|
||||
std::size_t pos = sPath.find_last_of( '/' );
|
||||
size_t pos = sPath.find_last_of( '/' );
|
||||
RString fn;
|
||||
if( pos == sPath.npos )
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ void ReceptorArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOff
|
||||
void ReceptorArrowRow::SetColumnRenderers(std::vector<NoteColumnRenderer>& renderers)
|
||||
{
|
||||
ASSERT_M(renderers.size() == m_ReceptorArrow.size(), "Notefield has different number of columns than receptor row.");
|
||||
for(std::size_t c= 0; c < m_ReceptorArrow.size(); ++c)
|
||||
for(size_t c= 0; c < m_ReceptorArrow.size(); ++c)
|
||||
{
|
||||
m_ReceptorArrow[c]->SetFakeParent(&(renderers[c]));
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
static RString PercentScoreWeightName( std::size_t i ) { return "PercentScoreWeight" + ScoreEventToString( (ScoreEvent)i ); }
|
||||
static RString GradeWeightName( std::size_t i ) { return "GradeWeight" + ScoreEventToString( (ScoreEvent)i ); }
|
||||
static RString PercentScoreWeightName( size_t i ) { return "PercentScoreWeight" + ScoreEventToString( (ScoreEvent)i ); }
|
||||
static RString GradeWeightName( size_t i ) { return "GradeWeight" + ScoreEventToString( (ScoreEvent)i ); }
|
||||
|
||||
static ThemeMetric1D<int> g_iPercentScoreWeight("ScoreKeeperNormal", PercentScoreWeightName, NUM_ScoreEvent );
|
||||
static ThemeMetric1D<int> g_iGradeWeight("ScoreKeeperNormal", GradeWeightName, NUM_ScoreEvent );
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
ThemeMetric<float> ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSeconds");
|
||||
|
||||
static void SuperMeterPercentChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
static void SuperMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut )
|
||||
{
|
||||
ScoreEvent ci = (ScoreEvent)i;
|
||||
sNameOut = "SuperMeterPercentChange" + ScoreEventToString( ci );
|
||||
|
||||
+5
-5
@@ -549,7 +549,7 @@ void ScreenEdit::LoadKeymapSectionIntoMappingsMember(XNode const* section, MapEd
|
||||
attr->second->GetValue(joined_names);
|
||||
std::vector<RString> key_names;
|
||||
split(joined_names, DEVICE_INPUT_SEPARATOR, key_names, false);
|
||||
for(std::size_t k= 0; k < key_names.size() && k < NUM_EDIT_TO_DEVICE_SLOTS; ++k)
|
||||
for(size_t k= 0; k < key_names.size() && k < NUM_EDIT_TO_DEVICE_SLOTS; ++k)
|
||||
{
|
||||
DeviceInput devi;
|
||||
devi.FromString(key_names[k]);
|
||||
@@ -1380,7 +1380,7 @@ static float g_fLastInsertAttackDurationSeconds = -1;
|
||||
static float g_fLastInsertAttackPositionSeconds = -1;
|
||||
static BackgroundLayer g_CurrentBGChangeLayer = BACKGROUND_LAYER_Invalid;
|
||||
|
||||
static void SetDefaultEditorNoteSkin( std::size_t num, RString &sNameOut, RString &defaultValueOut )
|
||||
static void SetDefaultEditorNoteSkin( size_t num, RString &sNameOut, RString &defaultValueOut )
|
||||
{
|
||||
sNameOut = ssprintf( "EditorNoteSkinP%d", int(num + 1) );
|
||||
|
||||
@@ -1698,7 +1698,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
std::vector<GameInput> GameI;
|
||||
GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->StyleInputToGameInput( t, PLAYER_1, GameI );
|
||||
float fSecsHeld= 0.0f;
|
||||
for(std::size_t i= 0; i < GameI.size(); ++i)
|
||||
for(size_t i= 0; i < GameI.size(); ++i)
|
||||
{
|
||||
fSecsHeld= std::max(fSecsHeld, INPUTMAPPER->GetSecsHeld(GameI[i]));
|
||||
}
|
||||
@@ -5018,7 +5018,7 @@ static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RS
|
||||
{
|
||||
std::vector<RString> mapping_input;
|
||||
split(mapstr, ",", mapping_input);
|
||||
std::size_t tracks_for_type= GAMEMAN->GetStepsTypeInfo(GAMESTATE->m_pCurSteps[0]->m_StepsType).iNumTracks;
|
||||
size_t tracks_for_type= GAMEMAN->GetStepsTypeInfo(GAMESTATE->m_pCurSteps[0]->m_StepsType).iNumTracks;
|
||||
if(mapping_input.size() > tracks_for_type)
|
||||
{
|
||||
error= TOO_MANY_TRACKS;
|
||||
@@ -5026,7 +5026,7 @@ static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RS
|
||||
}
|
||||
// mapping_input.size() < tracks_for_type is not checked because
|
||||
// unspecified tracks are mapped directly. -Kyz
|
||||
std::size_t track= 0;
|
||||
size_t track= 0;
|
||||
// track will be used for filling in the unspecified part of the mapping.
|
||||
for(; track < mapping_input.size(); ++track)
|
||||
{
|
||||
|
||||
@@ -267,7 +267,7 @@ void ScreenEvaluation::Init()
|
||||
{
|
||||
if( SUMMARY )
|
||||
{
|
||||
for( std::size_t i=0; i<m_pStageStats->m_vpPlayedSongs.size()
|
||||
for( size_t i=0; i<m_pStageStats->m_vpPlayedSongs.size()
|
||||
&& i < MAX_SONGS_TO_SHOW; i++ )
|
||||
{
|
||||
Song *pSong = m_pStageStats->m_vpPlayedSongs[i];
|
||||
|
||||
@@ -2101,7 +2101,7 @@ void ScreenGameplay::UpdateHasteRate()
|
||||
float scale_from_high= 1;
|
||||
float scale_to_low= 0;
|
||||
float scale_to_high=0;
|
||||
for(std::size_t turning_point= 0; turning_point < m_HasteTurningPoints.size();
|
||||
for(size_t turning_point= 0; turning_point < m_HasteTurningPoints.size();
|
||||
++turning_point)
|
||||
{
|
||||
float curr_turning_point= m_HasteTurningPoints[turning_point];
|
||||
@@ -2203,7 +2203,7 @@ void ScreenGameplay::UpdateLights()
|
||||
{
|
||||
std::vector<GameInput> gi;
|
||||
pStyle->StyleInputToGameInput( t, pi->m_pn, gi );
|
||||
for(std::size_t i= 0; i < gi.size(); ++i)
|
||||
for(size_t i= 0; i < gi.size(); ++i)
|
||||
{
|
||||
bBlinkGameButton[gi[i].controller][gi[i].button] = true;
|
||||
}
|
||||
@@ -2872,7 +2872,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
GAMESTATE->SetNewStageSeed();
|
||||
course->InvalidateTrailCache();
|
||||
course->RegenerateNonFixedTrails();
|
||||
std::size_t info_id= 0; // Can't use the player number in the playerinfo
|
||||
size_t info_id= 0; // Can't use the player number in the playerinfo
|
||||
// because it won't match up in 2-player.
|
||||
FOREACH_EnabledPlayerInfo(m_vPlayerInfo, pi)
|
||||
{
|
||||
@@ -3260,13 +3260,13 @@ public:
|
||||
static int GetHasteRate( T* p, lua_State *L ) { lua_pushnumber( L, p->GetHasteRate() ); return 1; }
|
||||
static bool TurningPointsValid(lua_State* L, int index)
|
||||
{
|
||||
std::size_t size= lua_objlen(L, index);
|
||||
size_t size= lua_objlen(L, index);
|
||||
if(size < 2)
|
||||
{
|
||||
luaL_error(L, "Invalid number of entries %zu", size);
|
||||
}
|
||||
float prev_turning= -1;
|
||||
for(std::size_t n= 1; n < size; ++n)
|
||||
for(size_t n= 1; n < size; ++n)
|
||||
{
|
||||
lua_pushnumber(L, n);
|
||||
lua_gettable(L, index);
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
RString COLUMN_DIFFICULTY_NAME( std::size_t i );
|
||||
RString COLUMN_STEPS_TYPE_NAME( std::size_t i );
|
||||
RString COLUMN_DIFFICULTY_NAME( size_t i );
|
||||
RString COLUMN_STEPS_TYPE_NAME( size_t i );
|
||||
|
||||
static const char *HighScoresTypeNames[] = {
|
||||
"AllSteps",
|
||||
@@ -205,8 +205,8 @@ void ScoreScroller::Load( RString sMetricsGroup )
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
RString COLUMN_DIFFICULTY_NAME( std::size_t i ) { return ssprintf("ColumnDifficulty%d",int(i+1)); }
|
||||
RString COLUMN_STEPS_TYPE_NAME( std::size_t i ) { return ssprintf("ColumnStepsType%d",int(i+1)); }
|
||||
RString COLUMN_DIFFICULTY_NAME( size_t i ) { return ssprintf("ColumnDifficulty%d",int(i+1)); }
|
||||
RString COLUMN_STEPS_TYPE_NAME( size_t i ) { return ssprintf("ColumnStepsType%d",int(i+1)); }
|
||||
|
||||
void ScreenHighScores::Init()
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user