Decouple <cstddef>
This commit is contained in:
+22
-20
@@ -14,6 +14,8 @@
|
||||
#include "Attack.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
// Everything from this line to the creation of parser_helper exists to
|
||||
// speed up parsing by allowing the use of std::map. All these functions
|
||||
// are put into a map of function pointers which is used when loading.
|
||||
@@ -362,11 +364,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
|
||||
size_t cats_per_player= values.size() / NUM_PlayerNumber;
|
||||
std::size_t cats_per_player= values.size() / NUM_PlayerNumber;
|
||||
RadarValues v[NUM_PLAYERS];
|
||||
FOREACH_PlayerNumber(pn)
|
||||
{
|
||||
for(size_t i= 0; i < cats_per_player; ++i)
|
||||
for(std::size_t i= 0; i < cats_per_player; ++i)
|
||||
{
|
||||
v[pn][i]= StringToFloat(values[pn * cats_per_player + i]);
|
||||
}
|
||||
@@ -645,7 +647,7 @@ void SSCLoader::ProcessBPMs( TimingData &out, const RString sParam )
|
||||
{
|
||||
std::vector<RString> arrayBPMExpressions;
|
||||
split( sParam, ",", arrayBPMExpressions );
|
||||
|
||||
|
||||
for( unsigned b=0; b<arrayBPMExpressions.size(); b++ )
|
||||
{
|
||||
std::vector<RString> arrayBPMValues;
|
||||
@@ -658,7 +660,7 @@ void SSCLoader::ProcessBPMs( TimingData &out, const RString sParam )
|
||||
arrayBPMExpressions[b].c_str() );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
const float fBeat = StringToFloat( arrayBPMValues[0] );
|
||||
const float fNewBPM = StringToFloat( arrayBPMValues[1] );
|
||||
if( fBeat >= 0 && fNewBPM > 0 )
|
||||
@@ -679,7 +681,7 @@ void SSCLoader::ProcessStops( TimingData &out, const RString sParam )
|
||||
{
|
||||
std::vector<RString> arrayStopExpressions;
|
||||
split( sParam, ",", arrayStopExpressions );
|
||||
|
||||
|
||||
for( unsigned b=0; b<arrayStopExpressions.size(); b++ )
|
||||
{
|
||||
std::vector<RString> arrayStopValues;
|
||||
@@ -692,7 +694,7 @@ void SSCLoader::ProcessStops( TimingData &out, const RString sParam )
|
||||
arrayStopExpressions[b].c_str() );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
const float fBeat = StringToFloat( arrayStopValues[0] );
|
||||
const float fNewStop = StringToFloat( arrayStopValues[1] );
|
||||
if( fBeat >= 0 && fNewStop > 0 )
|
||||
@@ -711,7 +713,7 @@ void SSCLoader::ProcessWarps( TimingData &out, const RString sParam, const float
|
||||
{
|
||||
std::vector<RString> arrayWarpExpressions;
|
||||
split( sParam, ",", arrayWarpExpressions );
|
||||
|
||||
|
||||
for( unsigned b=0; b<arrayWarpExpressions.size(); b++ )
|
||||
{
|
||||
std::vector<RString> arrayWarpValues;
|
||||
@@ -724,7 +726,7 @@ void SSCLoader::ProcessWarps( TimingData &out, const RString sParam, const float
|
||||
arrayWarpExpressions[b].c_str() );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
const float fBeat = StringToFloat( arrayWarpValues[0] );
|
||||
const float fNewBeat = StringToFloat( arrayWarpValues[1] );
|
||||
// Early versions were absolute in beats. They should be relative.
|
||||
@@ -748,7 +750,7 @@ void SSCLoader::ProcessLabels( TimingData &out, const RString sParam )
|
||||
{
|
||||
std::vector<RString> arrayLabelExpressions;
|
||||
split( sParam, ",", arrayLabelExpressions );
|
||||
|
||||
|
||||
for( unsigned b=0; b<arrayLabelExpressions.size(); b++ )
|
||||
{
|
||||
std::vector<RString> arrayLabelValues;
|
||||
@@ -761,20 +763,20 @@ void SSCLoader::ProcessLabels( TimingData &out, const RString sParam )
|
||||
arrayLabelExpressions[b].c_str() );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
const float fBeat = StringToFloat( arrayLabelValues[0] );
|
||||
RString sLabel = arrayLabelValues[1];
|
||||
TrimRight(sLabel);
|
||||
if( fBeat >= 0.0f )
|
||||
out.AddSegment( LabelSegment(BeatToNoteRow(fBeat), sLabel) );
|
||||
else
|
||||
else
|
||||
{
|
||||
LOG->UserLog("Song file",
|
||||
this->GetSongTitle(),
|
||||
"has an invalid Label at beat %f called %s.",
|
||||
fBeat, sLabel.c_str() );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,7 +784,7 @@ void SSCLoader::ProcessCombos( TimingData &out, const RString line, const int ro
|
||||
{
|
||||
std::vector<RString> arrayComboExpressions;
|
||||
split( line, ",", arrayComboExpressions );
|
||||
|
||||
|
||||
for( unsigned f=0; f<arrayComboExpressions.size(); f++ )
|
||||
{
|
||||
std::vector<RString> arrayComboValues;
|
||||
@@ -807,12 +809,12 @@ void SSCLoader::ProcessScrolls( TimingData &out, const RString sParam )
|
||||
{
|
||||
std::vector<RString> vs1;
|
||||
split( sParam, ",", vs1 );
|
||||
|
||||
|
||||
for (RString const &s1 : vs1)
|
||||
{
|
||||
std::vector<RString> vs2;
|
||||
split( s1, "=", vs2 );
|
||||
|
||||
|
||||
if( vs2.size() < 2 )
|
||||
{
|
||||
LOG->UserLog("Song file",
|
||||
@@ -841,7 +843,7 @@ void SSCLoader::ProcessScrolls( TimingData &out, const RString sParam )
|
||||
bool SSCLoader::LoadNoteDataFromSimfile( const RString & cachePath, Steps &out )
|
||||
{
|
||||
LOG->Trace( "Loading notes from %s", cachePath.c_str() );
|
||||
|
||||
|
||||
MsdFile msd;
|
||||
if (!msd.ReadFile(cachePath, true))
|
||||
{
|
||||
@@ -851,11 +853,11 @@ bool SSCLoader::LoadNoteDataFromSimfile( const RString & cachePath, Steps &out )
|
||||
msd.GetError().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool tryingSteps = false;
|
||||
float storedVersion = 0;
|
||||
const unsigned values = msd.GetNumValues();
|
||||
|
||||
|
||||
for (unsigned i = 0; i < values; i++)
|
||||
{
|
||||
const MsdFile::value_t ¶ms = msd.GetValue(i);
|
||||
@@ -1222,7 +1224,7 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
||||
/*
|
||||
* (c) 2011 Jason Felds
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
@@ -1232,7 +1234,7 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
|
||||
Reference in New Issue
Block a user