The big NULL replacement party part 1.
This is meant to be a safer alternative since NULL can often be 0. Let's not rely on that. And yes, I know this is a lot of files. This is a safer thing to do in big commits vs for loops.
This commit is contained in:
+2
-2
@@ -1249,7 +1249,7 @@ void Actor::AddCommand( const RString &sCmdName, apActorCommands apac )
|
||||
|
||||
bool Actor::HasCommand( const RString &sCmdName ) const
|
||||
{
|
||||
return GetCommand(sCmdName) != NULL;
|
||||
return GetCommand(sCmdName) != nullptr;
|
||||
}
|
||||
|
||||
const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const
|
||||
@@ -1268,7 +1268,7 @@ void Actor::HandleMessage( const Message &msg )
|
||||
void Actor::PlayCommandNoRecurse( const Message &msg )
|
||||
{
|
||||
const apActorCommands *pCmd = GetCommand( msg.GetName() );
|
||||
if( pCmd != NULL )
|
||||
if( pCmd != nullptr )
|
||||
RunCommands( *pCmd, &msg.GetParamTable() );
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -145,7 +145,7 @@ void ActorFrame::AddChild( Actor *pActor )
|
||||
Dialog::OK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", GetLineage().c_str(), pActor->GetName().c_str()) );
|
||||
#endif
|
||||
|
||||
ASSERT( pActor != NULL );
|
||||
ASSERT( pActor != nullptr );
|
||||
ASSERT( (void*)pActor != (void*)0xC0000005 );
|
||||
m_SubActors.push_back( pActor );
|
||||
|
||||
@@ -285,14 +285,14 @@ void ActorFrame::PushChildrenTable( lua_State *L )
|
||||
void ActorFrame::PlayCommandOnChildren( const RString &sCommandName, const LuaReference *pParamTable )
|
||||
{
|
||||
const apActorCommands *pCmd = GetCommand( sCommandName );
|
||||
if( pCmd != NULL )
|
||||
if( pCmd != nullptr )
|
||||
RunCommandsOnChildren( *pCmd, pParamTable );
|
||||
}
|
||||
|
||||
void ActorFrame::PlayCommandOnLeaves( const RString &sCommandName, const LuaReference *pParamTable )
|
||||
{
|
||||
const apActorCommands *pCmd = GetCommand( sCommandName );
|
||||
if( pCmd != NULL )
|
||||
if( pCmd != nullptr )
|
||||
RunCommandsOnLeaves( **pCmd, pParamTable );
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void ActorMultiTexture::ClearTextures()
|
||||
|
||||
int ActorMultiTexture::AddTexture( RageTexture *pTexture )
|
||||
{
|
||||
ASSERT( pTexture != NULL );
|
||||
ASSERT( pTexture != nullptr );
|
||||
LOG->Trace( "ActorMultiTexture::AddTexture( %s )", pTexture->GetID().filename.c_str() );
|
||||
|
||||
m_aTextureUnits.push_back( TextureUnitState() );
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ bool ActorProxy::EarlyAbortDraw() const
|
||||
|
||||
void ActorProxy::DrawPrimitives()
|
||||
{
|
||||
if( m_pActorTarget != NULL )
|
||||
if( m_pActorTarget != nullptr )
|
||||
{
|
||||
bool bVisible = m_pActorTarget->GetVisible();
|
||||
m_pActorTarget->SetVisible( true );
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
static int GetTarget( T* p, lua_State *L )
|
||||
{
|
||||
Actor *pTarget = p->GetTarget();
|
||||
if( pTarget != NULL )
|
||||
if( pTarget != nullptr )
|
||||
pTarget->PushSelf( L );
|
||||
else
|
||||
lua_pushnil( L );
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ bool ActorUtil::ResolvePath( RString &sPath, const RString &sName )
|
||||
|
||||
Actor* ActorUtil::LoadFromNode( const XNode* pNode, Actor *pParentActor )
|
||||
{
|
||||
ASSERT( pNode != NULL );
|
||||
ASSERT( pNode != nullptr );
|
||||
|
||||
// Remove this in favor of using conditionals in Lua. -Chris
|
||||
// There are a number of themes out there that depend on this (including
|
||||
|
||||
@@ -120,7 +120,7 @@ RString AnnouncerManager::GetPathTo( RString sAnnouncerName, RString sFolderName
|
||||
|
||||
/* Search for the announcer folder in the list of aliases. */
|
||||
int i;
|
||||
for(i = 0; aliases[i][0] != NULL; ++i)
|
||||
for(i = 0; aliases[i][0] != nullptr; ++i)
|
||||
{
|
||||
if(!sFolderName.EqualsNoCase(aliases[i][0]))
|
||||
continue; /* no match */
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@
|
||||
|
||||
void Attack::GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const
|
||||
{
|
||||
ASSERT( pSong != NULL );
|
||||
ASSERT( pSong != nullptr );
|
||||
ASSERT_M( fStartSecond >= 0, ssprintf("StartSecond: %f",fStartSecond) );
|
||||
|
||||
const TimingData &timing = pSong->m_SongTiming;
|
||||
@@ -28,8 +28,8 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT( pPlayerState != NULL );
|
||||
ASSERT( pSong != NULL );
|
||||
ASSERT( pPlayerState != nullptr );
|
||||
ASSERT( pSong != nullptr );
|
||||
|
||||
/* If reasonable, push the attack forward 8 beats so that notes on screen don't change suddenly. */
|
||||
fStartBeat = min( GAMESTATE->m_Position.m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat );
|
||||
|
||||
@@ -46,7 +46,7 @@ void AttackDisplay::Init( const PlayerState* pPlayerState )
|
||||
for( int al=0; al<NUM_ATTACK_LEVELS; al++ )
|
||||
{
|
||||
const Character *ch = GAMESTATE->m_pCurCharacters[pn];
|
||||
ASSERT( ch != NULL );
|
||||
ASSERT( ch != nullptr );
|
||||
const RString* asAttacks = ch->m_sAttacks[al];
|
||||
for( int att = 0; att < NUM_ATTACKS_PER_LEVEL; ++att )
|
||||
attacks.insert( asAttacks[att] );
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public:
|
||||
/**
|
||||
* @brief Determine if this actor is presently loaded.
|
||||
* @return true if it is loaded, or false otherwise. */
|
||||
bool IsLoaded() const { return m_pActor != NULL; }
|
||||
bool IsLoaded() const { return m_pActor != nullptr; }
|
||||
void Load( Actor *pActor ); // transfer pointer
|
||||
void Load( const RString &sPath );
|
||||
void LoadB( const RString &sMetricsGroup, const RString &sElement ); // load a background and set up LuaThreadVariables for recursive loading
|
||||
|
||||
@@ -278,14 +278,14 @@ void AutoKeysounds::FinishLoading()
|
||||
delete pChain;
|
||||
}
|
||||
}
|
||||
ASSERT_M( m_pSharedSound != NULL, ssprintf("No keysounds were loaded for the song %s!", pSong->m_sMainTitle.c_str() ));
|
||||
ASSERT_M( m_pSharedSound != nullptr, ssprintf("No keysounds were loaded for the song %s!", pSong->m_sMainTitle.c_str() ));
|
||||
|
||||
m_pSharedSound = new RageSoundReader_PitchChange( m_pSharedSound );
|
||||
m_pSharedSound = new RageSoundReader_PostBuffering( m_pSharedSound );
|
||||
m_pSharedSound = new RageSoundReader_Pan( m_pSharedSound );
|
||||
apSounds.push_back( m_pSharedSound );
|
||||
|
||||
if( m_pPlayerSounds[0] != NULL )
|
||||
if( m_pPlayerSounds[0] != nullptr )
|
||||
{
|
||||
m_pPlayerSounds[0] = new RageSoundReader_PitchChange( m_pPlayerSounds[0] );
|
||||
m_pPlayerSounds[0] = new RageSoundReader_PostBuffering( m_pPlayerSounds[0] );
|
||||
@@ -293,7 +293,7 @@ void AutoKeysounds::FinishLoading()
|
||||
apSounds.push_back( m_pPlayerSounds[0] );
|
||||
}
|
||||
|
||||
if( m_pPlayerSounds[1] != NULL )
|
||||
if( m_pPlayerSounds[1] != nullptr )
|
||||
{
|
||||
m_pPlayerSounds[1] = new RageSoundReader_PitchChange( m_pPlayerSounds[1] );
|
||||
m_pPlayerSounds[1] = new RageSoundReader_PostBuffering( m_pPlayerSounds[1] );
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo
|
||||
for (RString const &sLayer : vsLayerNames)
|
||||
{
|
||||
const XNode* pKey = pNode->GetChild( sLayer );
|
||||
ASSERT( pKey != NULL );
|
||||
ASSERT( pKey != nullptr );
|
||||
|
||||
RString sImportDir;
|
||||
if( pKey->GetAttrValue("Import", sImportDir) )
|
||||
|
||||
+5
-5
@@ -179,7 +179,7 @@ void BPMDisplay::NoBPM()
|
||||
|
||||
void BPMDisplay::SetBpmFromSong( const Song* pSong )
|
||||
{
|
||||
ASSERT( pSong != NULL );
|
||||
ASSERT( pSong != nullptr );
|
||||
switch( pSong->m_DisplayBPMType )
|
||||
{
|
||||
case DISPLAY_BPM_ACTUAL:
|
||||
@@ -201,7 +201,7 @@ void BPMDisplay::SetBpmFromSong( const Song* pSong )
|
||||
|
||||
void BPMDisplay::SetBpmFromSteps( const Steps* pSteps )
|
||||
{
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
DisplayBpms bpms;
|
||||
float fMinBPM, fMaxBPM;
|
||||
pSteps->GetTimingData()->GetActualBPM( fMinBPM, fMaxBPM );
|
||||
@@ -212,13 +212,13 @@ void BPMDisplay::SetBpmFromSteps( const Steps* pSteps )
|
||||
|
||||
void BPMDisplay::SetBpmFromCourse( const Course* pCourse )
|
||||
{
|
||||
ASSERT( pCourse != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != NULL );
|
||||
ASSERT( pCourse != nullptr );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != nullptr );
|
||||
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
Trail *pTrail = pCourse->GetTrail( st );
|
||||
// GetTranslitFullTitle because "Crashinfo.txt is garbled because of the ANSI output as usual." -f
|
||||
ASSERT_M( pTrail != NULL, ssprintf("Course '%s' has no trail for StepsType '%s'", pCourse->GetTranslitFullTitle().c_str(), StringConversion::ToString(st).c_str() ) );
|
||||
ASSERT_M( pTrail != nullptr, ssprintf("Course '%s' has no trail for StepsType '%s'", pCourse->GetTranslitFullTitle().c_str(), StringConversion::ToString(st).c_str() ) );
|
||||
|
||||
m_fCycleTime = (float)COURSE_CYCLE_SPEED;
|
||||
|
||||
|
||||
+1
-1
@@ -373,7 +373,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
||||
|
||||
Actor *pActor = ActorUtil::MakeActor( sEffectFile );
|
||||
|
||||
ASSERT( pActor != NULL );
|
||||
ASSERT( pActor != nullptr );
|
||||
m_BGAnimations[bd] = pActor;
|
||||
|
||||
for( unsigned i=0; i<vsResolvedRef.size(); i++ )
|
||||
|
||||
+3
-3
@@ -203,7 +203,7 @@ struct BannerTexture: public RageTexture
|
||||
|
||||
void Create()
|
||||
{
|
||||
ASSERT( m_pImage != NULL );
|
||||
ASSERT( m_pImage != nullptr );
|
||||
|
||||
/* The image is preprocessed; do as little work as possible. */
|
||||
|
||||
@@ -239,7 +239,7 @@ struct BannerTexture: public RageTexture
|
||||
|
||||
ASSERT( DISPLAY->SupportsTextureFormat(pf) );
|
||||
|
||||
ASSERT(m_pImage != NULL);
|
||||
ASSERT(m_pImage != nullptr);
|
||||
m_uTexHandle = DISPLAY->CreateTexture( pf, m_pImage, false );
|
||||
|
||||
CreateFrameRects();
|
||||
@@ -290,7 +290,7 @@ RageTextureID BannerCache::LoadCachedBanner( RString sBannerPath )
|
||||
* when converting; this way, the conversion will end up in the map so we
|
||||
* only have to convert once. */
|
||||
RageSurface *&pImage = g_BannerPathToImage[sBannerPath];
|
||||
ASSERT( pImage != NULL );
|
||||
ASSERT( pImage != nullptr );
|
||||
|
||||
int iSourceWidth = 0, iSourceHeight = 0;
|
||||
BannerData.GetValue( sBannerPath, "Width", iSourceWidth );
|
||||
|
||||
@@ -149,7 +149,7 @@ bool BeginnerHelper::Init( int iDancePadType )
|
||||
|
||||
// Load character data
|
||||
const Character *Character = GAMESTATE->m_pCurCharacters[pl];
|
||||
ASSERT( Character != NULL );
|
||||
ASSERT( Character != nullptr );
|
||||
|
||||
m_pDancer[pl]->SetName( ssprintf("PlayerP%d",pl+1) );
|
||||
|
||||
@@ -204,7 +204,7 @@ void BeginnerHelper::AddPlayer( PlayerNumber pn, const NoteData &ns )
|
||||
return;
|
||||
|
||||
const Character *Character = GAMESTATE->m_pCurCharacters[pn];
|
||||
ASSERT( Character != NULL );
|
||||
ASSERT( Character != nullptr );
|
||||
if( !DoesFileExist(Character->GetModelPath()) )
|
||||
return;
|
||||
|
||||
|
||||
+4
-4
@@ -95,7 +95,7 @@ BitmapText & BitmapText::operator=(const BitmapText &cpy)
|
||||
if( m_pFont )
|
||||
FONT->UnloadFont( m_pFont );
|
||||
|
||||
if( cpy.m_pFont != NULL )
|
||||
if( cpy.m_pFont != nullptr )
|
||||
m_pFont = FONT->CopyFont( cpy.m_pFont );
|
||||
else
|
||||
m_pFont = NULL;
|
||||
@@ -363,7 +363,7 @@ void BitmapText::DrawChars( bool bUseStrokeTexture )
|
||||
* in sAlternateText, too, just use sText. */
|
||||
void BitmapText::SetText( const RString& _sText, const RString& _sAlternateText, int iWrapWidthPixels )
|
||||
{
|
||||
ASSERT( m_pFont != NULL );
|
||||
ASSERT( m_pFont != nullptr );
|
||||
|
||||
RString sNewText = StringWillUseAlternate(_sText,_sAlternateText) ? _sAlternateText : _sText;
|
||||
|
||||
@@ -505,7 +505,7 @@ void BitmapText::UpdateBaseZoom()
|
||||
|
||||
bool BitmapText::StringWillUseAlternate( const RString& sText, const RString& sAlternateText ) const
|
||||
{
|
||||
ASSERT( m_pFont != NULL );
|
||||
ASSERT( m_pFont != nullptr );
|
||||
|
||||
// Can't use the alternate if there isn't one.
|
||||
if( !sAlternateText.size() )
|
||||
@@ -711,7 +711,7 @@ void BitmapText::SetHorizAlign( float f )
|
||||
|
||||
void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels )
|
||||
{
|
||||
ASSERT( m_pFont != NULL ); // always load a font first
|
||||
ASSERT( m_pFont != nullptr ); // always load a font first
|
||||
if( m_iWrapWidthPixels == iWrapWidthPixels )
|
||||
return;
|
||||
m_iWrapWidthPixels = iWrapWidthPixels;
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
static int GetCharacter( T* p, lua_State *L )
|
||||
{
|
||||
Character *pCharacter = p->GetCharacterFromID(SArg(1));
|
||||
if( pCharacter != NULL )
|
||||
if( pCharacter != nullptr )
|
||||
pCharacter->PushSelf( L );
|
||||
else
|
||||
lua_pushnil( L );
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
static int GetRandomCharacter( T* p, lua_State *L )
|
||||
{
|
||||
Character *pCharacter = p->GetRandomCharacter();
|
||||
if( pCharacter != NULL )
|
||||
if( pCharacter != nullptr )
|
||||
pCharacter->PushSelf( L );
|
||||
else
|
||||
lua_pushnil( L );
|
||||
|
||||
+3
-3
@@ -690,7 +690,7 @@ int Course::GetMeter( StepsType st, CourseDifficulty cd ) const
|
||||
if( m_iCustomMeter[cd] != -1 )
|
||||
return m_iCustomMeter[cd];
|
||||
const Trail* pTrail = GetTrail( st );
|
||||
if( pTrail != NULL )
|
||||
if( pTrail != nullptr )
|
||||
return pTrail->GetMeter();
|
||||
return 0;
|
||||
}
|
||||
@@ -893,7 +893,7 @@ void Course::UpdateCourseStats( StepsType st )
|
||||
for(unsigned i = 0; i < m_vEntries.size(); i++)
|
||||
{
|
||||
Song *pSong = m_vEntries[i].songID.ToSong();
|
||||
if( pSong != NULL )
|
||||
if( pSong != nullptr )
|
||||
continue;
|
||||
|
||||
if ( m_SortOrder_Ranking == 2 )
|
||||
@@ -904,7 +904,7 @@ void Course::UpdateCourseStats( StepsType st )
|
||||
|
||||
const Trail* pTrail = GetTrail( st, Difficulty_Medium );
|
||||
|
||||
m_SortOrder_TotalDifficulty += pTrail != NULL? pTrail->GetTotalMeter():0;
|
||||
m_SortOrder_TotalDifficulty += pTrail != nullptr? pTrail->GetTotalMeter():0;
|
||||
|
||||
// OPTIMIZATION: Ranking info isn't dependent on style, so call it
|
||||
// sparingly. It's handled on startup and when themes change.
|
||||
|
||||
+3
-3
@@ -195,7 +195,7 @@ void CourseUtil::SortCoursePointerArrayByNumPlays( vector<Course*> &vpCoursesInO
|
||||
|
||||
void CourseUtil::SortCoursePointerArrayByNumPlays( vector<Course*> &vpCoursesInOut, const Profile* pProfile, bool bDescending )
|
||||
{
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
for(unsigned i = 0; i < vpCoursesInOut.size(); ++i)
|
||||
course_sort_val[vpCoursesInOut[i]] = ssprintf( "%09i", pProfile->GetCourseNumTimesPlayed(vpCoursesInOut[i]) );
|
||||
stable_sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), bDescending ? CompareCoursePointersBySortValueDescending : CompareCoursePointersBySortValueAscending );
|
||||
@@ -422,7 +422,7 @@ bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sE
|
||||
}
|
||||
|
||||
static const RString sInvalidChars = "\\/:*?\"<>|";
|
||||
if( strpbrk(sAnswer, sInvalidChars) != NULL )
|
||||
if( strpbrk(sAnswer, sInvalidChars) != nullptr )
|
||||
{
|
||||
sErrorOut = ssprintf( EDIT_NAME_CANNOT_CONTAIN.GetValue(), sInvalidChars.c_str() );
|
||||
return false;
|
||||
@@ -448,7 +448,7 @@ bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sE
|
||||
|
||||
void EditCourseUtil::UpdateAndSetTrail()
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurStyle != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurStyle != nullptr );
|
||||
StepsType st = GAMESTATE->m_pCurStyle->m_StepsType;
|
||||
Trail *pTrail = NULL;
|
||||
if( GAMESTATE->m_pCurCourse )
|
||||
|
||||
+1
-1
@@ -631,7 +631,7 @@ unsigned TZip::swrite(void *param,const char *buf, unsigned size)
|
||||
unsigned int TZip::write(const char *buf,unsigned int size)
|
||||
{
|
||||
const char *srcbuf=buf;
|
||||
if (pfout != NULL)
|
||||
if (pfout != nullptr)
|
||||
{
|
||||
unsigned long writ = pfout->Write( srcbuf, size );
|
||||
return writ;
|
||||
|
||||
@@ -166,7 +166,7 @@ void DancingCharacters::LoadNextSong()
|
||||
m_fThisCameraStartBeat = 0;
|
||||
m_fThisCameraEndBeat = 0;
|
||||
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != nullptr );
|
||||
m_fThisCameraEndBeat = GAMESTATE->m_pCurSong->GetFirstBeat();
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
|
||||
+1
-1
@@ -493,7 +493,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
|
||||
if( dc != Difficulty_Edit )
|
||||
{
|
||||
Steps *pSteps = SongUtil::GetStepsByDifficulty( GetSelectedSong(), GetSelectedSourceStepsType(), dc );
|
||||
if( pSteps != NULL )
|
||||
if( pSteps != nullptr )
|
||||
m_vpSourceSteps.push_back( StepsAndDifficulty(pSteps,dc) );
|
||||
}
|
||||
else
|
||||
|
||||
+5
-5
@@ -26,7 +26,7 @@ void FontPage::Load( const FontPageSettings &cfg )
|
||||
ID1.AdditionalTextureHints = cfg.m_sTextureHints;
|
||||
|
||||
m_FontPageTextures.m_pTextureMain = TEXTUREMAN->LoadTexture( ID1 );
|
||||
ASSERT( m_FontPageTextures.m_pTextureMain != NULL );
|
||||
ASSERT( m_FontPageTextures.m_pTextureMain != nullptr );
|
||||
|
||||
RageTextureID ID2 = ID1;
|
||||
// "arial 20 16x16 [main].png" => "arial 20 16x16 [main-stroke].png"
|
||||
@@ -36,7 +36,7 @@ void FontPage::Load( const FontPageSettings &cfg )
|
||||
if( IsAFile(ID2.filename) )
|
||||
{
|
||||
m_FontPageTextures.m_pTextureStroke = TEXTUREMAN->LoadTexture( ID2 );
|
||||
ASSERT( m_FontPageTextures.m_pTextureStroke != NULL );
|
||||
ASSERT( m_FontPageTextures.m_pTextureStroke != nullptr );
|
||||
ASSERT_M( m_FontPageTextures.m_pTextureMain->GetSourceFrameWidth() == m_FontPageTextures.m_pTextureStroke->GetSourceFrameWidth(), ssprintf("'%s' and '%s' must have the same frame widths", ID1.filename.c_str(), ID2.filename.c_str()) );
|
||||
ASSERT_M( m_FontPageTextures.m_pTextureMain->GetNumFrames() == m_FontPageTextures.m_pTextureStroke->GetNumFrames(), ssprintf("'%s' and '%s' must have the same frame dimensions", ID1.filename.c_str(), ID2.filename.c_str()) );
|
||||
}
|
||||
@@ -187,12 +187,12 @@ void FontPage::SetExtraPixels( int iDrawExtraPixelsLeft, int iDrawExtraPixelsRig
|
||||
|
||||
FontPage::~FontPage()
|
||||
{
|
||||
if( m_FontPageTextures.m_pTextureMain != NULL )
|
||||
if( m_FontPageTextures.m_pTextureMain != nullptr )
|
||||
{
|
||||
TEXTUREMAN->UnloadTexture( m_FontPageTextures.m_pTextureMain );
|
||||
m_FontPageTextures.m_pTextureMain = NULL;
|
||||
}
|
||||
if( m_FontPageTextures.m_pTextureStroke != NULL )
|
||||
if( m_FontPageTextures.m_pTextureStroke != nullptr )
|
||||
{
|
||||
TEXTUREMAN->UnloadTexture( m_FontPageTextures.m_pTextureStroke );
|
||||
m_FontPageTextures.m_pTextureStroke = NULL;
|
||||
@@ -346,7 +346,7 @@ void Font::CapsOnly()
|
||||
|
||||
void Font::SetDefaultGlyph( FontPage *pPage )
|
||||
{
|
||||
ASSERT( pPage != NULL );
|
||||
ASSERT( pPage != nullptr );
|
||||
ASSERT( !pPage->m_aGlyphs.empty() );
|
||||
m_pDefault = pPage;
|
||||
}
|
||||
|
||||
+11
-11
@@ -258,7 +258,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
// This must be processed after "song" and "style" commands.
|
||||
if( !m_bInvalid )
|
||||
{
|
||||
Song *pSong = (m_pSong != NULL)? m_pSong:GAMESTATE->m_pCurSong;
|
||||
Song *pSong = (m_pSong != nullptr)? m_pSong:GAMESTATE->m_pCurSong;
|
||||
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle();
|
||||
if( pSong == NULL || pStyle == NULL )
|
||||
RageException::Throw( "Must set Song and Style to set Steps." );
|
||||
@@ -293,7 +293,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
// This must be processed after "course" and "style" commands.
|
||||
if( !m_bInvalid )
|
||||
{
|
||||
Course *pCourse = (m_pCourse != NULL)? m_pCourse:GAMESTATE->m_pCurCourse;
|
||||
Course *pCourse = (m_pCourse != nullptr)? m_pCourse:GAMESTATE->m_pCurCourse;
|
||||
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle();
|
||||
if( pCourse == NULL || pStyle == NULL )
|
||||
RageException::Throw( "Must set Course and Style to set Steps." );
|
||||
@@ -464,10 +464,10 @@ bool GameCommand::IsPlayable( RString *why ) const
|
||||
|
||||
/* Don't allow a PlayMode that's incompatible with our current Style (if set),
|
||||
* and vice versa. */
|
||||
if( m_pm != PlayMode_Invalid || m_pStyle != NULL )
|
||||
if( m_pm != PlayMode_Invalid || m_pStyle != nullptr )
|
||||
{
|
||||
const PlayMode pm = (m_pm != PlayMode_Invalid) ? m_pm : GAMESTATE->m_PlayMode;
|
||||
const Style *style = (m_pStyle != NULL)? m_pStyle: GAMESTATE->GetCurrentStyle();
|
||||
const Style *style = (m_pStyle != nullptr)? m_pStyle: GAMESTATE->GetCurrentStyle();
|
||||
if( !AreStyleAndPlayModeCompatible( style, pm ) )
|
||||
{
|
||||
if( why )
|
||||
@@ -572,7 +572,7 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
|
||||
if( m_pm != PlayMode_Invalid )
|
||||
GAMESTATE->m_PlayMode.Set( m_pm );
|
||||
|
||||
if( m_pStyle != NULL )
|
||||
if( m_pStyle != nullptr )
|
||||
{
|
||||
GAMESTATE->SetCurrentStyle( m_pStyle );
|
||||
|
||||
@@ -718,16 +718,16 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
|
||||
bool GameCommand::IsZero() const
|
||||
{
|
||||
if( m_pm != PlayMode_Invalid ||
|
||||
m_pStyle != NULL ||
|
||||
m_pStyle != nullptr ||
|
||||
m_dc != Difficulty_Invalid ||
|
||||
m_sAnnouncer != "" ||
|
||||
m_sPreferredModifiers != "" ||
|
||||
m_sStageModifiers != "" ||
|
||||
m_pSong != NULL ||
|
||||
m_pSteps != NULL ||
|
||||
m_pCourse != NULL ||
|
||||
m_pTrail != NULL ||
|
||||
m_pCharacter != NULL ||
|
||||
m_pSong != nullptr ||
|
||||
m_pSteps != nullptr ||
|
||||
m_pCourse != nullptr ||
|
||||
m_pTrail != nullptr ||
|
||||
m_pCharacter != nullptr ||
|
||||
m_CourseDifficulty != Difficulty_Invalid ||
|
||||
!m_sSongGroup.empty() ||
|
||||
m_SortOrder != SortOrder_Invalid ||
|
||||
|
||||
+1
-1
@@ -281,7 +281,7 @@ void ConcurrentRenderer::Stop()
|
||||
|
||||
void ConcurrentRenderer::RenderThread()
|
||||
{
|
||||
ASSERT( SCREENMAN != NULL );
|
||||
ASSERT( SCREENMAN != nullptr );
|
||||
|
||||
while( !m_bShutdown )
|
||||
{
|
||||
|
||||
@@ -410,7 +410,7 @@ int MusicThread_start( void *p )
|
||||
GameSoundManager::GameSoundManager()
|
||||
{
|
||||
/* Init RageSoundMan first: */
|
||||
ASSERT( SOUNDMAN != NULL );
|
||||
ASSERT( SOUNDMAN != nullptr );
|
||||
|
||||
g_Mutex = new RageEvent("GameSoundManager");
|
||||
g_Playing = new MusicPlaying( new RageSound );
|
||||
|
||||
+10
-10
@@ -275,7 +275,7 @@ void GameState::Reset()
|
||||
FOREACH_PlayerNumber( pn )
|
||||
UnjoinPlayer( pn );
|
||||
|
||||
ASSERT( THEME != NULL );
|
||||
ASSERT( THEME != nullptr );
|
||||
|
||||
m_timeGameStarted.SetZero();
|
||||
SetCurrentStyle( NULL );
|
||||
@@ -335,7 +335,7 @@ void GameState::Reset()
|
||||
m_pCurCharacters[p] = CHARMAN->GetRandomCharacter();
|
||||
else
|
||||
m_pCurCharacters[p] = CHARMAN->GetDefaultCharacter();
|
||||
ASSERT( m_pCurCharacters[p] != NULL );
|
||||
ASSERT( m_pCurCharacters[p] != nullptr );
|
||||
}
|
||||
|
||||
m_bTemporaryEventMode = false;
|
||||
@@ -375,7 +375,7 @@ void GameState::JoinPlayer( PlayerNumber pn )
|
||||
}
|
||||
|
||||
// Set the current style to something appropriate for the new number of joined players.
|
||||
if( ALLOW_LATE_JOIN && m_pCurStyle != NULL )
|
||||
if( ALLOW_LATE_JOIN && m_pCurStyle != nullptr )
|
||||
{
|
||||
const Style *pStyle;
|
||||
// Only use one player for StyleType_OnePlayerTwoSides and StepsTypes
|
||||
@@ -592,7 +592,7 @@ int GameState::GetNumStagesMultiplierForSong( const Song* pSong )
|
||||
{
|
||||
int iNumStages = 1;
|
||||
|
||||
ASSERT( pSong != NULL );
|
||||
ASSERT( pSong != nullptr );
|
||||
if( pSong->IsMarathon() )
|
||||
iNumStages *= 3;
|
||||
if( pSong->IsLong() )
|
||||
@@ -1115,7 +1115,7 @@ int GameState::GetNumSidesJoined() const
|
||||
|
||||
const Game* GameState::GetCurrentGame()
|
||||
{
|
||||
ASSERT( m_pCurGame != NULL ); // the game must be set before calling this
|
||||
ASSERT( m_pCurGame != nullptr ); // the game must be set before calling this
|
||||
return m_pCurGame;
|
||||
}
|
||||
|
||||
@@ -1424,7 +1424,7 @@ void GameState::GetAllUsedNoteSkins( vector<RString> &out ) const
|
||||
if( IsCourseMode() )
|
||||
{
|
||||
const Trail *pTrail = m_pCurTrail[pn];
|
||||
ASSERT( pTrail != NULL );
|
||||
ASSERT( pTrail != nullptr );
|
||||
|
||||
for (TrailEntry const &e : pTrail->m_vEntries)
|
||||
{
|
||||
@@ -1555,11 +1555,11 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
|
||||
SongAndSteps sas;
|
||||
ASSERT( !STATSMAN->m_vPlayedStageStats[i].m_vpPlayedSongs.empty() );
|
||||
sas.pSong = STATSMAN->m_vPlayedStageStats[i].m_vpPlayedSongs[0];
|
||||
ASSERT( sas.pSong != NULL );
|
||||
ASSERT( sas.pSong != nullptr );
|
||||
if( STATSMAN->m_vPlayedStageStats[i].m_player[pn].m_vpPossibleSteps.empty() )
|
||||
continue;
|
||||
sas.pSteps = STATSMAN->m_vPlayedStageStats[i].m_player[pn].m_vpPossibleSteps[0];
|
||||
ASSERT( sas.pSteps != NULL );
|
||||
ASSERT( sas.pSteps != nullptr );
|
||||
vSongAndSteps.push_back( sas );
|
||||
}
|
||||
CHECKPOINT;
|
||||
@@ -1697,9 +1697,9 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
|
||||
{
|
||||
CHECKPOINT;
|
||||
Course* pCourse = m_pCurCourse;
|
||||
ASSERT( pCourse != NULL );
|
||||
ASSERT( pCourse != nullptr );
|
||||
Trail *pTrail = m_pCurTrail[pn];
|
||||
ASSERT( pTrail != NULL );
|
||||
ASSERT( pTrail != nullptr );
|
||||
CourseDifficulty cd = pTrail->m_CourseDifficulty;
|
||||
|
||||
// Find Machine Records
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ bool IniFile::DeleteKey(const RString &keyname)
|
||||
bool IniFile::RenameKey(const RString &from, const RString &to)
|
||||
{
|
||||
// If to already exists, do nothing.
|
||||
if( GetChild(to) != NULL )
|
||||
if( GetChild(to) != nullptr )
|
||||
return false;
|
||||
|
||||
XNode* pNode = GetChild( from );
|
||||
|
||||
+1
-1
@@ -347,7 +347,7 @@ bool InputFilter::IsBeingPressed( const DeviceInput &di, const DeviceInputList *
|
||||
if( pButtonState == NULL )
|
||||
pButtonState = &g_CurrentState;
|
||||
const DeviceInput *pDI = FindItemBinarySearch( pButtonState->begin(), pButtonState->end(), di );
|
||||
return pDI != NULL && pDI->bDown;
|
||||
return pDI != nullptr && pDI->bDown;
|
||||
}
|
||||
|
||||
float InputFilter::GetSecsHeld( const DeviceInput &di, const DeviceInputList *pButtonState ) const
|
||||
|
||||
+1
-1
@@ -1111,7 +1111,7 @@ void InputMappings::WriteMappings( const InputScheme *pInputScheme, RString sFil
|
||||
ini.DeleteKey( pInputScheme->m_szName );
|
||||
|
||||
XNode *pKey = ini.GetChild( pInputScheme->m_szName );
|
||||
if( pKey != NULL )
|
||||
if( pKey != nullptr )
|
||||
ini.RemoveChild( pKey );
|
||||
pKey = ini.AppendChild( pInputScheme->m_szName );
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ bool InputQueue::WasPressedRecently( GameController c, const GameButton button,
|
||||
if( iep.GameI.button != button )
|
||||
continue;
|
||||
|
||||
if( pIEP != NULL )
|
||||
if( pIEP != nullptr )
|
||||
*pIEP = iep;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -96,7 +96,7 @@ void LifeMeterTime::OnLoadSong()
|
||||
return;
|
||||
|
||||
Course* pCourse = GAMESTATE->m_pCurCourse;
|
||||
ASSERT( pCourse != NULL );
|
||||
ASSERT( pCourse != nullptr );
|
||||
|
||||
float fOldLife = m_fLifeTotalLostSeconds;
|
||||
float fGainSeconds = pCourse->m_vEntries[GAMESTATE->GetCourseSongIndex()].fGainSeconds;
|
||||
|
||||
+5
-5
@@ -86,12 +86,12 @@ namespace LuaHelpers
|
||||
{
|
||||
size_t iLen;
|
||||
const char *pStr = lua_tolstring( L, iOffset, &iLen );
|
||||
if( pStr != NULL )
|
||||
if( pStr != nullptr )
|
||||
Object.assign( pStr, iLen );
|
||||
else
|
||||
Object.clear();
|
||||
|
||||
return pStr != NULL;
|
||||
return pStr != nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ static int GetLuaStack( lua_State *L )
|
||||
|
||||
if( !strcmp(ar.what, "C") )
|
||||
{
|
||||
for( int i = 1; i <= ar.nups && (name = lua_getupvalue(L, -1, i)) != NULL; ++i )
|
||||
for( int i = 1; i <= ar.nups && (name = lua_getupvalue(L, -1, i)) != nullptr; ++i )
|
||||
{
|
||||
vArgs.push_back( ssprintf("%s = %s", name, lua_tostring(L, -1)) );
|
||||
lua_pop( L, 1 ); // pop value
|
||||
@@ -182,7 +182,7 @@ static int GetLuaStack( lua_State *L )
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i = 1; (name = lua_getlocal(L, &ar, i)) != NULL; ++i )
|
||||
for( int i = 1; (name = lua_getlocal(L, &ar, i)) != nullptr; ++i )
|
||||
{
|
||||
vArgs.push_back( ssprintf("%s = %s", name, lua_tostring(L, -1)) );
|
||||
lua_pop( L, 1 ); // pop value
|
||||
@@ -243,7 +243,7 @@ LuaManager::LuaManager()
|
||||
LUA = this; // so that LUA is available when we call the Register functions
|
||||
|
||||
lua_State *L = lua_open();
|
||||
ASSERT( L != NULL );
|
||||
ASSERT( L != nullptr );
|
||||
|
||||
lua_atpanic( L, LuaPanic );
|
||||
m_pLuaMain = L;
|
||||
|
||||
@@ -148,7 +148,7 @@ RString LuaReference::Serialize() const
|
||||
|
||||
/* The return value is a string, which we store in m_sSerializedData. */
|
||||
const char *pString = lua_tostring( L, -1 );
|
||||
ASSERT_M( pString != NULL, "Serialize() didn't return a string" );
|
||||
ASSERT_M( pString != nullptr, "Serialize() didn't return a string" );
|
||||
|
||||
RString sRet = pString;
|
||||
lua_pop( L, 1 );
|
||||
|
||||
@@ -298,7 +298,7 @@ MemoryCardManager::~MemoryCardManager()
|
||||
// Unregister with Lua.
|
||||
LUA->UnsetGlobal( "MEMCARDMAN" );
|
||||
|
||||
ASSERT( g_pWorker != NULL );
|
||||
ASSERT( g_pWorker != nullptr );
|
||||
SAFE_DELETE(g_pWorker);
|
||||
|
||||
FOREACH_PlayerNumber( pn )
|
||||
|
||||
@@ -38,7 +38,7 @@ void MeterDisplay::LoadFromNode( const XNode* pNode )
|
||||
this->AddChild( m_sprStream );
|
||||
|
||||
const XNode* pChild = pNode->GetChild( "Tip" );
|
||||
if( pChild != NULL )
|
||||
if( pChild != nullptr )
|
||||
{
|
||||
m_sprTip.LoadActorFromNode( pChild, this );
|
||||
this->AddChild( m_sprTip );
|
||||
|
||||
+2
-2
@@ -620,7 +620,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, vector<myBone
|
||||
}
|
||||
|
||||
RageVector3 vPos;
|
||||
if( pLastPositionKey != NULL && pThisPositionKey != NULL )
|
||||
if( pLastPositionKey != nullptr && pThisPositionKey != nullptr )
|
||||
{
|
||||
const float s = SCALE( fFrame, pLastPositionKey->fTime, pThisPositionKey->fTime, 0, 1 );
|
||||
vPos = pLastPositionKey->Position + (pThisPositionKey->Position - pLastPositionKey->Position) * s;
|
||||
@@ -644,7 +644,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, vector<myBone
|
||||
}
|
||||
|
||||
RageVector4 vRot;
|
||||
if( pLastRotationKey != NULL && pThisRotationKey != NULL )
|
||||
if( pLastRotationKey != nullptr && pThisRotationKey != nullptr )
|
||||
{
|
||||
const float s = SCALE( fFrame, pLastRotationKey->fTime, pThisRotationKey->fTime, 0, 1 );
|
||||
RageQuatSlerp( &vRot, pLastRotationKey->Rotation, pThisRotationKey->Rotation, s );
|
||||
|
||||
+6
-6
@@ -151,7 +151,7 @@ void MusicWheel::BeginScreen()
|
||||
const vector<MusicWheelItemData *> &from = getWheelItemsData(SORT_MODE_MENU);
|
||||
for( unsigned i=0; i<from.size(); i++ )
|
||||
{
|
||||
ASSERT( &*from[i]->m_pAction != NULL );
|
||||
ASSERT( &*from[i]->m_pAction != nullptr );
|
||||
if( from[i]->m_pAction->DescribesCurrentModeForAllPlayers() )
|
||||
{
|
||||
m_sLastModeMenuItem = from[i]->m_pAction->m_sName;
|
||||
@@ -184,7 +184,7 @@ void MusicWheel::BeginScreen()
|
||||
|
||||
/* Invalidate current Song if it can't be played
|
||||
* because there are not enough stages remaining. */
|
||||
if( GAMESTATE->m_pCurSong != NULL &&
|
||||
if( GAMESTATE->m_pCurSong != nullptr &&
|
||||
GameState::GetNumStagesMultiplierForSong( GAMESTATE->m_pCurSong ) > GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() )
|
||||
{
|
||||
GAMESTATE->m_pCurSong.Set( NULL );
|
||||
@@ -194,10 +194,10 @@ void MusicWheel::BeginScreen()
|
||||
* because there are not enough stages remaining. */
|
||||
FOREACH_ENUM( PlayerNumber, p )
|
||||
{
|
||||
if( GAMESTATE->m_pCurSteps[p] != NULL )
|
||||
if( GAMESTATE->m_pCurSteps[p] != nullptr )
|
||||
{
|
||||
vector<Steps*> vpPossibleSteps;
|
||||
if( GAMESTATE->m_pCurSong != NULL )
|
||||
if( GAMESTATE->m_pCurSong != nullptr )
|
||||
SongUtil::GetPlayableSteps( GAMESTATE->m_pCurSong, vpPossibleSteps );
|
||||
bool bStepsIsPossible = find( vpPossibleSteps.begin(), vpPossibleSteps.end(), GAMESTATE->m_pCurSteps[p] ) == vpPossibleSteps.end();
|
||||
if( !bStepsIsPossible )
|
||||
@@ -849,7 +849,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
// init music status icons
|
||||
for (MusicWheelItemData *WID : arrayWheelItemDatas)
|
||||
{
|
||||
if( WID->m_pSong != NULL )
|
||||
if( WID->m_pSong != nullptr )
|
||||
{
|
||||
WID->m_Flags.bHasBeginnerOr1Meter = WID->m_pSong->IsEasy( GAMESTATE->GetCurrentStyle()->m_StepsType ) && SHOW_EASY_FLAG;
|
||||
WID->m_Flags.bEdits = false;
|
||||
@@ -859,7 +859,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
WID->m_Flags.bEdits |= WID->m_pSong->HasEdits( type );
|
||||
WID->m_Flags.iStagesForSong = GameState::GetNumStagesMultiplierForSong( WID->m_pSong );
|
||||
}
|
||||
else if( WID->m_pCourse != NULL )
|
||||
else if( WID->m_pCourse != nullptr )
|
||||
{
|
||||
WID->m_Flags.bHasBeginnerOr1Meter = false;
|
||||
WID->m_Flags.bEdits = WID->m_pCourse->IsAnEdit();
|
||||
|
||||
@@ -351,13 +351,13 @@ void MusicWheelItem::RefreshGrades()
|
||||
if( pWID->m_pSong )
|
||||
{
|
||||
const Steps* pSteps = SongUtil::GetStepsByDifficulty( pWID->m_pSong, st, dc );
|
||||
if( pSteps != NULL )
|
||||
if( pSteps != nullptr )
|
||||
pHSL = &pProfile->GetStepsHighScoreList(pWID->m_pSong, pSteps);
|
||||
}
|
||||
else if( pWID->m_pCourse )
|
||||
{
|
||||
const Trail *pTrail = pWID->m_pCourse->GetTrail( st, dc );
|
||||
if( pTrail != NULL )
|
||||
if( pTrail != nullptr )
|
||||
pHSL = &pProfile->GetCourseHighScoreList( pWID->m_pCourse, pTrail );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
ctr = char( position*16 );
|
||||
m_packet.Write1( ctr );
|
||||
|
||||
if( GAMESTATE->m_pCurSong != NULL )
|
||||
if( GAMESTATE->m_pCurSong != nullptr )
|
||||
{
|
||||
m_packet.WriteNT( GAMESTATE->m_pCurSong->m_sMainTitle );
|
||||
m_packet.WriteNT( GAMESTATE->m_pCurSong->m_sSubTitle );
|
||||
@@ -376,7 +376,7 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
m_packet.WriteNT( "" );
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_pCurCourse != NULL )
|
||||
if( GAMESTATE->m_pCurCourse != nullptr )
|
||||
m_packet.WriteNT( GAMESTATE->m_pCurCourse->GetDisplayFullTitle() );
|
||||
else
|
||||
m_packet.WriteNT( RString() );
|
||||
@@ -899,7 +899,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
{
|
||||
// \r\n\r\n = Separator from HTTP Header and Body
|
||||
char* cBodyStart = strstr(cBuffer, "\r\n\r\n");
|
||||
if( cBodyStart != NULL )
|
||||
if( cBodyStart != nullptr )
|
||||
{
|
||||
// Get the HTTP Header only
|
||||
int iHeaderLength = cBodyStart - cBuffer;
|
||||
@@ -939,7 +939,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
}
|
||||
}
|
||||
} // if( svResponse[0].find("200") != RString::npos )
|
||||
} // if( cBodyStart != NULL )
|
||||
} // if( cBodyStart != nullptr )
|
||||
} // if( iBytes )
|
||||
SAFE_DELETE( cBuffer );
|
||||
} // if( socket->connect(sHost, uPort) )
|
||||
|
||||
+1
-1
@@ -351,7 +351,7 @@ bool NoteData::IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) cons
|
||||
const TapNote &tn = GetTapNote( iTrack, iRow );
|
||||
if( tn.type == TapNote::hold_head )
|
||||
{
|
||||
if( pHeadRow != NULL )
|
||||
if( pHeadRow != nullptr )
|
||||
*pHeadRow = iRow;
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -145,7 +145,7 @@ static NoteResource *MakeNoteResource( const RString &sButton, const RString &sE
|
||||
NoteResource *pRes = new NoteResource( nsap );
|
||||
|
||||
pRes->m_pActor = NOTESKIN->LoadActor( sButton, sElement, NULL, bSpriteOnly );
|
||||
ASSERT( pRes->m_pActor != NULL );
|
||||
ASSERT( pRes->m_pActor != nullptr );
|
||||
|
||||
g_NoteResource[nsap] = pRes;
|
||||
it = g_NoteResource.find( nsap );
|
||||
@@ -158,7 +158,7 @@ static NoteResource *MakeNoteResource( const RString &sButton, const RString &sE
|
||||
|
||||
static void DeleteNoteResource( NoteResource *pRes )
|
||||
{
|
||||
ASSERT( pRes != NULL );
|
||||
ASSERT( pRes != nullptr );
|
||||
|
||||
ASSERT_M( pRes->m_iRefCount > 0, ssprintf("RefCount %i > 0", pRes->m_iRefCount) );
|
||||
--pRes->m_iRefCount;
|
||||
|
||||
+5
-5
@@ -175,7 +175,7 @@ void NoteField::Load(
|
||||
int iDrawDistanceAfterTargetsPixels,
|
||||
int iDrawDistanceBeforeTargetsPixels )
|
||||
{
|
||||
ASSERT( pNoteData != NULL );
|
||||
ASSERT( pNoteData != nullptr );
|
||||
m_pNoteData = pNoteData;
|
||||
m_iDrawDistanceAfterTargetsPixels = iDrawDistanceAfterTargetsPixels;
|
||||
m_iDrawDistanceBeforeTargetsPixels = iDrawDistanceBeforeTargetsPixels;
|
||||
@@ -814,7 +814,7 @@ void NoteField::DrawPrimitives()
|
||||
//LOG->Trace( "NoteField::DrawPrimitives()" );
|
||||
|
||||
// This should be filled in on the first update.
|
||||
ASSERT( m_pCurDisplay != NULL );
|
||||
ASSERT( m_pCurDisplay != nullptr );
|
||||
|
||||
ArrowEffects::Update();
|
||||
|
||||
@@ -873,7 +873,7 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
unsigned i = 0;
|
||||
// Draw beat bars
|
||||
if( ( GAMESTATE->IsEditing() || SHOW_BEAT_BARS ) && pTiming != NULL )
|
||||
if( ( GAMESTATE->IsEditing() || SHOW_BEAT_BARS ) && pTiming != nullptr )
|
||||
{
|
||||
const vector<TimingSegment *> &tSigs = *segs[SEGMENT_TIME_SIG];
|
||||
int iMeasureIndex = 0;
|
||||
@@ -913,9 +913,9 @@ void NoteField::DrawPrimitives()
|
||||
}
|
||||
}
|
||||
|
||||
if( GAMESTATE->IsEditing() && pTiming != NULL )
|
||||
if( GAMESTATE->IsEditing() && pTiming != nullptr )
|
||||
{
|
||||
ASSERT(GAMESTATE->m_pCurSong != NULL);
|
||||
ASSERT(GAMESTATE->m_pCurSong != nullptr);
|
||||
|
||||
const TimingData &timing = *pTiming;
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ int BMSSong::AllocateKeysound( RString filename, RString path )
|
||||
if( !IsAFile(dir + normalizedFilename) )
|
||||
{
|
||||
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
|
||||
for( unsigned i = 0; exts[i] != NULL; ++i )
|
||||
for( unsigned i = 0; exts[i] != nullptr; ++i )
|
||||
{
|
||||
RString fn = SetExtension( normalizedFilename, exts[i] );
|
||||
if( IsAFile(dir + fn) )
|
||||
@@ -394,7 +394,7 @@ bool BMSSong::GetBackground( RString filename, RString path, RString &bgfile )
|
||||
if( !IsAFile(dir + normalizedFilename) )
|
||||
{
|
||||
const char *exts[] = { "ogv", "avi", "mpg", "mpeg", "bmp", "png", "jpeg", NULL }; // XXX: stop duplicating these everywhere
|
||||
for( unsigned i = 0; exts[i] != NULL; ++i )
|
||||
for( unsigned i = 0; exts[i] != nullptr; ++i )
|
||||
{
|
||||
RString fn = SetExtension( normalizedFilename, exts[i] );
|
||||
if( IsAFile(dir + fn) )
|
||||
@@ -426,14 +426,14 @@ void BMSSong::PrecacheBackgrounds(const RString &dir)
|
||||
|
||||
const char *exts[] = { "ogv", "avi", "mpg", "mpeg", "bmp", "png", "jpeg", NULL }; // XXX: stop duplicating these everywhere
|
||||
|
||||
for( unsigned i = 0; exts[i] != NULL; ++i )
|
||||
for( unsigned i = 0; exts[i] != nullptr; ++i )
|
||||
{
|
||||
GetDirListing( dir + RString("*.") + RString(exts[i]), arrayPossibleFiles );
|
||||
}
|
||||
|
||||
for( unsigned i = 0; i < arrayPossibleFiles.size(); i++ )
|
||||
{
|
||||
for( unsigned j = 0; exts[j] != NULL; ++j )
|
||||
for( unsigned j = 0; exts[j] != nullptr; ++j )
|
||||
{
|
||||
RString fn = SetExtension( arrayPossibleFiles[i], exts[j] );
|
||||
mapBackground[fn] = arrayPossibleFiles[i];
|
||||
|
||||
+4
-4
@@ -61,7 +61,7 @@ void OptionRow::Clear()
|
||||
FOREACH_PlayerNumber( p )
|
||||
m_Underline[p].clear();
|
||||
|
||||
if( m_pHand != NULL )
|
||||
if( m_pHand != nullptr )
|
||||
{
|
||||
for (RString const &m : m_pHand->m_vsReloadRowMessages)
|
||||
MESSAGEMAN->Unsubscribe( this, m );
|
||||
@@ -197,7 +197,7 @@ RString OptionRow::GetRowTitle() const
|
||||
if( GAMESTATE->m_pCurCourse )
|
||||
{
|
||||
const Trail* pTrail = GAMESTATE->m_pCurTrail[GAMESTATE->GetMasterPlayerNumber()];
|
||||
ASSERT( pTrail != NULL );
|
||||
ASSERT( pTrail != nullptr );
|
||||
const int iNumCourseEntries = pTrail->m_vEntries.size();
|
||||
if( iNumCourseEntries > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
|
||||
bShowBpmInSpeedTitle = false;
|
||||
@@ -216,7 +216,7 @@ RString OptionRow::GetRowTitle() const
|
||||
const Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
const Trail* pTrail = pCourse->GetTrail( st );
|
||||
ASSERT( pTrail != NULL );
|
||||
ASSERT( pTrail != nullptr );
|
||||
pTrail->GetDisplayBpms( bpms );
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ void OptionRow::SetModIcon( PlayerNumber pn, const RString &sText, GameCommand &
|
||||
msg.SetParam( "GameCommand", &gc );
|
||||
msg.SetParam( "Text", sText );
|
||||
m_sprFrame->HandleMessage( msg );
|
||||
if( m_ModIcons[pn] != NULL )
|
||||
if( m_ModIcons[pn] != nullptr )
|
||||
m_ModIcons[pn]->Set( sText );
|
||||
}
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@ public:
|
||||
m_ppStepsToFill = &GAMESTATE->m_pEditSourceSteps;
|
||||
m_pst = &GAMESTATE->m_stEditSource;
|
||||
m_vsReloadRowMessages.push_back( MessageIDToString(Message_EditSourceStepsTypeChanged) );
|
||||
if( GAMESTATE->m_pCurSteps[0].Get() != NULL )
|
||||
if( GAMESTATE->m_pCurSteps[0].Get() != nullptr )
|
||||
m_Def.m_vEnabledForPlayers.clear(); // hide row
|
||||
}
|
||||
else
|
||||
@@ -1120,7 +1120,7 @@ public:
|
||||
{
|
||||
LOG->Warn( "Invalid Conf type \"%s\"", sParam.c_str() );
|
||||
pConfOption = ConfOption::Find( "Invalid" );
|
||||
ASSERT_M( pConfOption != NULL, "ConfOption::Find(Invalid)" );
|
||||
ASSERT_M( pConfOption != nullptr, "ConfOption::Find(Invalid)" );
|
||||
}
|
||||
|
||||
pConfOption->UpdateAvailableOptions();
|
||||
@@ -1201,7 +1201,7 @@ public:
|
||||
m_pstToFill = &GAMESTATE->m_stEditSource;
|
||||
m_vsReloadRowMessages.push_back( MessageIDToString(Message_CurrentStepsP1Changed) );
|
||||
m_vsReloadRowMessages.push_back( MessageIDToString(Message_EditStepsTypeChanged) );
|
||||
if( GAMESTATE->m_pCurSteps[0].Get() != NULL )
|
||||
if( GAMESTATE->m_pCurSteps[0].Get() != nullptr )
|
||||
m_Def.m_vEnabledForPlayers.clear(); // hide row
|
||||
}
|
||||
else
|
||||
|
||||
+2
-2
@@ -101,7 +101,7 @@ void OptionListRow::SetFromHandler( const OptionRowHandler *pHandler )
|
||||
|
||||
void OptionListRow::SetTextFromHandler( const OptionRowHandler *pHandler )
|
||||
{
|
||||
ASSERT( pHandler != NULL );
|
||||
ASSERT( pHandler != nullptr );
|
||||
for( unsigned i = 0; i < pHandler->m_Def.m_vsChoices.size(); ++i )
|
||||
{
|
||||
// init text
|
||||
@@ -632,7 +632,7 @@ void OptionsList::SelectionsChanged( const RString &sRowName )
|
||||
const OptionRowHandler *pHandler = m_Rows[sRowName];
|
||||
vector<bool> &bSelections = m_bSelections[sRowName];
|
||||
|
||||
if( pHandler->m_Def.m_bOneChoiceForAllPlayers && m_pLinked != NULL )
|
||||
if( pHandler->m_Def.m_bOneChoiceForAllPlayers && m_pLinked != nullptr )
|
||||
{
|
||||
vector<bool> &bLinkedSelections = m_pLinked->m_bSelections[sRowName];
|
||||
bLinkedSelections = bSelections;
|
||||
|
||||
@@ -47,7 +47,7 @@ void PercentageDisplay::LoadFromNode( const XNode* pNode )
|
||||
this->AddChild( &m_textPercent );
|
||||
|
||||
pChild = pNode->GetChild( "PercentRemainder" );
|
||||
if( !ShowDancePointsNotPercentage() && pChild != NULL )
|
||||
if( !ShowDancePointsNotPercentage() && pChild != nullptr )
|
||||
{
|
||||
m_bUseRemainder = true;
|
||||
m_textPercentRemainder.LoadFromNode( pChild );
|
||||
|
||||
+10
-10
@@ -416,12 +416,12 @@ void Player::Init(
|
||||
|
||||
if( GAMESTATE->IsCourseMode() )
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurTrail[pn] != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurTrail[pn] != nullptr );
|
||||
GAMESTATE->m_pCurTrail[pn]->GetDisplayBpms( bpms );
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != nullptr );
|
||||
GAMESTATE->m_pCurSong->GetDisplayBpms( bpms );
|
||||
}
|
||||
|
||||
@@ -891,14 +891,14 @@ void Player::Update( float fDeltaTime )
|
||||
const bool bReverse = m_pPlayerState->m_PlayerOptions.GetCurrent().GetReversePercentForColumn(0) == 1;
|
||||
float fPercentCentered = m_pPlayerState->m_PlayerOptions.GetCurrent().m_fScrolls[PlayerOptions::SCROLL_CENTERED];
|
||||
|
||||
if( m_pActorWithJudgmentPosition != NULL )
|
||||
if( m_pActorWithJudgmentPosition != nullptr )
|
||||
{
|
||||
const Actor::TweenState &ts1 = m_tsJudgment[bReverse?1:0][0];
|
||||
const Actor::TweenState &ts2 = m_tsJudgment[bReverse?1:0][1];
|
||||
Actor::TweenState::MakeWeightedAverage( m_pActorWithJudgmentPosition->DestTweenState(), ts1, ts2, fPercentCentered );
|
||||
}
|
||||
|
||||
if( m_pActorWithComboPosition != NULL )
|
||||
if( m_pActorWithComboPosition != nullptr )
|
||||
{
|
||||
const Actor::TweenState &ts1 = m_tsCombo[bReverse?1:0][0];
|
||||
const Actor::TweenState &ts2 = m_tsCombo[bReverse?1:0][1];
|
||||
@@ -908,9 +908,9 @@ void Player::Update( float fDeltaTime )
|
||||
float fNoteFieldZoom = 1 - fMiniPercent*0.5f;
|
||||
if( m_pNoteField )
|
||||
m_pNoteField->SetZoom( fNoteFieldZoom );
|
||||
if( m_pActorWithJudgmentPosition != NULL )
|
||||
if( m_pActorWithJudgmentPosition != nullptr )
|
||||
m_pActorWithJudgmentPosition->SetZoom( m_pActorWithJudgmentPosition->GetZoom() * fJudgmentZoom );
|
||||
if( m_pActorWithComboPosition != NULL )
|
||||
if( m_pActorWithComboPosition != nullptr )
|
||||
m_pActorWithComboPosition->SetZoom( m_pActorWithComboPosition->GetZoom() * fJudgmentZoom );
|
||||
}
|
||||
|
||||
@@ -931,7 +931,7 @@ void Player::Update( float fDeltaTime )
|
||||
ASSERT_M( iNumCols <= MAX_COLS_PER_PLAYER, ssprintf("%i > %i", iNumCols, MAX_COLS_PER_PLAYER) );
|
||||
for( int col=0; col < iNumCols; ++col )
|
||||
{
|
||||
ASSERT( m_pPlayerState != NULL );
|
||||
ASSERT( m_pPlayerState != nullptr );
|
||||
|
||||
// TODO: Remove use of PlayerNumber.
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber );
|
||||
@@ -1216,7 +1216,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
|
||||
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY )
|
||||
{
|
||||
STATSMAN->m_CurStageStats.m_bUsedAutoplay = true;
|
||||
if( m_pPlayerStageStats != NULL )
|
||||
if( m_pPlayerStageStats != nullptr )
|
||||
m_pPlayerStageStats->m_bDisqualified = true;
|
||||
}
|
||||
}
|
||||
@@ -3162,9 +3162,9 @@ void Player::HandleTapRowScore( unsigned row )
|
||||
m_pSecondaryScoreKeeper->HandleTapScore( tn );
|
||||
}
|
||||
|
||||
if( m_pPrimaryScoreKeeper != NULL )
|
||||
if( m_pPrimaryScoreKeeper != nullptr )
|
||||
m_pPrimaryScoreKeeper->HandleTapRowScore( m_NoteData, row );
|
||||
if( m_pSecondaryScoreKeeper != NULL )
|
||||
if( m_pSecondaryScoreKeeper != nullptr )
|
||||
m_pSecondaryScoreKeeper->HandleTapRowScore( m_NoteData, row );
|
||||
|
||||
const int iCurCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurCombo : 0;
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public:
|
||||
static float GetMaxStepDistanceSeconds();
|
||||
static float GetWindowSeconds( TimingWindow tw );
|
||||
const NoteData &GetNoteData() const { return m_NoteData; }
|
||||
bool HasVisibleParts() const { return m_pNoteField != NULL; }
|
||||
bool HasVisibleParts() const { return m_pNoteField != nullptr; }
|
||||
|
||||
void SetActorWithJudgmentPosition( Actor *pActor ) { m_pActorWithJudgmentPosition = pActor; }
|
||||
void SetActorWithComboPosition( Actor *pActor ) { m_pActorWithComboPosition = pActor; }
|
||||
|
||||
@@ -282,7 +282,7 @@ void PlayerOptions::FromString( const RString &sMultipleMods )
|
||||
|
||||
bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut )
|
||||
{
|
||||
ASSERT_M( NOTESKIN != NULL, "The Noteskin Manager must be loaded in order to process mods." );
|
||||
ASSERT_M( NOTESKIN != nullptr, "The Noteskin Manager must be loaded in order to process mods." );
|
||||
|
||||
RString sBit = sOneMod;
|
||||
sBit.MakeLower();
|
||||
@@ -764,8 +764,8 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerN
|
||||
|
||||
bool PlayerOptions::IsEasierForCourseAndTrail( Course* pCourse, Trail* pTrail ) const
|
||||
{
|
||||
ASSERT( pCourse != NULL );
|
||||
ASSERT( pTrail != NULL );
|
||||
ASSERT( pCourse != nullptr );
|
||||
ASSERT( pTrail != nullptr );
|
||||
|
||||
return std::any_of(pTrail->m_vEntries.begin(), pTrail->m_vEntries.end(), [&](TrailEntry const &e) {
|
||||
return e.pSong && IsEasierForSongAndSteps(e.pSong, e.pSteps, PLAYER_1);
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ void IPreference::LoadAllDefaults()
|
||||
|
||||
void IPreference::ReadAllPrefsFromNode( const XNode* pNode, bool bIsStatic )
|
||||
{
|
||||
ASSERT( pNode != NULL );
|
||||
ASSERT( pNode != nullptr );
|
||||
for (IPreference *p : *m_Subscribers.m_pSubscribers)
|
||||
p->ReadFrom( pNode, bIsStatic );
|
||||
}
|
||||
|
||||
+6
-6
@@ -1367,7 +1367,7 @@ XNode* Profile::SaveSongScoresCreateNode() const
|
||||
CHECKPOINT;
|
||||
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
XNode* pNode = new XNode( "SongScores" );
|
||||
|
||||
@@ -1448,7 +1448,7 @@ XNode* Profile::SaveCourseScoresCreateNode() const
|
||||
CHECKPOINT;
|
||||
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
XNode* pNode = new XNode( "CourseScores" );
|
||||
|
||||
@@ -1556,7 +1556,7 @@ XNode* Profile::SaveCategoryScoresCreateNode() const
|
||||
CHECKPOINT;
|
||||
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
XNode* pNode = new XNode( "CategoryScores" );
|
||||
|
||||
@@ -1628,7 +1628,7 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pCategoryScores )
|
||||
|
||||
void Profile::SaveStatsWebPageToDir( RString sDir ) const
|
||||
{
|
||||
ASSERT( PROFILEMAN != NULL );
|
||||
ASSERT( PROFILEMAN != nullptr );
|
||||
}
|
||||
|
||||
void Profile::SaveMachinePublicKeyToDir( RString sDir ) const
|
||||
@@ -1664,7 +1664,7 @@ XNode* Profile::SaveScreenshotDataCreateNode() const
|
||||
CHECKPOINT;
|
||||
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
XNode* pNode = new XNode( "ScreenshotData" );
|
||||
|
||||
@@ -1706,7 +1706,7 @@ XNode* Profile::SaveCalorieDataCreateNode() const
|
||||
CHECKPOINT;
|
||||
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
XNode* pNode = new XNode( "CalorieData" );
|
||||
|
||||
|
||||
@@ -114,12 +114,12 @@ void ProfileManager::Init()
|
||||
{
|
||||
RString sCharacterID = FIXED_PROFILE_CHARACTER_ID( i );
|
||||
Character *pCharacter = CHARMAN->GetCharacterFromID( sCharacterID );
|
||||
ASSERT_M( pCharacter != NULL, sCharacterID );
|
||||
ASSERT_M( pCharacter != nullptr, sCharacterID );
|
||||
RString sProfileID;
|
||||
bool b = CreateLocalProfile( pCharacter->GetDisplayName(), sProfileID );
|
||||
ASSERT( b );
|
||||
Profile* pProfile = GetLocalProfile( sProfileID );
|
||||
ASSERT_M( pProfile != NULL, sProfileID );
|
||||
ASSERT_M( pProfile != nullptr, sProfileID );
|
||||
pProfile->m_sCharacterID = sCharacterID;
|
||||
SaveLocalProfile( sProfileID );
|
||||
}
|
||||
@@ -341,7 +341,7 @@ bool ProfileManager::SaveProfile( PlayerNumber pn ) const
|
||||
bool ProfileManager::SaveLocalProfile( RString sProfileID )
|
||||
{
|
||||
const Profile *pProfile = GetLocalProfile( sProfileID );
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
RString sDir = LocalProfileIDToDir( sProfileID );
|
||||
bool b = pProfile->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData );
|
||||
return b;
|
||||
@@ -473,7 +473,7 @@ bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName )
|
||||
ASSERT( !sProfileID.empty() );
|
||||
|
||||
Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID );
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
pProfile->m_sDisplayName = sNewName;
|
||||
|
||||
RString sProfileDir = LocalProfileIDToDir( sProfileID );
|
||||
@@ -483,7 +483,7 @@ bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName )
|
||||
bool ProfileManager::DeleteLocalProfile( RString sProfileID )
|
||||
{
|
||||
Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID );
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
RString sProfileDir = LocalProfileIDToDir( sProfileID );
|
||||
|
||||
// flush directory cache in an attempt to get this working
|
||||
@@ -821,7 +821,7 @@ class LunaProfileManager: public Luna<ProfileManager>
|
||||
{
|
||||
public:
|
||||
static int IsPersistentProfile( T* p, lua_State *L ) { lua_pushboolean(L, p->IsPersistentProfile(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
|
||||
static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); Profile* pP = p->GetProfile(pn); ASSERT(pP != NULL); pP->PushSelf(L); return 1; }
|
||||
static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); Profile* pP = p->GetProfile(pn); ASSERT(pP != nullptr); pP->PushSelf(L); return 1; }
|
||||
static int GetMachineProfile( T* p, lua_State *L ) { p->GetMachineProfile()->PushSelf(L); return 1; }
|
||||
static int SaveMachineProfile( T* p, lua_State * ) { p->SaveMachineProfile(); return 0; }
|
||||
static int GetLocalProfile( T* p, lua_State *L )
|
||||
@@ -833,7 +833,7 @@ public:
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetLocalProfileFromIndex( T* p, lua_State *L ) { Profile *pProfile = p->GetLocalProfileFromIndex(IArg(1)); ASSERT(pProfile != NULL); pProfile->PushSelf(L); return 1; }
|
||||
static int GetLocalProfileFromIndex( T* p, lua_State *L ) { Profile *pProfile = p->GetLocalProfileFromIndex(IArg(1)); ASSERT(pProfile != nullptr); pProfile->PushSelf(L); return 1; }
|
||||
static int GetLocalProfileIDFromIndex( T* p, lua_State *L ) { lua_pushstring(L, p->GetLocalProfileIDFromIndex(IArg(1)) ); return 1; }
|
||||
static int GetLocalProfileIndexFromID( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLocalProfileIndexFromID(SArg(1)) ); return 1; }
|
||||
static int GetNumLocalProfiles( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumLocalProfiles() ); return 1; }
|
||||
|
||||
@@ -73,7 +73,7 @@ void RageBitmapTexture::Create()
|
||||
RString sWarning = ssprintf( "RageBitmapTexture: Couldn't load %s: %s", actualID.filename.c_str(), error.c_str() );
|
||||
Dialog::OK( sWarning );
|
||||
pImg = RageSurfaceUtils::MakeDummySurface( 64, 64 );
|
||||
ASSERT( pImg != NULL );
|
||||
ASSERT( pImg != nullptr );
|
||||
}
|
||||
|
||||
if( actualID.bHotPinkColorKey )
|
||||
|
||||
@@ -653,7 +653,7 @@ RageSurface* RageDisplay_D3D::CreateScreenshot()
|
||||
}
|
||||
|
||||
RageSurface *surface = CreateSurfaceFromPixfmt( RagePixelFormat_RGBA8, lr.pBits, desc.Width, desc.Height, lr.Pitch);
|
||||
ASSERT( surface != NULL );
|
||||
ASSERT( surface != nullptr );
|
||||
|
||||
// We need to make a copy, since lr.pBits will go away when we call UnlockRect().
|
||||
result =
|
||||
@@ -1383,7 +1383,7 @@ void RageDisplay_D3D::UpdateTexture(
|
||||
int xoffset, int yoffset, int width, int height )
|
||||
{
|
||||
IDirect3DTexture9* pTex = (IDirect3DTexture9*)uTexHandle;
|
||||
ASSERT( pTex != NULL );
|
||||
ASSERT( pTex != nullptr );
|
||||
|
||||
RECT rect;
|
||||
rect.left = xoffset;
|
||||
@@ -1406,7 +1406,7 @@ void RageDisplay_D3D::UpdateTexture(
|
||||
ASSERT( texpixfmt != NUM_RagePixelFormat );
|
||||
|
||||
RageSurface *Texture = CreateSurfaceFromPixfmt(RagePixelFormat(texpixfmt), lr.pBits, width, height, lr.Pitch);
|
||||
ASSERT( Texture != NULL );
|
||||
ASSERT( Texture != nullptr );
|
||||
RageSurfaceUtils::Blit( img, Texture, width, height );
|
||||
|
||||
delete Texture;
|
||||
|
||||
@@ -735,7 +735,7 @@ void RageDisplay_Legacy::SetBlendMode( BlendMode mode )
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
if (glBlendEquation != NULL)
|
||||
if (glBlendEquation != nullptr)
|
||||
{
|
||||
if (mode == BLEND_INVERT_DEST)
|
||||
glBlendEquation( GL_FUNC_SUBTRACT );
|
||||
|
||||
@@ -1359,7 +1359,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
|
||||
#define BUFFER_OFFSET(o) ((char*)(o))
|
||||
|
||||
ASSERT( glDrawRangeElements != NULL );
|
||||
ASSERT( glDrawRangeElements != nullptr );
|
||||
glDrawRangeElements(
|
||||
GL_TRIANGLES,
|
||||
meshInfo.iVertexStart, // minimum array index contained in indices
|
||||
@@ -1735,7 +1735,7 @@ void RageDisplay_Legacy::SetBlendMode( BlendMode mode )
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
if (glBlendEquation != NULL)
|
||||
if (glBlendEquation != nullptr)
|
||||
{
|
||||
if (mode == BLEND_INVERT_DEST)
|
||||
glBlendEquation( GL_FUNC_SUBTRACT );
|
||||
@@ -2487,7 +2487,7 @@ void RageDisplay_Legacy::SetRenderTarget( unsigned iTexture, bool bPreserveTextu
|
||||
}
|
||||
|
||||
/* If we already had a render target, disable it. */
|
||||
if (g_pCurrentRenderTarget != NULL)
|
||||
if (g_pCurrentRenderTarget != nullptr)
|
||||
SetRenderTarget(0, true);
|
||||
|
||||
/* Enable the new render target. */
|
||||
|
||||
@@ -55,7 +55,7 @@ void RageException::Throw( const char *sFmt, ... )
|
||||
|
||||
ASSERT_M( g_HandlerThreadID == RageThread::GetInvalidThreadID() || g_HandlerThreadID == RageThread::GetCurrentThreadID(),
|
||||
ssprintf("RageException::Throw() on another thread: %s", error.c_str()) );
|
||||
if( g_CleanupHandler != NULL )
|
||||
if( g_CleanupHandler != nullptr )
|
||||
g_CleanupHandler( error );
|
||||
|
||||
exit(1);
|
||||
|
||||
+4
-4
@@ -44,7 +44,7 @@ RString RageFile::GetPath() const
|
||||
|
||||
bool RageFile::Open( const RString& path, int mode )
|
||||
{
|
||||
ASSERT( FILEMAN != NULL );
|
||||
ASSERT( FILEMAN != nullptr );
|
||||
Close();
|
||||
|
||||
m_Path = path;
|
||||
@@ -122,14 +122,14 @@ bool RageFile::AtEOF() const
|
||||
|
||||
void RageFile::ClearError()
|
||||
{
|
||||
if( m_File != NULL )
|
||||
if( m_File != nullptr )
|
||||
m_File->ClearError();
|
||||
m_sError = "";
|
||||
}
|
||||
|
||||
RString RageFile::GetError() const
|
||||
{
|
||||
if( m_File != NULL && m_File->GetError() != "" )
|
||||
if( m_File != nullptr && m_File->GetError() != "" )
|
||||
return m_File->GetError();
|
||||
return m_sError;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ RString RageFile::GetError() const
|
||||
|
||||
void RageFile::SetError( const RString &err )
|
||||
{
|
||||
if( m_File != NULL )
|
||||
if( m_File != nullptr )
|
||||
m_File->ClearError();
|
||||
m_sError = err;
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
bool Open( const RString& path, int mode = READ );
|
||||
void Close();
|
||||
bool IsOpen() const { return m_File != NULL; }
|
||||
bool IsOpen() const { return m_File != nullptr; }
|
||||
|
||||
bool AtEOF() const;
|
||||
RString GetError() const;
|
||||
|
||||
@@ -25,7 +25,7 @@ RageFileObj::RageFileObj( const RageFileObj &cpy ):
|
||||
RageFileBasic(cpy)
|
||||
{
|
||||
/* If the original file has a buffer, copy it. */
|
||||
if( cpy.m_pReadBuffer != NULL )
|
||||
if( cpy.m_pReadBuffer != nullptr )
|
||||
{
|
||||
m_pReadBuffer = new char[BSIZE];
|
||||
memcpy( m_pReadBuffer, cpy.m_pReadBuffer, BSIZE );
|
||||
@@ -38,7 +38,7 @@ RageFileObj::RageFileObj( const RageFileObj &cpy ):
|
||||
m_pReadBuffer = NULL;
|
||||
}
|
||||
|
||||
if( cpy.m_pWriteBuffer != NULL )
|
||||
if( cpy.m_pWriteBuffer != nullptr )
|
||||
{
|
||||
m_pWriteBuffer = new char[cpy.m_iWriteBufferSize];
|
||||
memcpy( m_pWriteBuffer, cpy.m_pWriteBuffer, m_iWriteBufferUsed );
|
||||
@@ -105,7 +105,7 @@ int RageFileObj::Read( void *pBuffer, size_t iBytes )
|
||||
|
||||
while( !m_bEOF && iBytes > 0 )
|
||||
{
|
||||
if( m_pReadBuffer != NULL && m_iReadBufAvail )
|
||||
if( m_pReadBuffer != nullptr && m_iReadBufAvail )
|
||||
{
|
||||
/* Copy data out of the buffer first. */
|
||||
int iFromBuffer = min( (int) iBytes, m_iReadBufAvail );
|
||||
@@ -230,7 +230,7 @@ int RageFileObj::EmptyWriteBuf()
|
||||
|
||||
int RageFileObj::Write( const void *pBuffer, size_t iBytes )
|
||||
{
|
||||
if( m_pWriteBuffer != NULL )
|
||||
if( m_pWriteBuffer != nullptr )
|
||||
{
|
||||
/* If the file position has moved away from the write buffer, or the
|
||||
* incoming data won't fit in the buffer, flush. */
|
||||
@@ -429,7 +429,7 @@ int RageFileObj::PutLine( const RString &sStr )
|
||||
int RageFileObj::FillReadBuf()
|
||||
{
|
||||
/* Don't call this unless buffering is enabled. */
|
||||
ASSERT( m_pReadBuffer != NULL );
|
||||
ASSERT( m_pReadBuffer != nullptr );
|
||||
|
||||
/* The buffer starts at m_Buffer; any data in it starts at m_pReadBuf; space between
|
||||
* the two is old data that we've read. (Don't mangle that data; we can use it
|
||||
|
||||
@@ -400,7 +400,7 @@ RageFileObjInflate *GunzipFile( RageFileBasic *pFile_, RString &sError, uint32_t
|
||||
|
||||
uint32_t iExpectedCRC32 = FileReading::read_u32_le( *pFile, sError );
|
||||
uint32_t iUncompressedSize = FileReading::read_u32_le( *pFile, sError );
|
||||
if( iCRC32 != NULL )
|
||||
if( iCRC32 != nullptr )
|
||||
*iCRC32 = iExpectedCRC32;
|
||||
|
||||
FileReading::Seek( *pFile, iDataPos, sError );
|
||||
@@ -414,7 +414,7 @@ RageFileObjInflate *GunzipFile( RageFileBasic *pFile_, RString &sError, uint32_t
|
||||
pInflateFile->DeleteFileWhenFinished();
|
||||
|
||||
/* Enable CRC calculation only if the caller is interested. */
|
||||
if( iCRC32 != NULL )
|
||||
if( iCRC32 != nullptr )
|
||||
pInflateFile->EnableCRC32();
|
||||
|
||||
return pInflateFile;
|
||||
|
||||
@@ -177,7 +177,7 @@ ThreadedFileWorker::~ThreadedFileWorker()
|
||||
{
|
||||
StopThread();
|
||||
|
||||
if( m_pChildDriver != NULL )
|
||||
if( m_pChildDriver != nullptr )
|
||||
FILEMAN->ReleaseFileDriver( m_pChildDriver );
|
||||
|
||||
/* Unregister ourself. */
|
||||
@@ -216,7 +216,7 @@ void ThreadedFileWorker::HandleRequest( int iRequest )
|
||||
break;
|
||||
|
||||
case REQ_CLOSE:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
delete m_pRequestFile;
|
||||
|
||||
/* Clear m_pRequestFile, so RequestTimedOut doesn't double-delete. */
|
||||
@@ -224,38 +224,38 @@ void ThreadedFileWorker::HandleRequest( int iRequest )
|
||||
break;
|
||||
|
||||
case REQ_GET_FILE_SIZE:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
m_iResultRequest = m_pRequestFile->GetFileSize();
|
||||
break;
|
||||
|
||||
case REQ_SEEK:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
m_iResultRequest = m_pRequestFile->Seek( m_iRequestPos );
|
||||
m_sResultError = m_pRequestFile->GetError();
|
||||
break;
|
||||
|
||||
case REQ_READ:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pResultBuffer != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
ASSERT( m_pResultBuffer != nullptr );
|
||||
m_iResultRequest = m_pRequestFile->Read( m_pResultBuffer, m_iRequestSize );
|
||||
m_sResultError = m_pRequestFile->GetError();
|
||||
break;
|
||||
|
||||
case REQ_WRITE:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pRequestBuffer != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
ASSERT( m_pRequestBuffer != nullptr );
|
||||
m_iResultRequest = m_pRequestFile->Write( m_pRequestBuffer, m_iRequestSize );
|
||||
m_sResultError = m_pRequestFile->GetError();
|
||||
break;
|
||||
|
||||
case REQ_FLUSH:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
m_iResultRequest = m_pRequestFile->Flush();
|
||||
m_sResultError = m_pRequestFile->GetError();
|
||||
break;
|
||||
|
||||
case REQ_COPY:
|
||||
ASSERT( m_pRequestFile != NULL );
|
||||
ASSERT( m_pRequestFile != nullptr );
|
||||
m_pResultFile = m_pRequestFile->Copy();
|
||||
break;
|
||||
|
||||
@@ -328,7 +328,7 @@ RageFileBasic *ThreadedFileWorker::Open( const RString &sPath, int iMode, int &i
|
||||
|
||||
void ThreadedFileWorker::Close( RageFileBasic *pFile )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
if( pFile == NULL )
|
||||
return;
|
||||
@@ -353,7 +353,7 @@ void ThreadedFileWorker::Close( RageFileBasic *pFile )
|
||||
|
||||
int ThreadedFileWorker::GetFileSize( RageFileBasic *&pFile )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -381,7 +381,7 @@ int ThreadedFileWorker::GetFileSize( RageFileBasic *&pFile )
|
||||
|
||||
int ThreadedFileWorker::GetFD( RageFileBasic *&pFile )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -409,7 +409,7 @@ int ThreadedFileWorker::GetFD( RageFileBasic *&pFile )
|
||||
|
||||
int ThreadedFileWorker::Seek( RageFileBasic *&pFile, int iPos, RString &sError )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -444,7 +444,7 @@ int ThreadedFileWorker::Seek( RageFileBasic *&pFile, int iPos, RString &sError )
|
||||
|
||||
int ThreadedFileWorker::Read( RageFileBasic *&pFile, void *pBuf, int iSize, RString &sError )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -486,7 +486,7 @@ int ThreadedFileWorker::Read( RageFileBasic *&pFile, void *pBuf, int iSize, RStr
|
||||
|
||||
int ThreadedFileWorker::Write( RageFileBasic *&pFile, const void *pBuf, int iSize, RString &sError )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -527,7 +527,7 @@ int ThreadedFileWorker::Write( RageFileBasic *&pFile, const void *pBuf, int iSiz
|
||||
|
||||
int ThreadedFileWorker::Flush( RageFileBasic *&pFile, RString &sError )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -562,7 +562,7 @@ int ThreadedFileWorker::Flush( RageFileBasic *&pFile, RString &sError )
|
||||
|
||||
RageFileBasic *ThreadedFileWorker::Copy( RageFileBasic *&pFile, RString &sError )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -619,7 +619,7 @@ bool ThreadedFileWorker::PopulateFileSet( FileSet &fs, const RString &sPath )
|
||||
|
||||
int ThreadedFileWorker::Move( const RString &sOldPath, const RString &sNewPath )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -639,7 +639,7 @@ int ThreadedFileWorker::Move( const RString &sOldPath, const RString &sNewPath )
|
||||
|
||||
int ThreadedFileWorker::Remove( const RString &sPath )
|
||||
{
|
||||
ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */
|
||||
ASSERT( m_pChildDriver != nullptr ); /* how did you get a file to begin with? */
|
||||
|
||||
/* If we're currently in a timed-out state, fail. */
|
||||
if( IsTimedOut() )
|
||||
@@ -710,7 +710,7 @@ public:
|
||||
|
||||
~RageFileObjTimeout()
|
||||
{
|
||||
if( m_pFile != NULL )
|
||||
if( m_pFile != nullptr )
|
||||
{
|
||||
Flush();
|
||||
m_pWorker->Close( m_pFile );
|
||||
@@ -853,13 +853,13 @@ public:
|
||||
|
||||
void SetWorker( ThreadedFileWorker *pWorker )
|
||||
{
|
||||
ASSERT( pWorker != NULL );
|
||||
ASSERT( pWorker != nullptr );
|
||||
m_pWorker = pWorker;
|
||||
}
|
||||
|
||||
void PopulateFileSet( FileSet &fs, const RString &sPath )
|
||||
{
|
||||
ASSERT( m_pWorker != NULL );
|
||||
ASSERT( m_pWorker != nullptr );
|
||||
m_pWorker->PopulateFileSet( fs, sPath );
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ RageFileDriver *RageFileManager::GetFileDriver( RString sMountpoint )
|
||||
|
||||
void RageFileManager::ReleaseFileDriver( RageFileDriver *pDriver )
|
||||
{
|
||||
ASSERT( pDriver != NULL );
|
||||
ASSERT( pDriver != nullptr );
|
||||
|
||||
g_Mutex->Lock();
|
||||
unsigned i;
|
||||
|
||||
+5
-5
@@ -101,7 +101,7 @@ void RageInput::WindowReset()
|
||||
|
||||
void RageInput::AddHandler( InputHandler *pHandler )
|
||||
{
|
||||
ASSERT( pHandler != NULL );
|
||||
ASSERT( pHandler != nullptr );
|
||||
|
||||
LoadedInputHandler hand;
|
||||
hand.m_pDevice = pHandler;
|
||||
@@ -125,7 +125,7 @@ InputHandler *RageInput::GetHandlerForDevice( const InputDevice id )
|
||||
RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( di.device );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->GetDeviceSpecificInputString(di);
|
||||
else
|
||||
return di.ToString();
|
||||
@@ -134,7 +134,7 @@ RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di )
|
||||
RString RageInput::GetLocalizedInputString( const DeviceInput &di )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( di.device );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->GetLocalizedInputString(di);
|
||||
else
|
||||
return Capitalize( DeviceButtonToString(di.button) );
|
||||
@@ -143,7 +143,7 @@ RString RageInput::GetLocalizedInputString( const DeviceInput &di )
|
||||
wchar_t RageInput::DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifiers )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( di.device );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->DeviceButtonToChar(di.button, bUseCurrentKeyModifiers);
|
||||
else
|
||||
return '\0';
|
||||
@@ -152,7 +152,7 @@ wchar_t RageInput::DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifie
|
||||
InputDeviceState RageInput::GetInputDeviceState( InputDevice id )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( id );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->GetInputDeviceState(id);
|
||||
else
|
||||
return InputDeviceState_NoInputHandler;
|
||||
|
||||
+4
-4
@@ -53,7 +53,7 @@ RageSound::RageSound():
|
||||
m_iStoppedSourceFrame(0), m_bPlaying(false),
|
||||
m_bDeleteWhenFinished(false), m_sError("")
|
||||
{
|
||||
ASSERT( SOUNDMAN != NULL );
|
||||
ASSERT( SOUNDMAN != nullptr );
|
||||
}
|
||||
|
||||
RageSound::~RageSound()
|
||||
@@ -65,7 +65,7 @@ RageSound::RageSound( const RageSound &cpy ):
|
||||
RageSoundBase( cpy ),
|
||||
m_Mutex( "RageSound" )
|
||||
{
|
||||
ASSERT(SOUNDMAN != NULL);
|
||||
ASSERT(SOUNDMAN != nullptr);
|
||||
|
||||
m_pSource = NULL;
|
||||
|
||||
@@ -130,7 +130,7 @@ void RageSound::DeleteSelfWhenFinishedPlaying()
|
||||
|
||||
bool RageSound::IsLoaded() const
|
||||
{
|
||||
return m_pSource != NULL;
|
||||
return m_pSource != nullptr;
|
||||
}
|
||||
|
||||
class RageSoundReader_Silence: public RageSoundReader
|
||||
@@ -266,7 +266,7 @@ int RageSound::GetDataToPlay( float *pBuffer, int iFrames, int64_t &iStreamFrame
|
||||
// LockMut(m_Mutex);
|
||||
|
||||
ASSERT_M( m_bPlaying, ssprintf("%p", this) );
|
||||
ASSERT( m_pSource != NULL );
|
||||
ASSERT( m_pSource != nullptr );
|
||||
|
||||
iFramesStored = 0;
|
||||
iStreamFrame = m_iStreamFrame;
|
||||
|
||||
@@ -69,13 +69,13 @@ void RageSoundManager::Shutdown()
|
||||
|
||||
void RageSoundManager::StartMixing( RageSoundBase *pSound )
|
||||
{
|
||||
if( m_pDriver != NULL )
|
||||
if( m_pDriver != nullptr )
|
||||
m_pDriver->StartMixing( pSound );
|
||||
}
|
||||
|
||||
void RageSoundManager::StopMixing( RageSoundBase *pSound )
|
||||
{
|
||||
if( m_pDriver != NULL )
|
||||
if( m_pDriver != nullptr )
|
||||
m_pDriver->StopMixing( pSound );
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ void RageSoundManager::Update()
|
||||
|
||||
g_SoundManMutex.Unlock(); /* finished with m_mapPreloadedSounds */
|
||||
|
||||
if( m_pDriver != NULL )
|
||||
if( m_pDriver != nullptr )
|
||||
m_pDriver->Update();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
RageSoundReader_Extend::RageSoundReader_Extend( RageSoundReader *pSource ):
|
||||
RageSoundReader_Filter( pSource )
|
||||
{
|
||||
ASSERT_M(pSource != NULL, "The music file was not found! Was it deleted or moved while the game was on?");
|
||||
ASSERT_M(pSource != nullptr, "The music file was not found! Was it deleted or moved while the game was on?");
|
||||
m_iPositionFrames = pSource->GetNextSourceFrame();
|
||||
|
||||
m_StopMode = M_STOP;
|
||||
|
||||
@@ -270,7 +270,7 @@ static int get_this_frame_byte( const madlib_t *mad )
|
||||
int ret = mad->inbuf_filepos;
|
||||
|
||||
/* If we have a frame, adjust. */
|
||||
if( mad->Stream.this_frame != NULL )
|
||||
if( mad->Stream.this_frame != nullptr )
|
||||
ret += mad->Stream.this_frame-mad->inbuf;
|
||||
|
||||
return ret;
|
||||
@@ -331,7 +331,7 @@ int RageSoundReader_MP3::fill_buffer()
|
||||
{
|
||||
/* Need more data. */
|
||||
int inbytes = 0;
|
||||
if( mad->Stream.next_frame != NULL )
|
||||
if( mad->Stream.next_frame != nullptr )
|
||||
{
|
||||
/* Pull out remaining data from the last buffer. */
|
||||
inbytes = mad->Stream.bufend-mad->Stream.next_frame;
|
||||
|
||||
@@ -47,7 +47,7 @@ int RageSoundReader_Preload::GetTotalFrames() const
|
||||
|
||||
bool RageSoundReader_Preload::Open( RageSoundReader *pSource )
|
||||
{
|
||||
ASSERT( pSource != NULL );
|
||||
ASSERT( pSource != nullptr );
|
||||
m_iSampleRate = pSource->GetSampleRate();
|
||||
m_iChannels = pSource->GetNumChannels();
|
||||
m_fRate = pSource->GetStreamToSourceRatio();
|
||||
|
||||
@@ -667,7 +667,7 @@ int RageSoundReader_Resample_Good::Read( float *pBuf, int iFrames )
|
||||
{
|
||||
int iFramesNeeded = m_apResamplers[0]->NumInputsForOutputSamples(iFrames);
|
||||
float *pTmpBuf = (float *) alloca( iFramesNeeded * sizeof(float) * iChannels );
|
||||
ASSERT( pTmpBuf != NULL );
|
||||
ASSERT( pTmpBuf != nullptr );
|
||||
int iFramesIn = m_pSource->Read( pTmpBuf, iFramesNeeded );
|
||||
if( iFramesIn < 0 )
|
||||
return iFramesIn;
|
||||
|
||||
@@ -191,7 +191,7 @@ int RageSoundReader_Vorbisfile::Read( float *buf, int iFrames )
|
||||
|
||||
{
|
||||
vorbis_info *vi = ov_info( vf, -1 );
|
||||
ASSERT( vi != NULL );
|
||||
ASSERT( vi != nullptr );
|
||||
|
||||
if( (unsigned) vi->channels != channels )
|
||||
RageException::Throw( "File \"%s\" changes channel count from %i to %i; not supported.",
|
||||
@@ -261,17 +261,17 @@ int RageSoundReader_Vorbisfile::Read( float *buf, int iFrames )
|
||||
|
||||
int RageSoundReader_Vorbisfile::GetSampleRate() const
|
||||
{
|
||||
ASSERT(vf != NULL);
|
||||
ASSERT(vf != nullptr);
|
||||
|
||||
vorbis_info *vi = ov_info(vf, -1);
|
||||
ASSERT(vi != NULL);
|
||||
ASSERT(vi != nullptr);
|
||||
|
||||
return vi->rate;
|
||||
}
|
||||
|
||||
int RageSoundReader_Vorbisfile::GetNextSourceFrame() const
|
||||
{
|
||||
ASSERT(vf != NULL);
|
||||
ASSERT(vf != nullptr);
|
||||
|
||||
int iFrame = (int)ov_pcm_tell( vf );
|
||||
return iFrame;
|
||||
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
int iMaxSize = min( (int) m_WavData.m_iBlockAlign - 7 * m_WavData.m_iChannels, (m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos) - m_File.Tell() );
|
||||
|
||||
char *pBuf = (char *) alloca( iMaxSize );
|
||||
ASSERT( pBuf != NULL );
|
||||
ASSERT( pBuf != nullptr );
|
||||
|
||||
int iBlockSize = m_File.Read( pBuf, iMaxSize );
|
||||
if( iBlockSize == 0 )
|
||||
@@ -581,25 +581,25 @@ RageSoundReader_FileReader::OpenResult RageSoundReader_WAV::Open( RageFileBasic
|
||||
|
||||
int RageSoundReader_WAV::GetLength() const
|
||||
{
|
||||
ASSERT( m_pImpl != NULL );
|
||||
ASSERT( m_pImpl != nullptr );
|
||||
return m_pImpl->GetLength();
|
||||
}
|
||||
|
||||
int RageSoundReader_WAV::SetPosition( int iFrame )
|
||||
{
|
||||
ASSERT( m_pImpl != NULL );
|
||||
ASSERT( m_pImpl != nullptr );
|
||||
return m_pImpl->SetPosition( iFrame );
|
||||
}
|
||||
|
||||
int RageSoundReader_WAV::GetNextSourceFrame() const
|
||||
{
|
||||
ASSERT( m_pImpl != NULL );
|
||||
ASSERT( m_pImpl != nullptr );
|
||||
return m_pImpl->GetNextSourceFrame();
|
||||
}
|
||||
|
||||
int RageSoundReader_WAV::Read( float *pBuf, int iFrames )
|
||||
{
|
||||
ASSERT( m_pImpl != NULL );
|
||||
ASSERT( m_pImpl != nullptr );
|
||||
return m_pImpl->Read( pBuf, iFrames );
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ void RageSurfaceFormat::GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b
|
||||
{
|
||||
if( BytesPerPixel == 1 )
|
||||
{
|
||||
ASSERT( palette != NULL );
|
||||
ASSERT( palette != nullptr );
|
||||
*r = palette->colors[val].r;
|
||||
*g = palette->colors[val].g;
|
||||
*b = palette->colors[val].b;
|
||||
|
||||
@@ -134,7 +134,7 @@ void RageSurfaceUtils::CopySurface( const RageSurface *src, RageSurface *dest )
|
||||
// Copy the palette, if we have one.
|
||||
if( src->format->BitsPerPixel == 8 && dest->format->BitsPerPixel == 8 )
|
||||
{
|
||||
ASSERT( dest->fmt.palette != NULL );
|
||||
ASSERT( dest->fmt.palette != nullptr );
|
||||
*dest->fmt.palette = *src->fmt.palette;
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ RageSurface *RageSurfaceUtils::LoadSurface( RString file )
|
||||
// Create the surface.
|
||||
RageSurface *img = CreateSurface( h.width, h.height, h.bpp,
|
||||
h.Rmask, h.Gmask, h.Bmask, h.Amask );
|
||||
ASSERT( img != NULL );
|
||||
ASSERT( img != nullptr );
|
||||
|
||||
/* If the pitch has changed, this surface is either corrupt, or was
|
||||
* created with a different version whose CreateSurface() behavior
|
||||
|
||||
@@ -48,7 +48,7 @@ struct acolorhash_hash
|
||||
for( unsigned i = 0; i < HASH_SIZE; ++i )
|
||||
{
|
||||
acolorhist_list achl, achlnext;
|
||||
for ( achl = hash[i]; achl != NULL; achl = achlnext )
|
||||
for ( achl = hash[i]; achl != nullptr; achl = achlnext )
|
||||
{
|
||||
achlnext = achl->next;
|
||||
free( achl );
|
||||
@@ -123,7 +123,7 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither
|
||||
while(1)
|
||||
{
|
||||
achv = pam_computeacolorhist( pImg, MAXCOLORS, &colors );
|
||||
if( achv != NULL )
|
||||
if( achv != nullptr )
|
||||
break;
|
||||
pixval newmaxval = maxval / 2;
|
||||
|
||||
@@ -330,9 +330,9 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i
|
||||
int boxes;
|
||||
|
||||
bv = (box_vector) malloc( sizeof(struct box) * newcolors );
|
||||
ASSERT( bv != NULL );
|
||||
ASSERT( bv != nullptr );
|
||||
acolormap = (acolorhist_item*) malloc( sizeof(struct acolorhist_item) * newcolors);
|
||||
ASSERT( acolormap != NULL );
|
||||
ASSERT( acolormap != nullptr );
|
||||
|
||||
for ( int i = 0; i < newcolors; ++i )
|
||||
PAM_ASSIGN( acolormap[i].acolor, 0, 0, 0, 0 );
|
||||
@@ -516,17 +516,17 @@ static bool pam_computeacolorhash( const RageSurface *src, int maxacolors, int*
|
||||
{
|
||||
int hashval = pam_hashapixel( *pP );
|
||||
acolorhist_list achl;
|
||||
for ( achl = hash.hash[hashval]; achl != NULL; achl = achl->next )
|
||||
for ( achl = hash.hash[hashval]; achl != nullptr; achl = achl->next )
|
||||
if ( PAM_EQUAL( achl->ch.acolor, *pP ) )
|
||||
break;
|
||||
if ( achl != NULL )
|
||||
if ( achl != nullptr )
|
||||
++achl->ch.value;
|
||||
else
|
||||
{
|
||||
if ( ++(*acolorsP) > maxacolors )
|
||||
return false;
|
||||
achl = (acolorhist_list) malloc( sizeof(struct acolorhist_list_item) );
|
||||
ASSERT( achl != NULL );
|
||||
ASSERT( achl != nullptr );
|
||||
|
||||
memcpy( achl->ch.acolor, *pP, sizeof(apixel) );
|
||||
achl->ch.value = 1;
|
||||
@@ -543,13 +543,13 @@ static acolorhist_item *pam_acolorhashtoacolorhist( const acolorhash_hash &acht,
|
||||
{
|
||||
// Collate the hash table into a simple acolorhist array.
|
||||
acolorhist_item *achv = (acolorhist_item*) malloc( maxacolors * sizeof(struct acolorhist_item) );
|
||||
ASSERT( achv != NULL );
|
||||
ASSERT( achv != nullptr );
|
||||
|
||||
// Loop through the hash table.
|
||||
int j = 0;
|
||||
for( unsigned i = 0; i < HASH_SIZE; ++i )
|
||||
{
|
||||
for ( acolorhist_list achl = acht.hash[i]; achl != NULL; achl = achl->next )
|
||||
for ( acolorhist_list achl = acht.hash[i]; achl != nullptr; achl = achl->next )
|
||||
{
|
||||
// Add the new entry.
|
||||
achv[j] = achl->ch;
|
||||
@@ -574,7 +574,7 @@ static acolorhist_item *pam_computeacolorhist( const RageSurface *src, int maxac
|
||||
static void pam_addtoacolorhash( acolorhash_hash &acht, const uint8_t acolorP[4], int value )
|
||||
{
|
||||
acolorhist_list achl = (acolorhist_list) malloc( sizeof(struct acolorhist_list_item) );
|
||||
ASSERT( achl != NULL );
|
||||
ASSERT( achl != nullptr );
|
||||
|
||||
int hash = pam_hashapixel( acolorP );
|
||||
memcpy( achl->ch.acolor, acolorP, sizeof(apixel) );
|
||||
@@ -587,7 +587,7 @@ static void pam_addtoacolorhash( acolorhash_hash &acht, const uint8_t acolorP[4]
|
||||
static int pam_lookupacolor( const acolorhash_hash &acht, const uint8_t acolorP[4] )
|
||||
{
|
||||
const int hash = pam_hashapixel( acolorP );
|
||||
for ( acolorhist_list_item *achl = acht.hash[hash]; achl != NULL; achl = achl->next )
|
||||
for ( acolorhist_list_item *achl = acht.hash[hash]; achl != nullptr; achl = achl->next )
|
||||
if ( PAM_EQUAL( achl->ch.acolor, acolorP ) )
|
||||
return achl->ch.value;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ static RageSurface *TryOpenFile( RString sPath, bool bHeaderOnly, RString &error
|
||||
|
||||
if( result == RageSurfaceUtils::OPEN_OK )
|
||||
{
|
||||
ASSERT( ret != NULL );
|
||||
ASSERT( ret != nullptr );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ RageSurfaceUtils::OpenResult RageSurface_Load_BMP( const RString &sPath, RageSur
|
||||
img = NULL;
|
||||
ret = LoadBMP( f, img, error );
|
||||
|
||||
if( ret != RageSurfaceUtils::OPEN_OK && img != NULL )
|
||||
if( ret != RageSurfaceUtils::OPEN_OK && img != nullptr )
|
||||
{
|
||||
delete img;
|
||||
img = NULL;
|
||||
|
||||
@@ -229,7 +229,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
default:
|
||||
FAIL_M(ssprintf( "%i", type) );
|
||||
}
|
||||
ASSERT( img != NULL );
|
||||
ASSERT( img != nullptr );
|
||||
|
||||
/* alloca to prevent memleaks if libpng longjmps us */
|
||||
png_byte **row_pointers = (png_byte **) alloca( sizeof(png_byte*) * height );
|
||||
|
||||
@@ -27,7 +27,7 @@ RageTexturePreloader &RageTexturePreloader::operator=( const RageTexturePreloade
|
||||
|
||||
void RageTexturePreloader::Load( const RageTextureID &ID )
|
||||
{
|
||||
ASSERT( TEXTUREMAN != NULL );
|
||||
ASSERT( TEXTUREMAN != nullptr );
|
||||
|
||||
RageTexture *pTexture = TEXTUREMAN->LoadTexture( ID );
|
||||
m_apTextures.push_back( pTexture );
|
||||
|
||||
+11
-11
@@ -94,12 +94,12 @@ void ThreadSlot::ThreadCheckpoint::Set( const char *szFile, int iLine, const cha
|
||||
m_szMessage = szMessage;
|
||||
|
||||
/* Skip any path components. */
|
||||
if( m_szFile != NULL )
|
||||
if( m_szFile != nullptr )
|
||||
{
|
||||
const char *p = strrchr( m_szFile, '/' );
|
||||
if( p == NULL )
|
||||
p = strrchr( m_szFile, '\\' );
|
||||
if( p != NULL && p[1] != '\0' )
|
||||
if( p != nullptr && p[1] != '\0' )
|
||||
m_szFile = p+1;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ RageThread::RageThread( const RageThread &cpy ):
|
||||
|
||||
RageThread::~RageThread()
|
||||
{
|
||||
if( m_pSlot != NULL )
|
||||
if( m_pSlot != nullptr )
|
||||
Wait();
|
||||
}
|
||||
|
||||
@@ -310,8 +310,8 @@ bool RageThread::EnumThreadIDs( int n, uint64_t &iID )
|
||||
|
||||
int RageThread::Wait()
|
||||
{
|
||||
ASSERT( m_pSlot != NULL );
|
||||
ASSERT( m_pSlot->m_pImpl != NULL );
|
||||
ASSERT( m_pSlot != nullptr );
|
||||
ASSERT( m_pSlot->m_pImpl != nullptr );
|
||||
int ret = m_pSlot->m_pImpl->Wait();
|
||||
|
||||
LockMut( GetThreadSlotsLock() );
|
||||
@@ -323,14 +323,14 @@ int RageThread::Wait()
|
||||
}
|
||||
|
||||
void RageThread::Halt(bool Kill) {
|
||||
ASSERT( m_pSlot != NULL );
|
||||
ASSERT( m_pSlot->m_pImpl != NULL );
|
||||
ASSERT( m_pSlot != nullptr );
|
||||
ASSERT( m_pSlot->m_pImpl != nullptr );
|
||||
m_pSlot->m_pImpl->Halt(Kill);
|
||||
}
|
||||
|
||||
void RageThread::Resume() {
|
||||
ASSERT( m_pSlot != NULL );
|
||||
ASSERT( m_pSlot->m_pImpl != NULL );
|
||||
ASSERT( m_pSlot != nullptr );
|
||||
ASSERT( m_pSlot->m_pImpl != nullptr );
|
||||
m_pSlot->m_pImpl->Resume();
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ void Checkpoints::GetLogs( char *pBuf, int iSize, const char *delim )
|
||||
strcat( pBuf, buf );
|
||||
strcat( pBuf, delim );
|
||||
|
||||
for( int line = 1; (buf = GetCheckpointLog(slotno, line)) != NULL; ++line )
|
||||
for( int line = 1; (buf = GetCheckpointLog(slotno, line)) != nullptr; ++line )
|
||||
{
|
||||
strcat( pBuf, buf );
|
||||
strcat( pBuf, delim );
|
||||
@@ -704,7 +704,7 @@ bool RageEvent::Wait( RageTimer *pTimeout )
|
||||
ASSERT( m_LockCnt == 0 );
|
||||
|
||||
/* A zero RageTimer also means no timeout. */
|
||||
if( pTimeout != NULL && pTimeout->IsZero() )
|
||||
if( pTimeout != nullptr && pTimeout->IsZero() )
|
||||
pTimeout = NULL;
|
||||
bool bRet = m_pEvent->Wait( pTimeout );
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public:
|
||||
static const char *GetThreadNameByID( uint64_t iID );
|
||||
static bool EnumThreadIDs( int n, uint64_t &iID );
|
||||
int Wait();
|
||||
bool IsCreated() const { return m_pSlot != NULL; }
|
||||
bool IsCreated() const { return m_pSlot != nullptr; }
|
||||
|
||||
/* A system can define HAVE_TLS, indicating that it can compile thread_local
|
||||
* code, but an individual environment may not actually have functional TLS.
|
||||
|
||||
+4
-4
@@ -1027,7 +1027,7 @@ bool GetCommandlineArgument( const RString &option, RString *argument, int iInde
|
||||
RString GetCwd()
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
bool ret = getcwd(buf, PATH_MAX) != NULL;
|
||||
bool ret = getcwd(buf, PATH_MAX) != nullptr;
|
||||
ASSERT(ret);
|
||||
return buf;
|
||||
}
|
||||
@@ -2274,7 +2274,7 @@ bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bRe
|
||||
if( in.Read(data, 1024*32) == -1 )
|
||||
{
|
||||
sError = ssprintf( "read error: %s", in.GetError().c_str() );
|
||||
if( bReadError != NULL )
|
||||
if( bReadError != nullptr )
|
||||
*bReadError = true;
|
||||
return false;
|
||||
}
|
||||
@@ -2284,7 +2284,7 @@ bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bRe
|
||||
if( i == -1 )
|
||||
{
|
||||
sError = ssprintf( "write error: %s", out.GetError().c_str() );
|
||||
if( bReadError != NULL )
|
||||
if( bReadError != nullptr )
|
||||
*bReadError = false;
|
||||
return false;
|
||||
}
|
||||
@@ -2293,7 +2293,7 @@ bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bRe
|
||||
if( out.Flush() == -1 )
|
||||
{
|
||||
sError = ssprintf( "write error: %s", out.GetError().c_str() );
|
||||
if( bReadError != NULL )
|
||||
if( bReadError != nullptr )
|
||||
*bReadError = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
|
||||
HiddenPtr( const HiddenPtr<T> &cpy ): m_pPtr(NULL)
|
||||
{
|
||||
if( cpy.m_pPtr != NULL )
|
||||
if( cpy.m_pPtr != nullptr )
|
||||
m_pPtr = HiddenPtrTraits<T>::Copy( cpy.m_pPtr );
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
~CachedObject()
|
||||
{
|
||||
if( m_pObject != NULL )
|
||||
if( m_pObject != nullptr )
|
||||
ClearCacheSpecific( m_pObject );
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
CachedObjectHelpers::Lock();
|
||||
m_pCache = p;
|
||||
m_bCacheIsSet = true;
|
||||
if( p != NULL )
|
||||
if( p != nullptr )
|
||||
p->m_CachedObject.m_pObject = p;
|
||||
CachedObjectHelpers::Unlock();
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ FileSet *FilenameDB::GetFileSet( const RString &sDir_, bool bCreate )
|
||||
|
||||
/* This also re-locks m_Mutex for us. */
|
||||
FileSet *pParent = GetFileSet( sParent );
|
||||
if( pParent != NULL )
|
||||
if( pParent != nullptr )
|
||||
{
|
||||
set<File>::iterator it = pParent->files.find( File(Basename(sDir)) );
|
||||
if( it != pParent->files.end() )
|
||||
@@ -361,7 +361,7 @@ FileSet *FilenameDB::GetFileSet( const RString &sDir_, bool bCreate )
|
||||
m_Mutex.Lock();
|
||||
}
|
||||
|
||||
if( pParentDirp != NULL )
|
||||
if( pParentDirp != nullptr )
|
||||
*pParentDirp = pRet;
|
||||
|
||||
pRet->age.Touch();
|
||||
@@ -559,7 +559,7 @@ void *FilenameDB::GetFilePriv( const RString &path )
|
||||
|
||||
const File *pFile = GetFile( path );
|
||||
void *pRet = NULL;
|
||||
if( pFile != NULL )
|
||||
if( pFile != nullptr )
|
||||
pRet = pFile->priv;
|
||||
|
||||
m_Mutex.Unlock(); /* locked by GetFileSet */
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ void RoomWheel::Move( int n )
|
||||
if( n == 0 && m_iSelection >= m_offset )
|
||||
{
|
||||
const RoomWheelItemData* data = GetItem( m_iSelection-m_offset );
|
||||
if( data != NULL )
|
||||
if( data != nullptr )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_RoomInfoDeploy, 0 );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -104,9 +104,9 @@ void ScoreKeeperNormal::Load(
|
||||
for( unsigned i=0; i<apSteps.size(); i++ )
|
||||
{
|
||||
Song* pSong = apSongs[i];
|
||||
ASSERT( pSong != NULL );
|
||||
ASSERT( pSong != nullptr );
|
||||
Steps* pSteps = apSteps[i];
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
const AttackArray &aa = asModifiers[i];
|
||||
NoteData ndTemp;
|
||||
pSteps->GetNoteData( ndTemp );
|
||||
|
||||
@@ -180,7 +180,7 @@ void ScoreKeeperRave::LaunchAttack( AttackLevel al )
|
||||
RString* asAttacks = GAMESTATE->m_pCurCharacters[pn]->m_sAttacks[al]; // [NUM_ATTACKS_PER_LEVEL]
|
||||
RString sAttackToGive;
|
||||
|
||||
if (GAMESTATE->m_pCurCharacters[pn] != NULL)
|
||||
if (GAMESTATE->m_pCurCharacters[pn] != nullptr)
|
||||
sAttackToGive = asAttacks[ RandomInt(NUM_ATTACKS_PER_LEVEL) ];
|
||||
else
|
||||
{
|
||||
|
||||
+8
-8
@@ -1102,8 +1102,8 @@ void ScreenEdit::Init()
|
||||
|
||||
SubscribeToMessage( "Judgment" );
|
||||
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != nullptr );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != nullptr );
|
||||
|
||||
EDIT_MODE.Load( m_sName, "EditMode" );
|
||||
ScreenWithMenuElements::Init();
|
||||
@@ -2112,7 +2112,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
// save current steps
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
pSteps->SetNoteData( m_NoteDataEdit );
|
||||
|
||||
// Get all Steps of this StepsType
|
||||
@@ -3087,7 +3087,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
||||
/* FirstBeat affects backgrounds, so commit changes to memory (not to disk)
|
||||
* and recalc it. */
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
pSteps->SetNoteData( m_NoteDataEdit );
|
||||
m_pSong->ReCalculateRadarValuesAndLastSecond();
|
||||
|
||||
@@ -3493,7 +3493,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
GAMESTATE->m_pCurCourse.Set( pCourse );
|
||||
GAMESTATE->m_iEditCourseEntryIndex.Set( iCourseEntryIndex );
|
||||
ASSERT( GAMESTATE->m_pCurCourse != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurCourse != nullptr );
|
||||
}
|
||||
}
|
||||
else if (SM == SM_BackFromKeysoundTrack)
|
||||
@@ -5520,8 +5520,8 @@ void ScreenEdit::SetupCourseAttacks()
|
||||
|
||||
void ScreenEdit::CopyToLastSave()
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != nullptr );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != nullptr );
|
||||
m_SongLastSave = *GAMESTATE->m_pCurSong;
|
||||
m_vStepsLastSave.clear();
|
||||
const vector<Steps*> &vSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType );
|
||||
@@ -5543,7 +5543,7 @@ void ScreenEdit::CopyFromLastSave()
|
||||
|
||||
void ScreenEdit::RevertFromDisk()
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != nullptr );
|
||||
StepsID id;
|
||||
id.FromSteps( GAMESTATE->m_pCurSteps[PLAYER_1] );
|
||||
ASSERT( id.IsValid() );
|
||||
|
||||
@@ -220,7 +220,7 @@ bool ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
{
|
||||
case EditMenuAction_Delete:
|
||||
{
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
if( pSteps->IsAutogen() )
|
||||
{
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
@@ -238,7 +238,7 @@ bool ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
case EditMenuAction_Practice:
|
||||
break;
|
||||
case EditMenuAction_Delete:
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
ScreenPrompt::Prompt( SM_None, STEPS_WILL_BE_LOST.GetValue() + "\n\n" + CONTINUE_WITH_DELETE.GetValue(),
|
||||
PROMPT_YES_NO, ANSWER_NO );
|
||||
break;
|
||||
@@ -298,7 +298,7 @@ bool ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
case EditMenuAction_Practice:
|
||||
{
|
||||
// Prepare for ScreenEdit
|
||||
ASSERT( pSteps != NULL );
|
||||
ASSERT( pSteps != nullptr );
|
||||
bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == Difficulty_Edit);
|
||||
if( bPromptToNameSteps )
|
||||
{
|
||||
|
||||
+10
-10
@@ -428,7 +428,7 @@ void ScreenGameplay::Init()
|
||||
GAMESTATE->m_pCurSteps[p].Set( GAMESTATE->m_pCurSteps[ GAMESTATE->GetFirstHumanPlayer() ] );
|
||||
|
||||
FOREACH_EnabledPlayer(p)
|
||||
ASSERT( GAMESTATE->m_pCurSteps[p].Get() != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[p].Get() != nullptr );
|
||||
}
|
||||
|
||||
/* Increment the course play count. */
|
||||
@@ -814,28 +814,28 @@ void ScreenGameplay::InitSongQueues()
|
||||
if( GAMESTATE->IsCourseMode() )
|
||||
{
|
||||
Course* pCourse = GAMESTATE->m_pCurCourse;
|
||||
ASSERT( pCourse != NULL );
|
||||
ASSERT( pCourse != nullptr );
|
||||
|
||||
m_apSongsQueue.clear();
|
||||
PlayerNumber pnMaster = GAMESTATE->GetMasterPlayerNumber();
|
||||
Trail *pTrail = GAMESTATE->m_pCurTrail[pnMaster];
|
||||
ASSERT( pTrail != NULL );
|
||||
ASSERT( pTrail != nullptr );
|
||||
for (TrailEntry const &e : pTrail->m_vEntries)
|
||||
{
|
||||
ASSERT( e.pSong != NULL );
|
||||
ASSERT( e.pSong != nullptr );
|
||||
m_apSongsQueue.push_back( e.pSong );
|
||||
}
|
||||
|
||||
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
|
||||
{
|
||||
Trail *lTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ];
|
||||
ASSERT( lTrail != NULL );
|
||||
ASSERT( lTrail != nullptr );
|
||||
|
||||
pi->m_vpStepsQueue.clear();
|
||||
pi->m_asModifiersQueue.clear();
|
||||
for (TrailEntry const &e : lTrail->m_vEntries)
|
||||
{
|
||||
ASSERT( e.pSteps != NULL );
|
||||
ASSERT( e.pSteps != nullptr );
|
||||
pi->m_vpStepsQueue.push_back( e.pSteps );
|
||||
AttackArray a;
|
||||
e.GetAttackArray( a );
|
||||
@@ -1094,7 +1094,7 @@ void ScreenGameplay::LoadNextSong()
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ];
|
||||
++pi->GetPlayerStageStats()->m_iStepsPlayed;
|
||||
|
||||
ASSERT( GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ] != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ] != nullptr );
|
||||
if( pi->m_ptextStepsDescription )
|
||||
pi->m_ptextStepsDescription->SetText( pSteps->GetDescription() );
|
||||
|
||||
@@ -1285,10 +1285,10 @@ void ScreenGameplay::LoadLights()
|
||||
|
||||
// First, check if the song has explicit lights
|
||||
m_CabinetLightsNoteData.Init();
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != nullptr );
|
||||
|
||||
const Steps *pSteps = SongUtil::GetClosestNotes( GAMESTATE->m_pCurSong, StepsType_lights_cabinet, Difficulty_Medium );
|
||||
if( pSteps != NULL )
|
||||
if( pSteps != nullptr )
|
||||
{
|
||||
pSteps->GetNoteData( m_CabinetLightsNoteData );
|
||||
return;
|
||||
@@ -1751,7 +1751,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
DancingCharacters *pCharacter = NULL;
|
||||
if( m_pSongBackground )
|
||||
pCharacter = m_pSongBackground->GetDancingCharacters();
|
||||
if( pCharacter != NULL )
|
||||
if( pCharacter != nullptr )
|
||||
{
|
||||
TapNoteScore tns = pi->m_pPlayer->GetLastTapNoteScore();
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ ScreenGameplayLesson::ScreenGameplayLesson()
|
||||
|
||||
void ScreenGameplayLesson::Init()
|
||||
{
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != nullptr );
|
||||
ASSERT( GAMESTATE->m_pCurSong != nullptr );
|
||||
|
||||
/* Now that we've set up, init the base class. */
|
||||
ScreenGameplayNormal::Init();
|
||||
|
||||
@@ -116,9 +116,9 @@ void ScoreScroller::ConfigureActor( Actor *pActor, int iItem )
|
||||
const ScoreRowItemData &data = m_vScoreRowItemData[iItem];
|
||||
|
||||
Message msg("Set");
|
||||
if( data.m_pSong != NULL )
|
||||
if( data.m_pSong != nullptr )
|
||||
msg.SetParam( "Song", data.m_pSong );
|
||||
if( data.m_pCourse != NULL )
|
||||
if( data.m_pCourse != nullptr )
|
||||
msg.SetParam( "Course", data.m_pCourse );
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ void ScoreScroller::ConfigureActor( Actor *pActor, int iItem )
|
||||
Difficulty dc = iter.first;
|
||||
StepsType st = iter.second;
|
||||
|
||||
if( data.m_pSong != NULL )
|
||||
if( data.m_pSong != nullptr )
|
||||
{
|
||||
const Song* pSong = data.m_pSong;
|
||||
Steps *pSteps = SongUtil::GetStepsByDifficulty( pSong, st, dc, false );
|
||||
@@ -141,7 +141,7 @@ void ScoreScroller::ConfigureActor( Actor *pActor, int iItem )
|
||||
pSteps = NULL;
|
||||
LuaHelpers::Push( L, pSteps );
|
||||
}
|
||||
else if( data.m_pCourse != NULL )
|
||||
else if( data.m_pCourse != nullptr )
|
||||
{
|
||||
const Course* pCourse = data.m_pCourse;
|
||||
Trail *pTrail = pCourse->GetTrail( st, dc );
|
||||
|
||||
@@ -149,7 +149,7 @@ void ScreenHowToPlay::Init()
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
|
||||
Steps *pSteps = SongUtil::GetClosestNotes( &m_Song, pStyle->m_StepsType, Difficulty_Beginner );
|
||||
ASSERT_M( pSteps != NULL, ssprintf("No playable steps of StepsType '%s' for ScreenHowToPlay", StringConversion::ToString(pStyle->m_StepsType).c_str()) );
|
||||
ASSERT_M( pSteps != nullptr, ssprintf("No playable steps of StepsType '%s' for ScreenHowToPlay", StringConversion::ToString(pStyle->m_StepsType).c_str()) );
|
||||
|
||||
m_Song.m_SongTiming.TidyUpData( false );
|
||||
pSteps->m_Timing.TidyUpData( true );
|
||||
@@ -248,7 +248,7 @@ void ScreenHowToPlay::Step()
|
||||
|
||||
void ScreenHowToPlay::Update( float fDelta )
|
||||
{
|
||||
if( GAMESTATE->m_pCurSong != NULL )
|
||||
if( GAMESTATE->m_pCurSong != nullptr )
|
||||
{
|
||||
RageTimer tm;
|
||||
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong, GAMESTATE->m_pCurSong->m_SongTiming, tm, true );
|
||||
|
||||
@@ -34,7 +34,7 @@ void ScreenJukebox::SetSong()
|
||||
/* Check to see if there is a theme course. If there is a course that has
|
||||
* the exact same name as the theme, then we pick a song from this course. */
|
||||
Course *pCourse = SONGMAN->GetCourseFromName( THEME->GetCurThemeName() );
|
||||
if( pCourse != NULL )
|
||||
if( pCourse != nullptr )
|
||||
for ( unsigned i = 0; i < pCourse->m_vEntries.size(); i++ )
|
||||
if( pCourse->m_vEntries[i].IsFixedSong() )
|
||||
vSongs.push_back( pCourse->m_vEntries[i].songID.ToSong() );
|
||||
@@ -73,7 +73,7 @@ void ScreenJukebox::SetSong()
|
||||
|
||||
Song* pSong = vSongs[RandomInt(vSongs.size())];
|
||||
|
||||
ASSERT( pSong != NULL );
|
||||
ASSERT( pSong != nullptr );
|
||||
if( !pSong->HasMusic() )
|
||||
continue; // skip
|
||||
if( !pSong->NormallyDisplayed() )
|
||||
@@ -152,7 +152,7 @@ void ScreenJukebox::SetSong()
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) );
|
||||
ASSERT( GAMESTATE->m_pCurTrail[p] != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurTrail[p] != nullptr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ ScreenJukebox::ScreenJukebox()
|
||||
void ScreenJukebox::Init()
|
||||
{
|
||||
// ScreenJukeboxMenu must set this
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != nullptr );
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
|
||||
SetSong();
|
||||
|
||||
@@ -770,14 +770,14 @@ void ScreenManager::PopAllScreens()
|
||||
void ScreenManager::PostMessageToTopScreen( ScreenMessage SM, float fDelay )
|
||||
{
|
||||
Screen* pTopScreen = GetTopScreen();
|
||||
if( pTopScreen != NULL )
|
||||
if( pTopScreen != nullptr )
|
||||
pTopScreen->PostScreenMessage( SM, fDelay );
|
||||
}
|
||||
|
||||
void ScreenManager::SendMessageToTopScreen( ScreenMessage SM )
|
||||
{
|
||||
Screen* pTopScreen = GetTopScreen();
|
||||
if( pTopScreen != NULL )
|
||||
if( pTopScreen != nullptr )
|
||||
pTopScreen->HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ public:
|
||||
static int GetTopScreen( T* p, lua_State *L )
|
||||
{
|
||||
Actor *pScreen = p->GetTopScreen();
|
||||
if( pScreen != NULL )
|
||||
if( pScreen != nullptr )
|
||||
pScreen->PushSelf(L);
|
||||
else
|
||||
lua_pushnil( L );
|
||||
|
||||
@@ -59,7 +59,7 @@ void ScreenMiniMenu::Init()
|
||||
|
||||
void ScreenMiniMenu::BeginScreen()
|
||||
{
|
||||
ASSERT( g_pMenuDef != NULL );
|
||||
ASSERT( g_pMenuDef != nullptr );
|
||||
|
||||
LoadMenu( g_pMenuDef );
|
||||
m_SMSendOnOK = g_SendOnOK;
|
||||
|
||||
@@ -179,7 +179,7 @@ void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
int i = m_RoomWheel.GetCurrentIndex() - m_RoomWheel.GetPerminateOffset();
|
||||
const RoomWheelItemData* data = m_RoomWheel.GetItem(i);
|
||||
if( data != NULL )
|
||||
if( data != nullptr )
|
||||
m_roomInfo.SetRoom( data );
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user