Revert "Merge pull request #1888 from mwkroening/notes_loader-invalid_argument"
This reverts commit 56caf6da4b.
This commit is contained in:
committed by
Crystal Squirrel
parent
95aae05243
commit
6bd6963406
@@ -251,6 +251,8 @@ elseif(APPLE)
|
|||||||
"${SM_XCODE_DIR}/plistHelper.hpp"
|
"${SM_XCODE_DIR}/plistHelper.hpp"
|
||||||
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER
|
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/archutils/Darwin/StepMania.pch"
|
"${CMAKE_CURRENT_SOURCE_DIR}/archutils/Darwin/StepMania.pch"
|
||||||
|
XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS
|
||||||
|
"NO"
|
||||||
XCODE_ATTRIBUTE_LIBRARY_SEARCH_PATHS
|
XCODE_ATTRIBUTE_LIBRARY_SEARCH_PATHS
|
||||||
"${SM_XCODE_DIR}/Libraries")
|
"${SM_XCODE_DIR}/Libraries")
|
||||||
# XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
# XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
||||||
|
|||||||
@@ -11,17 +11,6 @@
|
|||||||
#include "TimingData.h"
|
#include "TimingData.h"
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
bool NoteDataUtil::StringInterpretsAs( const std::string& str, int integer ) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return std::stoi( str ) == integer;
|
|
||||||
}
|
|
||||||
catch ( const std::invalid_argument & )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Remove these constants that aren't time signature-aware
|
// TODO: Remove these constants that aren't time signature-aware
|
||||||
static const int BEATS_PER_MEASURE = 4;
|
static const int BEATS_PER_MEASURE = 4;
|
||||||
static const int ROWS_PER_MEASURE = ROWS_PER_BEAT * BEATS_PER_MEASURE;
|
static const int ROWS_PER_MEASURE = ROWS_PER_BEAT * BEATS_PER_MEASURE;
|
||||||
|
|||||||
@@ -23,11 +23,6 @@ void LightTransformHelper( const NoteData &in, NoteData &out, const vector<int>
|
|||||||
* and makes it much easier to change NoteData internally in the future. */
|
* and makes it much easier to change NoteData internally in the future. */
|
||||||
namespace NoteDataUtil
|
namespace NoteDataUtil
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @brief Whether a string can be interpreted as the provided signed integer
|
|
||||||
*/
|
|
||||||
bool StringInterpretsAs( const std::string& str, int integer );
|
|
||||||
|
|
||||||
NoteType GetSmallestNoteTypeForMeasure( const NoteData &nd, int iMeasureIndex );
|
NoteType GetSmallestNoteTypeForMeasure( const NoteData &nd, int iMeasureIndex );
|
||||||
NoteType GetSmallestNoteTypeInRange( const NoteData &nd, int iStartIndex, int iEndIndex );
|
NoteType GetSmallestNoteTypeInRange( const NoteData &nd, int iStartIndex, int iEndIndex );
|
||||||
void LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData, bool bComposite );
|
void LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData, bool bComposite );
|
||||||
|
|||||||
+10
-9
@@ -3,7 +3,6 @@
|
|||||||
#include "BackgroundUtil.h"
|
#include "BackgroundUtil.h"
|
||||||
#include "GameManager.h"
|
#include "GameManager.h"
|
||||||
#include "MsdFile.h"
|
#include "MsdFile.h"
|
||||||
#include "NoteDataUtil.h"
|
|
||||||
#include "NoteTypes.h"
|
#include "NoteTypes.h"
|
||||||
#include "RageFileManager.h"
|
#include "RageFileManager.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
@@ -975,26 +974,28 @@ bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vector<RS
|
|||||||
case 6:
|
case 6:
|
||||||
// param 7 overrides this.
|
// param 7 overrides this.
|
||||||
// Backward compatibility:
|
// Backward compatibility:
|
||||||
if( change.m_def.m_sEffect.empty() && !NoteDataUtil::StringInterpretsAs( aBGChangeValues[5], 0 ) )
|
if( change.m_def.m_sEffect.empty() )
|
||||||
{
|
{
|
||||||
change.m_def.m_sEffect = SBE_StretchNoLoop;
|
bool bLoop = std::stoi( aBGChangeValues[5] ) != 0;
|
||||||
|
if( !bLoop )
|
||||||
|
change.m_def.m_sEffect = SBE_StretchNoLoop;
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case 5:
|
case 5:
|
||||||
// param 7 overrides this.
|
// param 7 overrides this.
|
||||||
// Backward compatibility:
|
// Backward compatibility:
|
||||||
if( change.m_def.m_sEffect.empty() && !NoteDataUtil::StringInterpretsAs( aBGChangeValues[4], 0 ) )
|
if( change.m_def.m_sEffect.empty() )
|
||||||
{
|
{
|
||||||
change.m_def.m_sEffect = SBE_StretchRewind;
|
bool bRewindMovie = std::stoi( aBGChangeValues[4] ) != 0;
|
||||||
|
if( bRewindMovie )
|
||||||
|
change.m_def.m_sEffect = SBE_StretchRewind;
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case 4:
|
case 4:
|
||||||
// param 9 overrides this.
|
// param 9 overrides this.
|
||||||
// Backward compatibility:
|
// Backward compatibility:
|
||||||
if( change.m_sTransition.empty() && !NoteDataUtil::StringInterpretsAs( aBGChangeValues[3], 0 ) )
|
if( change.m_sTransition.empty() )
|
||||||
{
|
change.m_sTransition = (std::stoi( aBGChangeValues[3] ) != 0) ? "CrossFade" : "";
|
||||||
change.m_sTransition = SBT_CrossFade;
|
|
||||||
}
|
|
||||||
// fall through
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
change.m_fRate = StringToFloat( aBGChangeValues[2] );
|
change.m_fRate = StringToFloat( aBGChangeValues[2] );
|
||||||
|
|||||||
Reference in New Issue
Block a user