The big NULL replacement party part 5.

Right. ' = NULL' would get a lot of these.
This commit is contained in:
Jason Felds
2013-05-03 23:39:52 -04:00
parent 328c41eec0
commit 28e5148dec
233 changed files with 7448 additions and 7447 deletions
+2 -2
View File
@@ -542,7 +542,7 @@ StyledWriter::normalizeEOL( const std::string &text )
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
StyledStreamWriter::StyledStreamWriter( std::string indentation ) StyledStreamWriter::StyledStreamWriter( std::string indentation )
: document_(NULL) : document_(nullptr)
, rightMargin_( 74 ) , rightMargin_( 74 )
, indentation_( indentation ) , indentation_( indentation )
{ {
@@ -559,7 +559,7 @@ StyledStreamWriter::write( std::ostream &out, const Value &root )
writeValue( root ); writeValue( root );
writeCommentAfterValueOnSameLine( root ); writeCommentAfterValueOnSameLine( root );
*document_ << "\n"; *document_ << "\n";
document_ = NULL; // Forget the stream, for safety. document_ = nullptr; // Forget the stream, for safety.
} }
+6 -6
View File
@@ -86,7 +86,7 @@ void Actor::InitState()
{ {
StopTweening(); StopTweening();
m_pTempState = NULL; m_pTempState = nullptr;
m_baseRotation = RageVector3( 0, 0, 0 ); m_baseRotation = RageVector3( 0, 0, 0 );
m_baseScale = RageVector3( 1, 1, 1 ); m_baseScale = RageVector3( 1, 1, 1 );
@@ -161,7 +161,7 @@ Actor::Actor()
m_size = RageVector2( 1, 1 ); m_size = RageVector2( 1, 1 );
InitState(); InitState();
m_pParent = NULL; m_pParent = nullptr;
m_bFirstUpdate = true; m_bFirstUpdate = true;
} }
@@ -176,7 +176,7 @@ Actor::Actor( const Actor &cpy ):
{ {
/* Don't copy an Actor in the middle of rendering. */ /* Don't copy an Actor in the middle of rendering. */
ASSERT( cpy.m_pTempState == nullptr ); ASSERT( cpy.m_pTempState == nullptr );
m_pTempState = NULL; m_pTempState = nullptr;
#define CPY(x) x = cpy.x #define CPY(x) x = cpy.x
CPY( m_sName ); CPY( m_sName );
@@ -569,7 +569,7 @@ void Actor::SetTextureRenderStates()
void Actor::EndDraw() void Actor::EndDraw()
{ {
DISPLAY->PopMatrix(); DISPLAY->PopMatrix();
m_pTempState = NULL; m_pTempState = nullptr;
} }
void Actor::UpdateTweening( float fDeltaTime ) void Actor::UpdateTweening( float fDeltaTime )
@@ -1298,7 +1298,7 @@ void Actor::SetParent( Actor *pParent )
Actor::TweenInfo::TweenInfo() Actor::TweenInfo::TweenInfo()
{ {
m_pTween = NULL; m_pTween = nullptr;
} }
Actor::TweenInfo::~TweenInfo() Actor::TweenInfo::~TweenInfo()
@@ -1308,7 +1308,7 @@ Actor::TweenInfo::~TweenInfo()
Actor::TweenInfo::TweenInfo( const TweenInfo &cpy ) Actor::TweenInfo::TweenInfo( const TweenInfo &cpy )
{ {
m_pTween = NULL; m_pTween = nullptr;
*this = cpy; *this = cpy;
} }
+4 -4
View File
@@ -591,11 +591,11 @@ public:
void PlayCommandNoRecurse( const Message &msg ); void PlayCommandNoRecurse( const Message &msg );
// Commands by reference // Commands by reference
virtual void RunCommands( const LuaReference& cmds, const LuaReference *pParamTable = NULL ); virtual void RunCommands( const LuaReference& cmds, const LuaReference *pParamTable = nullptr );
void RunCommands( const apActorCommands& cmds, const LuaReference *pParamTable = NULL ) { this->RunCommands( *cmds, pParamTable ); } // convenience void RunCommands( const apActorCommands& cmds, const LuaReference *pParamTable = nullptr ) { this->RunCommands( *cmds, pParamTable ); } // convenience
virtual void RunCommandsRecursively( const LuaReference& cmds, const LuaReference *pParamTable = NULL ) { RunCommands(cmds, pParamTable); } virtual void RunCommandsRecursively( const LuaReference& cmds, const LuaReference *pParamTable = nullptr ) { RunCommands(cmds, pParamTable); }
// If we're a leaf, then execute this command. // If we're a leaf, then execute this command.
virtual void RunCommandsOnLeaves( const LuaReference& cmds, const LuaReference *pParamTable = NULL ) { RunCommands(cmds, pParamTable); } virtual void RunCommandsOnLeaves( const LuaReference& cmds, const LuaReference *pParamTable = nullptr ) { RunCommands(cmds, pParamTable); }
// Messages // Messages
virtual void HandleMessage( const Message &msg ); virtual void HandleMessage( const Message &msg );
+8 -8
View File
@@ -55,13 +55,13 @@ public:
// Commands // Commands
virtual void PushSelf( lua_State *L ); virtual void PushSelf( lua_State *L );
void PushChildrenTable( lua_State *L ); void PushChildrenTable( lua_State *L );
void PlayCommandOnChildren( const RString &sCommandName, const LuaReference *pParamTable = NULL ); void PlayCommandOnChildren( const RString &sCommandName, const LuaReference *pParamTable = nullptr );
void PlayCommandOnLeaves( const RString &sCommandName, const LuaReference *pParamTable = NULL ); void PlayCommandOnLeaves( const RString &sCommandName, const LuaReference *pParamTable = nullptr );
virtual void RunCommandsRecursively( const LuaReference& cmds, const LuaReference *pParamTable = NULL ); virtual void RunCommandsRecursively( const LuaReference& cmds, const LuaReference *pParamTable = nullptr );
virtual void RunCommandsOnChildren( const LuaReference& cmds, const LuaReference *pParamTable = NULL ); /* but not on self */ virtual void RunCommandsOnChildren( const LuaReference& cmds, const LuaReference *pParamTable = nullptr ); /* but not on self */
void RunCommandsOnChildren( const apActorCommands& cmds, const LuaReference *pParamTable = NULL ) { this->RunCommandsOnChildren( *cmds, pParamTable ); } // convenience void RunCommandsOnChildren( const apActorCommands& cmds, const LuaReference *pParamTable = nullptr ) { this->RunCommandsOnChildren( *cmds, pParamTable ); } // convenience
virtual void RunCommandsOnLeaves( const LuaReference& cmds, const LuaReference *pParamTable = NULL ); /* but not on self */ virtual void RunCommandsOnLeaves( const LuaReference& cmds, const LuaReference *pParamTable = nullptr ); /* but not on self */
virtual void UpdateInternal( float fDeltaTime ); virtual void UpdateInternal( float fDeltaTime );
virtual void BeginDraw(); virtual void BeginDraw();
@@ -93,8 +93,8 @@ public:
virtual float GetTweenTimeLeft() const; virtual float GetTweenTimeLeft() const;
virtual void HandleMessage( const Message &msg ); virtual void HandleMessage( const Message &msg );
virtual void RunCommands( const LuaReference& cmds, const LuaReference *pParamTable = NULL ); virtual void RunCommands( const LuaReference& cmds, const LuaReference *pParamTable = nullptr );
void RunCommands( const apActorCommands& cmds, const LuaReference *pParamTable = NULL ) { this->RunCommands( *cmds, pParamTable ); } // convenience void RunCommands( const apActorCommands& cmds, const LuaReference *pParamTable = nullptr ) { this->RunCommands( *cmds, pParamTable ); } // convenience
protected: protected:
void LoadChildrenFromNode( const XNode* pNode ); void LoadChildrenFromNode( const XNode* pNode );
+1 -1
View File
@@ -17,7 +17,7 @@ ActorFrameTexture::ActorFrameTexture()
++i; ++i;
m_sTextureName = ssprintf( ConvertI64FormatString("ActorFrameTexture %lli"), i ); m_sTextureName = ssprintf( ConvertI64FormatString("ActorFrameTexture %lli"), i );
m_pRenderTarget = NULL; m_pRenderTarget = nullptr;
} }
ActorFrameTexture::ActorFrameTexture( const ActorFrameTexture &cpy ): ActorFrameTexture::ActorFrameTexture( const ActorFrameTexture &cpy ):
+1 -1
View File
@@ -35,7 +35,7 @@ private:
EffectMode m_EffectMode; EffectMode m_EffectMode;
struct TextureUnitState struct TextureUnitState
{ {
TextureUnitState(): m_pTexture(NULL), m_TextureMode(TextureMode_Modulate) {} TextureUnitState(): m_pTexture(nullptr), m_TextureMode(TextureMode_Modulate) {}
RageTexture *m_pTexture; RageTexture *m_pTexture;
TextureMode m_TextureMode; TextureMode m_TextureMode;
}; };
+1 -1
View File
@@ -6,7 +6,7 @@ REGISTER_ACTOR_CLASS( ActorProxy );
ActorProxy::ActorProxy() ActorProxy::ActorProxy()
{ {
m_pActorTarget = NULL; m_pActorTarget = nullptr;
} }
bool ActorProxy::EarlyAbortDraw() const bool ActorProxy::EarlyAbortDraw() const
+2 -2
View File
@@ -14,7 +14,7 @@
// Actor registration // Actor registration
static map<RString,CreateActorFn> *g_pmapRegistrees = NULL; static map<RString,CreateActorFn> *g_pmapRegistrees = nullptr;
static bool IsRegistered( const RString& sClassName ) static bool IsRegistered( const RString& sClassName )
{ {
@@ -158,7 +158,7 @@ namespace
return nullptr; return nullptr;
} }
XNode *pRet = NULL; XNode *pRet = nullptr;
if( ActorUtil::LoadTableFromStackShowErrors(L) ) if( ActorUtil::LoadTableFromStackShowErrors(L) )
pRet = XmlFileUtil::XNodeFromTable( L ); pRet = XmlFileUtil::XNodeFromTable( L );
+2 -2
View File
@@ -108,8 +108,8 @@ namespace ActorUtil
inline void LoadAllCommandsAndSetXYAndOnCommand( Actor* pActor, const RString &sMetricsGroup ) { if(pActor) LoadAllCommandsAndSetXYAndOnCommand( *pActor, sMetricsGroup ); } inline void LoadAllCommandsAndSetXYAndOnCommand( Actor* pActor, const RString &sMetricsGroup ) { if(pActor) LoadAllCommandsAndSetXYAndOnCommand( *pActor, sMetricsGroup ); }
// Return a Sprite, BitmapText, or Model depending on the file type // Return a Sprite, BitmapText, or Model depending on the file type
Actor* LoadFromNode( const XNode* pNode, Actor *pParentActor = NULL ); Actor* LoadFromNode( const XNode* pNode, Actor *pParentActor = nullptr );
Actor* MakeActor( const RString &sPath, Actor *pParentActor = NULL ); Actor* MakeActor( const RString &sPath, Actor *pParentActor = nullptr );
RString GetSourcePath( const XNode *pNode ); RString GetSourcePath( const XNode *pNode );
RString GetWhere( const XNode *pNode ); RString GetWhere( const XNode *pNode );
bool GetAttrPath( const XNode *pNode, const RString &sName, RString &sOut ); bool GetAttrPath( const XNode *pNode, const RString &sName, RString &sOut );
+1 -1
View File
@@ -5,7 +5,7 @@
#include "RageFile.h" #include "RageFile.h"
#include <cstring> #include <cstring>
AnnouncerManager* ANNOUNCER = NULL; // global object accessable from anywhere in the program AnnouncerManager* ANNOUNCER = nullptr; // global object accessable from anywhere in the program
const RString EMPTY_ANNOUNCER_NAME = "Empty"; const RString EMPTY_ANNOUNCER_NAME = "Empty";
+2 -2
View File
@@ -13,7 +13,7 @@ void AutoActor::Unload()
AutoActor::AutoActor( const AutoActor &cpy ) AutoActor::AutoActor( const AutoActor &cpy )
{ {
if( cpy.m_pActor == nullptr ) if( cpy.m_pActor == nullptr )
m_pActor = NULL; m_pActor = nullptr;
else else
m_pActor = cpy.m_pActor->Copy(); m_pActor = cpy.m_pActor->Copy();
} }
@@ -23,7 +23,7 @@ AutoActor &AutoActor::operator=( const AutoActor &cpy )
Unload(); Unload();
if( cpy.m_pActor == nullptr ) if( cpy.m_pActor == nullptr )
m_pActor = NULL; m_pActor = nullptr;
else else
m_pActor = cpy.m_pActor->Copy(); m_pActor = cpy.m_pActor->Copy();
return *this; return *this;
+1 -1
View File
@@ -12,7 +12,7 @@ class XNode;
class AutoActor class AutoActor
{ {
public: public:
AutoActor(): m_pActor(NULL) {} AutoActor(): m_pActor(nullptr) {}
~AutoActor() { Unload(); } ~AutoActor() { Unload(); }
AutoActor( const AutoActor &cpy ); AutoActor( const AutoActor &cpy );
AutoActor &operator =( const AutoActor &cpy ); AutoActor &operator =( const AutoActor &cpy );
+3 -3
View File
@@ -122,9 +122,9 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra
// two-track sound. // two-track sound.
//bool bTwoPlayers = GAMESTATE->GetNumPlayersEnabled() == 2; //bool bTwoPlayers = GAMESTATE->GetNumPlayersEnabled() == 2;
pPlayer1 = NULL; pPlayer1 = nullptr;
pPlayer2 = NULL; pPlayer2 = nullptr;
pShared = NULL; pShared = nullptr;
vector<RString> vsMusicFile; vector<RString> vsMusicFile;
const RString sMusicPath = pSong->GetMusicPath(); const RString sMusicPath = pSong->GetMusicPath();
+9 -9
View File
@@ -147,15 +147,15 @@ static RageColor GetBrightnessColor( float fBrightnessPercent )
BackgroundImpl::BackgroundImpl() BackgroundImpl::BackgroundImpl()
{ {
m_bInitted = false; m_bInitted = false;
m_pDancingCharacters = NULL; m_pDancingCharacters = nullptr;
m_pSong = NULL; m_pSong = nullptr;
} }
BackgroundImpl::Layer::Layer() BackgroundImpl::Layer::Layer()
{ {
m_iCurBGChangeIndex = -1; m_iCurBGChangeIndex = -1;
m_pCurrentBGA = NULL; m_pCurrentBGA = nullptr;
m_pFadingBGA = NULL; m_pFadingBGA = nullptr;
} }
void BackgroundImpl::Init() void BackgroundImpl::Init()
@@ -242,7 +242,7 @@ void BackgroundImpl::Unload()
{ {
FOREACH_BackgroundLayer( i ) FOREACH_BackgroundLayer( i )
m_Layer[i].Unload(); m_Layer[i].Unload();
m_pSong = NULL; m_pSong = nullptr;
m_fLastMusicSeconds = -9999; m_fLastMusicSeconds = -9999;
m_RandomBGAnimations.clear(); m_RandomBGAnimations.clear();
} }
@@ -254,8 +254,8 @@ void BackgroundImpl::Layer::Unload()
m_BGAnimations.clear(); m_BGAnimations.clear();
m_aBGChanges.clear(); m_aBGChanges.clear();
m_pCurrentBGA = NULL; m_pCurrentBGA = nullptr;
m_pFadingBGA = NULL; m_pFadingBGA = nullptr;
m_iCurBGChangeIndex = -1; m_iCurBGChangeIndex = -1;
} }
@@ -743,7 +743,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( m_pFadingBGA == m_pCurrentBGA ) if( m_pFadingBGA == m_pCurrentBGA )
{ {
m_pFadingBGA = NULL; m_pFadingBGA = nullptr;
//LOG->Trace( "bg didn't actually change. Ignoring." ); //LOG->Trace( "bg didn't actually change. Ignoring." );
} }
else else
@@ -779,7 +779,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( m_pFadingBGA ) if( m_pFadingBGA )
{ {
if( m_pFadingBGA->GetTweenTimeLeft() == 0 ) if( m_pFadingBGA->GetTweenTimeLeft() == 0 )
m_pFadingBGA = NULL; m_pFadingBGA = nullptr;
} }
/* This is unaffected by the music rate. */ /* This is unaffected by the music rate. */
+6 -6
View File
@@ -248,13 +248,13 @@ public:
static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; } static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; }
static int LoadFromSong( T* p, lua_State *L ) static int LoadFromSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromSong( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromSong(nullptr); }
else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); } else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); }
return 0; return 0;
} }
static int LoadFromCourse( T* p, lua_State *L ) static int LoadFromCourse( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromCourse( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromCourse(nullptr); }
else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); } else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); }
return 0; return 0;
} }
@@ -265,25 +265,25 @@ public:
} }
static int LoadIconFromCharacter( T* p, lua_State *L ) static int LoadIconFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter(nullptr); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; return 0;
} }
static int LoadCardFromCharacter( T* p, lua_State *L ) static int LoadCardFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter(nullptr); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; return 0;
} }
static int LoadBannerFromUnlockEntry( T* p, lua_State *L ) static int LoadBannerFromUnlockEntry( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadBannerFromUnlockEntry( NULL ); } if( lua_isnil(L,1) ) { p->LoadBannerFromUnlockEntry(nullptr); }
else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBannerFromUnlockEntry( pUE ); } else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBannerFromUnlockEntry( pUE ); }
return 0; return 0;
} }
static int LoadBackgroundFromUnlockEntry( T* p, lua_State *L ) static int LoadBackgroundFromUnlockEntry( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadBackgroundFromUnlockEntry( NULL ); } if( lua_isnil(L,1) ) { p->LoadBackgroundFromUnlockEntry(nullptr); }
else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBackgroundFromUnlockEntry( pUE ); } else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBackgroundFromUnlockEntry( pUE ); }
return 0; return 0;
} }
+5 -5
View File
@@ -42,7 +42,7 @@ BitmapText::BitmapText()
} }
iReloadCounter++; iReloadCounter++;
m_pFont = NULL; m_pFont = nullptr;
m_bUppercase = false; m_bUppercase = false;
m_bRainbowScroll = false; m_bRainbowScroll = false;
@@ -98,7 +98,7 @@ BitmapText & BitmapText::operator=(const BitmapText &cpy)
if( cpy.m_pFont != nullptr ) if( cpy.m_pFont != nullptr )
m_pFont = FONT->CopyFont( cpy.m_pFont ); m_pFont = FONT->CopyFont( cpy.m_pFont );
else else
m_pFont = NULL; m_pFont = nullptr;
return *this; return *this;
} }
@@ -106,7 +106,7 @@ BitmapText & BitmapText::operator=(const BitmapText &cpy)
BitmapText::BitmapText( const BitmapText &cpy ): BitmapText::BitmapText( const BitmapText &cpy ):
Actor( cpy ) Actor( cpy )
{ {
m_pFont = NULL; m_pFont = nullptr;
*this = cpy; *this = cpy;
} }
@@ -143,7 +143,7 @@ bool BitmapText::LoadFromFont( const RString& sFontFilePath )
if( m_pFont ) if( m_pFont )
{ {
FONT->UnloadFont( m_pFont ); FONT->UnloadFont( m_pFont );
m_pFont = NULL; m_pFont = nullptr;
} }
m_pFont = FONT->LoadFont( sFontFilePath ); m_pFont = FONT->LoadFont( sFontFilePath );
@@ -162,7 +162,7 @@ bool BitmapText::LoadFromTextureAndChars( const RString& sTexturePath, const RSt
if( m_pFont ) if( m_pFont )
{ {
FONT->UnloadFont( m_pFont ); FONT->UnloadFont( m_pFont );
m_pFont = NULL; m_pFont = nullptr;
} }
m_pFont = FONT->LoadFont( sTexturePath, sChars ); m_pFont = FONT->LoadFont( sTexturePath, sChars );
+1 -1
View File
@@ -7,7 +7,7 @@
#define CHARACTERS_DIR "/Characters/" #define CHARACTERS_DIR "/Characters/"
CharacterManager* CHARMAN = NULL; // global object accessable from anywhere in the program CharacterManager* CHARMAN = nullptr; // global object accessable from anywhere in the program
CharacterManager::CharacterManager() CharacterManager::CharacterManager()
{ {
+4 -4
View File
@@ -14,16 +14,16 @@ ComboGraph::ComboGraph()
{ {
DeleteChildrenWhenDone( true ); DeleteChildrenWhenDone( true );
m_pNormalCombo = NULL; m_pNormalCombo = nullptr;
m_pMaxCombo = NULL; m_pMaxCombo = nullptr;
m_pComboNumber = NULL; m_pComboNumber = nullptr;
} }
void ComboGraph::Load( RString sMetricsGroup ) void ComboGraph::Load( RString sMetricsGroup )
{ {
BODY_WIDTH.Load( sMetricsGroup, "BodyWidth" ); BODY_WIDTH.Load( sMetricsGroup, "BodyWidth" );
Actor *pActor = NULL; Actor *pActor = nullptr;
m_pBacking = ActorUtil::MakeActor( THEME->GetPathG(sMetricsGroup,"Backing") ); m_pBacking = ActorUtil::MakeActor( THEME->GetPathG(sMetricsGroup,"Backing") );
m_pBacking->ZoomToWidth( BODY_WIDTH ); m_pBacking->ZoomToWidth( BODY_WIDTH );
+1 -1
View File
@@ -250,7 +250,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
vector<RString> bits; vector<RString> bits;
split( sSong, "/", bits ); split( sSong, "/", bits );
Song *pSong = NULL; Song *pSong = nullptr;
if( bits.size() == 2 ) if( bits.size() == 2 )
{ {
new_entry.songCriteria.m_sGroupName = bits[0]; new_entry.songCriteria.m_sGroupName = bits[0];
+3 -3
View File
@@ -450,7 +450,7 @@ void EditCourseUtil::UpdateAndSetTrail()
{ {
ASSERT( GAMESTATE->m_pCurStyle != nullptr ); ASSERT( GAMESTATE->m_pCurStyle != nullptr );
StepsType st = GAMESTATE->m_pCurStyle->m_StepsType; StepsType st = GAMESTATE->m_pCurStyle->m_StepsType;
Trail *pTrail = NULL; Trail *pTrail = nullptr;
if( GAMESTATE->m_pCurCourse ) if( GAMESTATE->m_pCurCourse )
pTrail = GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st ); pTrail = GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail );
@@ -458,7 +458,7 @@ void EditCourseUtil::UpdateAndSetTrail()
void EditCourseUtil::PrepareForPlay() void EditCourseUtil::PrepareForPlay()
{ {
GAMESTATE->m_pCurSong.Set( NULL ); // CurSong will be set if we back out. Set it back to NULL so that ScreenStage won't show the last song. GAMESTATE->m_pCurSong.Set(nullptr); // CurSong will be set if we back out. Set it back to NULL so that ScreenStage won't show the last song.
GAMESTATE->m_PlayMode.Set( PLAY_MODE_ENDLESS ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_ENDLESS );
GAMESTATE->m_bSideIsJoined[0] = true; GAMESTATE->m_bSideIsJoined[0] = true;
@@ -549,7 +549,7 @@ Course *CourseID::ToCourse() const
if( sPath2.Left(1) != "/" ) if( sPath2.Left(1) != "/" )
sPath2 = "/" + sPath2; sPath2 = "/" + sPath2;
Course *pCourse = NULL; Course *pCourse = nullptr;
if( m_Cache.Get(&pCourse) ) if( m_Cache.Get(&pCourse) )
return pCourse; return pCourse;
if( pCourse == nullptr && !sPath2.empty() ) if( pCourse == nullptr && !sPath2.empty() )
+1 -1
View File
@@ -73,7 +73,7 @@ class CourseID
{ {
public: public:
CourseID(): sPath(""), sFullTitle(""), m_Cache() { Unset(); } CourseID(): sPath(""), sFullTitle(""), m_Cache() { Unset(); }
void Unset() { FromCourse(NULL); } void Unset() { FromCourse(nullptr); }
void FromCourse( const Course *p ); void FromCourse( const Course *p );
Course *ToCourse() const; Course *ToCourse() const;
const RString &GetPath() const { return sPath; } const RString &GetPath() const { return sPath; }
+2 -2
View File
@@ -543,7 +543,7 @@ ulg crc32(ulg crc, const uch *buf, size_t len)
class TZip class TZip
{ {
public: public:
TZip() : pfout(NULL),ooffset(0),oerr(false),writ(0),hasputcen(false),zfis(0),hfin(0) TZip() : pfout(nullptr),ooffset(0),oerr(false),writ(0),hasputcen(false),zfis(0),hfin(0)
{ {
} }
~TZip() ~TZip()
@@ -717,7 +717,7 @@ ZRESULT TZip::set_times()
unsigned short dosdate,dostime; unsigned short dosdate,dostime;
filetime2dosdatetime(*ptm,&dosdate,&dostime); filetime2dosdatetime(*ptm,&dosdate,&dostime);
times.atime = time(NULL); times.atime = time(nullptr);
times.mtime = times.atime; times.mtime = times.atime;
times.ctime = times.atime; times.ctime = times.atime;
timestamp = (unsigned short)dostime | (((unsigned long)dosdate)<<16); timestamp = (unsigned short)dostime | (((unsigned long)dosdate)<<16);
+1 -1
View File
@@ -79,7 +79,7 @@ static const int KEY_LENGTH = 1024;
* *
*/ */
static PRNGWrapper *g_pPRNG = NULL; static PRNGWrapper *g_pPRNG = nullptr;
CryptManager::CryptManager() CryptManager::CryptManager()
+1 -1
View File
@@ -58,7 +58,7 @@ bool DateTime::operator>( const DateTime& other ) const
DateTime DateTime::GetNowDateTime() DateTime DateTime::GetNowDateTime()
{ {
time_t now = time(NULL); time_t now = time(nullptr);
tm tNow; tm tNow;
localtime_r( &now, &tNow ); localtime_r( &now, &tNow );
DateTime dtNow; DateTime dtNow;
+1 -1
View File
@@ -45,7 +45,7 @@ void StepsDisplayList::LoadFromNode( const XNode* pNode )
MOVE_COMMAND.Load( m_sName, "MoveCommand" ); MOVE_COMMAND.Load( m_sName, "MoveCommand" );
m_Lines.resize( MAX_METERS ); m_Lines.resize( MAX_METERS );
m_CurSong = NULL; m_CurSong = nullptr;
FOREACH_ENUM( PlayerNumber, pn ) FOREACH_ENUM( PlayerNumber, pn )
{ {
+1 -1
View File
@@ -56,7 +56,7 @@ private:
{ {
Row() Row()
{ {
m_Steps = NULL; m_Steps = nullptr;
m_dc = Difficulty_Invalid; m_dc = Difficulty_Invalid;
m_fY = 0; m_fY = 0;
m_bHidden = false; m_bHidden = false;
+1 -1
View File
@@ -429,7 +429,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
{ {
Steps *pSteps = SongUtil::GetStepsByDifficulty( GetSelectedSong(), GetSelectedStepsType(), dc ); Steps *pSteps = SongUtil::GetStepsByDifficulty( GetSelectedSong(), GetSelectedStepsType(), dc );
if( pSteps && UNLOCKMAN->StepsIsLocked( GetSelectedSong(), pSteps ) ) if( pSteps && UNLOCKMAN->StepsIsLocked( GetSelectedSong(), pSteps ) )
pSteps = NULL; pSteps = nullptr;
EditMode mode = EDIT_MODE.GetValue(); EditMode mode = EDIT_MODE.GetValue();
switch( EDIT_MODE.GetValue() ) switch( EDIT_MODE.GetValue() )
+4 -4
View File
@@ -272,25 +272,25 @@ public:
static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; } static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; }
static int LoadFromSong( T* p, lua_State *L ) static int LoadFromSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromSong( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromSong(nullptr); }
else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); } else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); }
return 0; return 0;
} }
static int LoadFromCourse( T* p, lua_State *L ) static int LoadFromCourse( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromCourse( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromCourse(nullptr); }
else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); } else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); }
return 0; return 0;
} }
static int LoadIconFromCharacter( T* p, lua_State *L ) static int LoadIconFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter(nullptr); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; return 0;
} }
static int LoadCardFromCharacter( T* p, lua_State *L ) static int LoadCardFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter(nullptr); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; return 0;
} }
+4 -4
View File
@@ -190,12 +190,12 @@ FontPage::~FontPage()
if( m_FontPageTextures.m_pTextureMain != nullptr ) if( m_FontPageTextures.m_pTextureMain != nullptr )
{ {
TEXTUREMAN->UnloadTexture( m_FontPageTextures.m_pTextureMain ); TEXTUREMAN->UnloadTexture( m_FontPageTextures.m_pTextureMain );
m_FontPageTextures.m_pTextureMain = NULL; m_FontPageTextures.m_pTextureMain = nullptr;
} }
if( m_FontPageTextures.m_pTextureStroke != nullptr ) if( m_FontPageTextures.m_pTextureStroke != nullptr )
{ {
TEXTUREMAN->UnloadTexture( m_FontPageTextures.m_pTextureStroke ); TEXTUREMAN->UnloadTexture( m_FontPageTextures.m_pTextureStroke );
m_FontPageTextures.m_pTextureStroke = NULL; m_FontPageTextures.m_pTextureStroke = nullptr;
} }
} }
@@ -221,7 +221,7 @@ int Font::GetLineHeightInSourcePixels( const wstring &szLine ) const
} }
Font::Font(): m_iRefCount(1), path(""), m_apPages(), m_pDefault(NULL), Font::Font(): m_iRefCount(1), path(""), m_apPages(), m_pDefault(nullptr),
m_iCharToGlyph(), m_bRightToLeft(false), m_iCharToGlyph(), m_bRightToLeft(false),
// strokes aren't shown by default, hence the Color. // strokes aren't shown by default, hence the Color.
m_DefaultStrokeColor(RageColor(0,0,0,0)), m_sChars("") {} m_DefaultStrokeColor(RageColor(0,0,0,0)), m_sChars("") {}
@@ -238,7 +238,7 @@ void Font::Unload()
m_apPages.clear(); m_apPages.clear();
m_iCharToGlyph.clear(); m_iCharToGlyph.clear();
m_pDefault = NULL; m_pDefault = nullptr;
/* Don't clear the refcount. We've unloaded, but that doesn't mean things /* Don't clear the refcount. We've unloaded, but that doesn't mean things
* aren't still pointing to us. */ * aren't still pointing to us. */
+2 -2
View File
@@ -23,7 +23,7 @@ struct FontPageTextures
RageTexture *m_pTextureStroke; RageTexture *m_pTextureStroke;
/** @brief Set up the initial textures. */ /** @brief Set up the initial textures. */
FontPageTextures(): m_pTextureMain(NULL), m_pTextureStroke(NULL) {} FontPageTextures(): m_pTextureMain(nullptr), m_pTextureStroke(nullptr) {}
}; };
/** @brief The components of a glyph (not technically a character). */ /** @brief The components of a glyph (not technically a character). */
@@ -50,7 +50,7 @@ struct glyph
RectF m_TexRect; RectF m_TexRect;
/** @brief Set up the glyph with default values. */ /** @brief Set up the glyph with default values. */
glyph() : m_pPage(NULL), m_FontPageTextures(), m_iHadvance(0), glyph() : m_pPage(nullptr), m_FontPageTextures(), m_iHadvance(0),
m_fWidth(0), m_fHeight(0), m_fHshift(0), m_TexRect() {} m_fWidth(0), m_fHeight(0), m_fHshift(0), m_TexRect() {}
}; };
+1 -1
View File
@@ -20,7 +20,7 @@ void Foreground::Unload()
m_BGAnimations.clear(); m_BGAnimations.clear();
m_SubActors.clear(); m_SubActors.clear();
m_fLastMusicSeconds = -9999; m_fLastMusicSeconds = -9999;
m_pSong = NULL; m_pSong = nullptr;
} }
void Foreground::LoadFromSong( const Song *pSong ) void Foreground::LoadFromSong( const Song *pSong )
+6 -6
View File
@@ -36,7 +36,7 @@ void GameCommand::Init()
m_bInvalid = true; m_bInvalid = true;
m_iIndex = -1; m_iIndex = -1;
m_MultiPlayer = MultiPlayer_Invalid; m_MultiPlayer = MultiPlayer_Invalid;
m_pStyle = NULL; m_pStyle = nullptr;
m_pm = PlayMode_Invalid; m_pm = PlayMode_Invalid;
m_dc = Difficulty_Invalid; m_dc = Difficulty_Invalid;
m_CourseDifficulty = Difficulty_Invalid; m_CourseDifficulty = Difficulty_Invalid;
@@ -45,11 +45,11 @@ void GameCommand::Init()
m_sAnnouncer = ""; m_sAnnouncer = "";
m_sScreen = ""; m_sScreen = "";
m_LuaFunction.Unset(); m_LuaFunction.Unset();
m_pSong = NULL; m_pSong = nullptr;
m_pSteps = NULL; m_pSteps = nullptr;
m_pCourse = NULL; m_pCourse = nullptr;
m_pTrail = NULL; m_pTrail = nullptr;
m_pCharacter = NULL; m_pCharacter = nullptr;
m_SortOrder = SortOrder_Invalid; m_SortOrder = SortOrder_Invalid;
m_sSoundPath = ""; m_sSoundPath = "";
m_vsScreensToPrepare.clear(); m_vsScreensToPrepare.clear();
+4 -4
View File
@@ -25,13 +25,13 @@ public:
GameCommand(): m_Commands(), m_sName(""), m_sText(""), GameCommand(): m_Commands(), m_sName(""), m_sText(""),
m_bInvalid(true), m_sInvalidReason(""), m_bInvalid(true), m_sInvalidReason(""),
m_iIndex(-1), m_MultiPlayer(MultiPlayer_Invalid), m_iIndex(-1), m_MultiPlayer(MultiPlayer_Invalid),
m_pStyle(NULL), m_pm(PlayMode_Invalid), m_pStyle(nullptr), m_pm(PlayMode_Invalid),
m_dc(Difficulty_Invalid), m_dc(Difficulty_Invalid),
m_CourseDifficulty(Difficulty_Invalid), m_CourseDifficulty(Difficulty_Invalid),
m_sAnnouncer(""), m_sPreferredModifiers(""), m_sAnnouncer(""), m_sPreferredModifiers(""),
m_sStageModifiers(""), m_sScreen(""), m_LuaFunction(), m_sStageModifiers(""), m_sScreen(""), m_LuaFunction(),
m_pSong(NULL), m_pSteps(NULL), m_pCourse(NULL), m_pSong(nullptr), m_pSteps(nullptr), m_pCourse(nullptr),
m_pTrail(NULL), m_pCharacter(NULL), m_SetEnv(), m_pTrail(nullptr), m_pCharacter(nullptr), m_SetEnv(),
m_sSongGroup(""), m_SortOrder(SortOrder_Invalid), m_sSongGroup(""), m_SortOrder(SortOrder_Invalid),
m_sSoundPath(""), m_vsScreensToPrepare(), m_iWeightPounds(-1), m_sSoundPath(""), m_vsScreensToPrepare(), m_iWeightPounds(-1),
m_iGoalCalories(-1), m_GoalType(GoalType_Invalid), m_iGoalCalories(-1), m_GoalType(GoalType_Invalid),
@@ -56,7 +56,7 @@ public:
bool DescribesCurrentMode( PlayerNumber pn ) const; bool DescribesCurrentMode( PlayerNumber pn ) const;
bool DescribesCurrentModeForAllPlayers() const; bool DescribesCurrentModeForAllPlayers() const;
bool IsPlayable( RString *why = NULL ) const; bool IsPlayable( RString *why = nullptr ) const;
bool IsZero() const; bool IsZero() const;
/* If true, Apply() will apply m_sScreen. If false, it won't, and you need /* If true, Apply() will apply m_sScreen. If false, it won't, and you need
+1 -1
View File
@@ -234,7 +234,7 @@ private:
enum State { RENDERING_IDLE, RENDERING_START, RENDERING_ACTIVE, RENDERING_END }; enum State { RENDERING_IDLE, RENDERING_START, RENDERING_ACTIVE, RENDERING_END };
State m_State; State m_State;
}; };
static ConcurrentRenderer *g_pConcurrentRenderer = NULL; static ConcurrentRenderer *g_pConcurrentRenderer = nullptr;
ConcurrentRenderer::ConcurrentRenderer(): ConcurrentRenderer::ConcurrentRenderer():
m_Event("ConcurrentRenderer") m_Event("ConcurrentRenderer")
+2 -2
View File
@@ -12,7 +12,7 @@
#include "Style.h" #include "Style.h"
GameManager* GAMEMAN = NULL; // global and accessable from anywhere in our program GameManager* GAMEMAN = nullptr; // global and accessable from anywhere in our program
enum enum
{ {
@@ -3028,7 +3028,7 @@ void GameManager::GetEnabledGames( vector<const Game*>& aGamesOut )
const Game* GameManager::GetDefaultGame() const Game* GameManager::GetDefaultGame()
{ {
const Game *pDefault = NULL; const Game *pDefault = nullptr;
if( pDefault == nullptr ) if( pDefault == nullptr )
{ {
for( size_t i=0; pDefault == nullptr && i < ARRAYLEN(g_Games); ++i ) for( size_t i=0; pDefault == nullptr && i < ARRAYLEN(g_Games); ++i )
+1 -1
View File
@@ -18,7 +18,7 @@
#include "SongUtil.h" #include "SongUtil.h"
#include "LuaManager.h" #include "LuaManager.h"
GameSoundManager *SOUND = NULL; GameSoundManager *SOUND = nullptr;
/* /*
* When playing music, automatically search for an SM file for timing data. If one is * When playing music, automatically search for an SM file for timing data. If one is
+2 -2
View File
@@ -21,7 +21,7 @@ public:
{ {
PlayMusicParams() PlayMusicParams()
{ {
pTiming = NULL; pTiming = nullptr;
bForceLoop = false; bForceLoop = false;
fStartSecond = 0; fStartSecond = 0;
fLengthSeconds = -1; fLengthSeconds = -1;
@@ -44,7 +44,7 @@ public:
void PlayMusic( PlayMusicParams params, PlayMusicParams FallbackMusicParams = PlayMusicParams() ); void PlayMusic( PlayMusicParams params, PlayMusicParams FallbackMusicParams = PlayMusicParams() );
void PlayMusic( void PlayMusic(
RString sFile, RString sFile,
const TimingData *pTiming = NULL, const TimingData *pTiming = nullptr,
bool force_loop = false, bool force_loop = false,
float start_sec = 0, float start_sec = 0,
float length_sec = -1, float length_sec = -1,
+18 -18
View File
@@ -41,7 +41,7 @@
#include <ctime> #include <ctime>
#include <set> #include <set>
GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program GameState* GAMESTATE = nullptr; // global and accessable from anywhere in our program
#define NAME_BLACKLIST_FILE "/Data/NamesBlacklist.txt" #define NAME_BLACKLIST_FILE "/Data/NamesBlacklist.txt"
@@ -75,7 +75,7 @@ struct GameStateImpl
m_Subscriber.SubscribeToMessage( "RefreshCreditText" ); m_Subscriber.SubscribeToMessage( "RefreshCreditText" );
} }
}; };
static GameStateImpl *g_pImpl = NULL; static GameStateImpl *g_pImpl = nullptr;
ThemeMetric<bool> ALLOW_LATE_JOIN("GameState","AllowLateJoin"); ThemeMetric<bool> ALLOW_LATE_JOIN("GameState","AllowLateJoin");
ThemeMetric<bool> USE_NAME_BLACKLIST("GameState","UseNameBlacklist"); ThemeMetric<bool> USE_NAME_BLACKLIST("GameState","UseNameBlacklist");
@@ -106,7 +106,7 @@ static Preference<Premium> g_Premium( "Premium", Premium_DoubleFor1Credit );
Preference<bool> GameState::m_bAutoJoin( "AutoJoin", false ); Preference<bool> GameState::m_bAutoJoin( "AutoJoin", false );
GameState::GameState() : GameState::GameState() :
processedTiming( NULL ), processedTiming(nullptr),
m_pCurGame( Message_CurrentGameChanged ), m_pCurGame( Message_CurrentGameChanged ),
m_pCurStyle( Message_CurrentStyleChanged ), m_pCurStyle( Message_CurrentStyleChanged ),
m_PlayMode( Message_PlayModeChanged ), m_PlayMode( Message_PlayModeChanged ),
@@ -133,9 +133,9 @@ GameState::GameState() :
{ {
g_pImpl = new GameStateImpl; g_pImpl = new GameStateImpl;
SetCurrentStyle( NULL ); SetCurrentStyle(nullptr);
m_pCurGame.Set( NULL ); m_pCurGame.Set(nullptr);
m_timeGameStarted.SetZero(); m_timeGameStarted.SetZero();
m_bDemonstrationOrJukebox = false; m_bDemonstrationOrJukebox = false;
@@ -254,8 +254,8 @@ void GameState::ResetPlayer( PlayerNumber pn )
m_PreferredCourseDifficulty[pn].Set( Difficulty_Medium ); m_PreferredCourseDifficulty[pn].Set( Difficulty_Medium );
m_iPlayerStageTokens[pn] = 0; m_iPlayerStageTokens[pn] = 0;
m_iAwardedExtraStages[pn] = 0; m_iAwardedExtraStages[pn] = 0;
m_pCurSteps[pn].Set( NULL ); m_pCurSteps[pn].Set(nullptr);
m_pCurTrail[pn].Set( NULL ); m_pCurTrail[pn].Set(nullptr);
m_pPlayerState[pn]->Reset(); m_pPlayerState[pn]->Reset();
PROFILEMAN->UnloadProfile( pn ); PROFILEMAN->UnloadProfile( pn );
ResetPlayerOptions(pn); ResetPlayerOptions(pn);
@@ -278,7 +278,7 @@ void GameState::Reset()
ASSERT( THEME != nullptr ); ASSERT( THEME != nullptr );
m_timeGameStarted.SetZero(); m_timeGameStarted.SetZero();
SetCurrentStyle( NULL ); SetCurrentStyle(nullptr);
FOREACH_MultiPlayer( p ) FOREACH_MultiPlayer( p )
m_MultiPlayerStatus[p] = MultiPlayerStatus_NotJoined; m_MultiPlayerStatus[p] = MultiPlayerStatus_NotJoined;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
@@ -307,9 +307,9 @@ void GameState::Reset()
m_iStageSeed = rand(); m_iStageSeed = rand();
m_pCurSong.Set( GetDefaultSong() ); m_pCurSong.Set( GetDefaultSong() );
m_pPreferredSong = NULL; m_pPreferredSong = nullptr;
m_pCurCourse.Set( NULL ); m_pCurCourse.Set(nullptr);
m_pPreferredCourse = NULL; m_pPreferredCourse = nullptr;
FOREACH_MultiPlayer( p ) FOREACH_MultiPlayer( p )
m_pMultiPlayerState[p]->Reset(); m_pMultiPlayerState[p]->Reset();
@@ -343,7 +343,7 @@ void GameState::Reset()
LIGHTSMAN->SetLightsMode( LIGHTSMODE_ATTRACT ); LIGHTSMAN->SetLightsMode( LIGHTSMODE_ATTRACT );
m_stEdit.Set( StepsType_Invalid ); m_stEdit.Set( StepsType_Invalid );
m_pEditSourceSteps.Set( NULL ); m_pEditSourceSteps.Set(nullptr);
m_stEditSource.Set( StepsType_Invalid ); m_stEditSource.Set( StepsType_Invalid );
m_iEditCourseEntryIndex.Set( -1 ); m_iEditCourseEntryIndex.Set( -1 );
m_sEditLocalProfileID.Set( "" ); m_sEditLocalProfileID.Set( "" );
@@ -610,7 +610,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
int numSidesJoined = GetNumSidesJoined(); int numSidesJoined = GetNumSidesJoined();
if( pStyle == nullptr ) if( pStyle == nullptr )
{ {
const Steps *pSteps = NULL; const Steps *pSteps = nullptr;
if( this->GetMasterPlayerNumber() != PlayerNumber_Invalid ) if( this->GetMasterPlayerNumber() != PlayerNumber_Invalid )
pSteps = m_pCurSteps[this->GetMasterPlayerNumber()]; pSteps = m_pCurSteps[this->GetMasterPlayerNumber()];
// Don't call GetFirstCompatibleStyle if numSidesJoined == 0. // Don't call GetFirstCompatibleStyle if numSidesJoined == 0.
@@ -2169,7 +2169,7 @@ public:
static int GetCurrentSong( T* p, lua_State *L ) { if(p->m_pCurSong) p->m_pCurSong->PushSelf(L); else lua_pushnil(L); return 1; } static int GetCurrentSong( T* p, lua_State *L ) { if(p->m_pCurSong) p->m_pCurSong->PushSelf(L); else lua_pushnil(L); return 1; }
static int SetCurrentSong( T* p, lua_State *L ) static int SetCurrentSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->m_pCurSong.Set( NULL ); } if( lua_isnil(L,1) ) { p->m_pCurSong.Set(nullptr); }
else { Song *pS = Luna<Song>::check( L, 1, true ); p->m_pCurSong.Set( pS ); } else { Song *pS = Luna<Song>::check( L, 1, true ); p->m_pCurSong.Set( pS ); }
return 0; return 0;
} }
@@ -2184,7 +2184,7 @@ public:
static int SetCurrentSteps( T* p, lua_State *L ) static int SetCurrentSteps( T* p, lua_State *L )
{ {
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
if( lua_isnil(L,2) ) { p->m_pCurSteps[pn].Set( NULL ); } if( lua_isnil(L,2) ) { p->m_pCurSteps[pn].Set(nullptr); }
else { Steps *pS = Luna<Steps>::check(L,2); p->m_pCurSteps[pn].Set( pS ); } else { Steps *pS = Luna<Steps>::check(L,2); p->m_pCurSteps[pn].Set( pS ); }
ASSERT(p->m_pCurSteps[pn]->m_StepsType == p->m_pCurStyle->m_StepsType); ASSERT(p->m_pCurSteps[pn]->m_StepsType == p->m_pCurStyle->m_StepsType);
@@ -2195,7 +2195,7 @@ public:
static int GetCurrentCourse( T* p, lua_State *L ) { if(p->m_pCurCourse) p->m_pCurCourse->PushSelf(L); else lua_pushnil(L); return 1; } static int GetCurrentCourse( T* p, lua_State *L ) { if(p->m_pCurCourse) p->m_pCurCourse->PushSelf(L); else lua_pushnil(L); return 1; }
static int SetCurrentCourse( T* p, lua_State *L ) static int SetCurrentCourse( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->m_pCurCourse.Set( NULL ); } if( lua_isnil(L,1) ) { p->m_pCurCourse.Set(nullptr); }
else { Course *pC = Luna<Course>::check(L,1); p->m_pCurCourse.Set( pC ); } else { Course *pC = Luna<Course>::check(L,1); p->m_pCurCourse.Set( pC ); }
return 0; return 0;
} }
@@ -2210,7 +2210,7 @@ public:
static int SetCurrentTrail( T* p, lua_State *L ) static int SetCurrentTrail( T* p, lua_State *L )
{ {
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
if( lua_isnil(L,2) ) { p->m_pCurTrail[pn].Set( NULL ); } if( lua_isnil(L,2) ) { p->m_pCurTrail[pn].Set(nullptr); }
else { Trail *pS = Luna<Trail>::check(L,2); p->m_pCurTrail[pn].Set( pS ); } else { Trail *pS = Luna<Trail>::check(L,2); p->m_pCurTrail[pn].Set( pS ); }
MESSAGEMAN->Broadcast( (MessageID)(Message_CurrentTrailP1Changed+pn) ); MESSAGEMAN->Broadcast( (MessageID)(Message_CurrentTrailP1Changed+pn) );
return 0; return 0;
@@ -2218,7 +2218,7 @@ public:
static int GetPreferredSong( T* p, lua_State *L ) { if(p->m_pPreferredSong) p->m_pPreferredSong->PushSelf(L); else lua_pushnil(L); return 1; } static int GetPreferredSong( T* p, lua_State *L ) { if(p->m_pPreferredSong) p->m_pPreferredSong->PushSelf(L); else lua_pushnil(L); return 1; }
static int SetPreferredSong( T* p, lua_State *L ) static int SetPreferredSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->m_pPreferredSong = NULL; } if( lua_isnil(L,1) ) { p->m_pPreferredSong = nullptr; }
else { Song *pS = Luna<Song>::check(L,1); p->m_pPreferredSong = pS; } else { Song *pS = Luna<Song>::check(L,1); p->m_pPreferredSong = pS; }
return 0; return 0;
} }
+3 -3
View File
@@ -126,7 +126,7 @@ public:
~GraphBody() ~GraphBody()
{ {
TEXTUREMAN->UnloadTexture( m_pTexture ); TEXTUREMAN->UnloadTexture( m_pTexture );
m_pTexture = NULL; m_pTexture = nullptr;
} }
void DrawPrimitives() void DrawPrimitives()
@@ -150,8 +150,8 @@ public:
GraphDisplay::GraphDisplay() GraphDisplay::GraphDisplay()
{ {
m_pGraphLine = NULL; m_pGraphLine = nullptr;
m_pGraphBody = NULL; m_pGraphBody = nullptr;
} }
GraphDisplay::~GraphDisplay() GraphDisplay::~GraphDisplay()
+1 -1
View File
@@ -82,7 +82,7 @@ namespace
* this won't cause timing problems, because the event timestamp is preserved. */ * this won't cause timing problems, because the event timestamp is preserved. */
static Preference<float> g_fInputDebounceTime( "InputDebounceTime", 0 ); static Preference<float> g_fInputDebounceTime( "InputDebounceTime", 0 );
InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program InputFilter* INPUTFILTER = nullptr; // global and accessable from anywhere in our program
static const float TIME_BEFORE_REPEATS = 0.375f; static const float TIME_BEFORE_REPEATS = 0.375f;
+3 -3
View File
@@ -61,9 +61,9 @@ public:
void RepeatStopKey( const DeviceInput &di ); void RepeatStopKey( const DeviceInput &di );
// If aButtonState is NULL, use the last reported state. // If aButtonState is NULL, use the last reported state.
bool IsBeingPressed( const DeviceInput &di, const DeviceInputList *pButtonState = NULL ) const; bool IsBeingPressed( const DeviceInput &di, const DeviceInputList *pButtonState = nullptr ) const;
float GetSecsHeld( const DeviceInput &di, const DeviceInputList *pButtonState = NULL ) const; float GetSecsHeld( const DeviceInput &di, const DeviceInputList *pButtonState = nullptr ) const;
float GetLevel( const DeviceInput &di, const DeviceInputList *pButtonState = NULL ) const; float GetLevel( const DeviceInput &di, const DeviceInputList *pButtonState = nullptr ) const;
RString GetButtonComment( const DeviceInput &di ) const; RString GetButtonComment( const DeviceInput &di ) const;
void GetInputEvents( vector<InputEvent> &aEventOut ); void GetInputEvents( vector<InputEvent> &aEventOut );
+2 -2
View File
@@ -26,12 +26,12 @@ namespace
PlayerNumber g_JoinControllers; PlayerNumber g_JoinControllers;
}; };
InputMapper* INPUTMAPPER = NULL; // global and accessable from anywhere in our program InputMapper* INPUTMAPPER = nullptr; // global and accessable from anywhere in our program
InputMapper::InputMapper() InputMapper::InputMapper()
{ {
g_JoinControllers = PLAYER_INVALID; g_JoinControllers = PLAYER_INVALID;
m_pInputScheme = NULL; m_pInputScheme = nullptr;
} }
InputMapper::~InputMapper() InputMapper::~InputMapper()
+1 -1
View File
@@ -173,7 +173,7 @@ public:
float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid ) const; float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid ) const;
float GetSecsHeld( GameButton MenuI, PlayerNumber pn ) const; float GetSecsHeld( GameButton MenuI, PlayerNumber pn ) const;
bool IsBeingPressed( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = NULL ) const; bool IsBeingPressed( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = nullptr ) const;
bool IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const; bool IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const;
void ResetKeyRepeat( const GameInput &GameI ); void ResetKeyRepeat( const GameInput &GameI );
+2 -2
View File
@@ -6,7 +6,7 @@
#include "InputMapper.h" #include "InputMapper.h"
InputQueue* INPUTQUEUE = NULL; // global and accessable from anywhere in our program InputQueue* INPUTQUEUE = nullptr; // global and accessable from anywhere in our program
const unsigned MAX_INPUT_QUEUE_LENGTH = 32; const unsigned MAX_INPUT_QUEUE_LENGTH = 32;
@@ -95,7 +95,7 @@ bool InputQueueCode::EnteredCode( GameController controller ) const
int iMinSearchIndexUsed = iQueueIndex; int iMinSearchIndexUsed = iQueueIndex;
for( int b=0; b<(int) Press.m_aButtonsToPress.size(); ++b ) for( int b=0; b<(int) Press.m_aButtonsToPress.size(); ++b )
{ {
const InputEventPlus *pIEP = NULL; const InputEventPlus *pIEP = nullptr;
int iQueueSearchIndex = iQueueIndex; int iQueueSearchIndex = iQueueIndex;
for( ; iQueueSearchIndex>=0; --iQueueSearchIndex ) // iterate newest to oldest for( ; iQueueSearchIndex>=0; --iQueueSearchIndex ) // iterate newest to oldest
{ {
+1 -1
View File
@@ -14,7 +14,7 @@ public:
InputQueue(); InputQueue();
void RememberInput( const InputEventPlus &gi ); void RememberInput( const InputEventPlus &gi );
bool WasPressedRecently( GameController c, const GameButton button, const RageTimer &OldestTimeAllowed, InputEventPlus *pIEP = NULL ); bool WasPressedRecently( GameController c, const GameButton button, const RageTimer &OldestTimeAllowed, InputEventPlus *pIEP = nullptr );
const vector<InputEventPlus> &GetQueue( GameController c ) const { return m_aQueue[c]; } const vector<InputEventPlus> &GetQueue( GameController c ) const { return m_aQueue[c]; }
void ClearQueue( GameController c ); void ClearQueue( GameController c );
+1 -1
View File
@@ -29,7 +29,7 @@ LifeMeterBar::LifeMeterBar()
EXTRA_STAGE_LIFE_DIFFICULTY.Load ("LifeMeterBar","ExtraStageLifeDifficulty"); EXTRA_STAGE_LIFE_DIFFICULTY.Load ("LifeMeterBar","ExtraStageLifeDifficulty");
m_fLifePercentChange.Load( "LifeMeterBar", LIFE_PERCENT_CHANGE_NAME, NUM_ScoreEvent ); m_fLifePercentChange.Load( "LifeMeterBar", LIFE_PERCENT_CHANGE_NAME, NUM_ScoreEvent );
m_pPlayerState = NULL; m_pPlayerState = nullptr;
SongOptions::DrainType dtype = GAMESTATE->m_SongOptions.GetStage().m_DrainType; SongOptions::DrainType dtype = GAMESTATE->m_SongOptions.GetStage().m_DrainType;
switch( dtype ) switch( dtype )
+1 -1
View File
@@ -48,7 +48,7 @@ LifeMeterTime::LifeMeterTime()
{ {
m_fLifeTotalGainedSeconds = 0; m_fLifeTotalGainedSeconds = 0;
m_fLifeTotalLostSeconds = 0; m_fLifeTotalLostSeconds = 0;
m_pStream = NULL; m_pStream = nullptr;
} }
LifeMeterTime::~LifeMeterTime() LifeMeterTime::~LifeMeterTime()
+1 -1
View File
@@ -94,7 +94,7 @@ static void GetUsedGameInputs( vector<GameInput> &vGameInputsOut )
vGameInputsOut.push_back( input ); vGameInputsOut.push_back( input );
} }
LightsManager* LIGHTSMAN = NULL; // global and accessable from anywhere in our program LightsManager* LIGHTSMAN = nullptr; // global and accessable from anywhere in our program
LightsManager::LightsManager() LightsManager::LightsManager()
{ {
+1 -1
View File
@@ -39,7 +39,7 @@ LocalizedString::LocalizedString( const RString& sGroup, const RString& sName )
m_sGroup = sGroup; m_sGroup = sGroup;
m_sName = sName; m_sName = sName;
m_pImpl = NULL; m_pImpl = nullptr;
CreateImpl(); CreateImpl();
} }
+4 -4
View File
@@ -16,7 +16,7 @@
#include <cassert> #include <cassert>
#include <map> #include <map>
LuaManager *LUA = NULL; LuaManager *LUA = nullptr;
struct Impl struct Impl
{ {
Impl(): g_pLock("Lua") {} Impl(): g_pLock("Lua") {}
@@ -25,7 +25,7 @@ struct Impl
RageMutex g_pLock; RageMutex g_pLock;
}; };
static Impl *pImpl = NULL; static Impl *pImpl = nullptr;
#if defined(_MSC_VER) #if defined(_MSC_VER)
/* "interaction between '_setjmp' and C++ object destruction is non-portable" /* "interaction between '_setjmp' and C++ object destruction is non-portable"
@@ -226,7 +226,7 @@ static int LuaPanic( lua_State *L )
} }
// Actor registration // Actor registration
static vector<RegisterWithLuaFn> *g_vRegisterActorTypes = NULL; static vector<RegisterWithLuaFn> *g_vRegisterActorTypes = nullptr;
void LuaManager::Register( RegisterWithLuaFn pfn ) void LuaManager::Register( RegisterWithLuaFn pfn )
{ {
@@ -315,7 +315,7 @@ void LuaManager::Release( Lua *&p )
if( bDoUnlock ) if( bDoUnlock )
pImpl->g_pLock.Unlock(); pImpl->g_pLock.Unlock();
p = NULL; p = nullptr;
} }
/* /*
+2 -2
View File
@@ -13,7 +13,7 @@
#include "arch/MemoryCard/MemoryCardDriver_Null.h" #include "arch/MemoryCard/MemoryCardDriver_Null.h"
#include "LuaManager.h" #include "LuaManager.h"
MemoryCardManager* MEMCARDMAN = NULL; // global and accessable from anywhere in our program MemoryCardManager* MEMCARDMAN = nullptr; // global and accessable from anywhere in our program
static void MemoryCardOsMountPointInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) static void MemoryCardOsMountPointInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut )
{ {
@@ -253,7 +253,7 @@ bool ThreadedMemoryCardWorker::Unmount( const UsbStorageDevice *pDevice )
return true; return true;
} }
static ThreadedMemoryCardWorker *g_pWorker = NULL; static ThreadedMemoryCardWorker *g_pWorker = nullptr;
MemoryCardManager::MemoryCardManager() MemoryCardManager::MemoryCardManager()
{ {
+1 -1
View File
@@ -19,7 +19,7 @@ MenuTimer::MenuTimer()
m_fStallSecondsLeft = 0; m_fStallSecondsLeft = 0;
m_bPaused = false; m_bPaused = false;
m_bSilent = false; m_bSilent = false;
WARNING_COMMAND = NULL; WARNING_COMMAND = nullptr;
} }
MenuTimer::~MenuTimer() MenuTimer::~MenuTimer()
+1 -1
View File
@@ -9,7 +9,7 @@
#include <set> #include <set>
#include <map> #include <map>
MessageManager* MESSAGEMAN = NULL; // global and accessable from anywhere in our program MessageManager* MESSAGEMAN = nullptr; // global and accessable from anywhere in our program
static const char *MessageIDNames[] = { static const char *MessageIDNames[] = {
+1 -1
View File
@@ -242,7 +242,7 @@ private:
MessageID mSendWhenChanged; MessageID mSendWhenChanged;
T *val; T *val;
public: public:
explicit BroadcastOnChangePtr( MessageID m ) { mSendWhenChanged = m; val = NULL; } explicit BroadcastOnChangePtr( MessageID m ) { mSendWhenChanged = m; val = nullptr; }
T* Get() const { return val; } T* Get() const { return val; }
void Set( T* t ) { val = t; if(MESSAGEMAN) MESSAGEMAN->Broadcast( MessageIDToString(mSendWhenChanged) ); } void Set( T* t ) { val = t; if(MESSAGEMAN) MESSAGEMAN->Broadcast( MessageIDToString(mSendWhenChanged) ); }
/* This is only intended to be used for setting temporary values; always /* This is only intended to be used for setting temporary values; always
+7 -7
View File
@@ -24,13 +24,13 @@ Model::Model()
m_bTextureWrapping = true; m_bTextureWrapping = true;
SetUseZBuffer( true ); SetUseZBuffer( true );
SetCullMode( CULL_BACK ); SetCullMode( CULL_BACK );
m_pGeometry = NULL; m_pGeometry = nullptr;
m_pCurAnimation = NULL; m_pCurAnimation = nullptr;
m_fDefaultAnimationRate = 1; m_fDefaultAnimationRate = 1;
m_fCurAnimationRate = 1; m_fCurAnimationRate = 1;
m_bLoop = true; m_bLoop = true;
m_bDrawCelShaded = false; m_bDrawCelShaded = false;
m_pTempGeometry = NULL; m_pTempGeometry = nullptr;
} }
Model::~Model() Model::~Model()
@@ -43,12 +43,12 @@ void Model::Clear()
if( m_pGeometry ) if( m_pGeometry )
{ {
MODELMAN->UnloadModel( m_pGeometry ); MODELMAN->UnloadModel( m_pGeometry );
m_pGeometry = NULL; m_pGeometry = nullptr;
} }
m_vpBones.clear(); m_vpBones.clear();
m_Materials.clear(); m_Materials.clear();
m_mapNameToAnimation.clear(); m_mapNameToAnimation.clear();
m_pCurAnimation = NULL; m_pCurAnimation = nullptr;
if( m_pTempGeometry ) if( m_pTempGeometry )
DISPLAY->DeleteCompiledGeometry( m_pTempGeometry ); DISPLAY->DeleteCompiledGeometry( m_pTempGeometry );
@@ -607,7 +607,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, vector<myBone
} }
// search for the adjacent position keys // search for the adjacent position keys
const msPositionKey *pLastPositionKey = NULL, *pThisPositionKey = NULL; const msPositionKey *pLastPositionKey = nullptr, *pThisPositionKey = nullptr;
for( size_t j = 0; j < pBone->PositionKeys.size(); ++j ) for( size_t j = 0; j < pBone->PositionKeys.size(); ++j )
{ {
const msPositionKey *pPositionKey = &pBone->PositionKeys[j]; const msPositionKey *pPositionKey = &pBone->PositionKeys[j];
@@ -631,7 +631,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, vector<myBone
vPos = pLastPositionKey->Position; vPos = pLastPositionKey->Position;
// search for the adjacent rotation keys // search for the adjacent rotation keys
const msRotationKey *pLastRotationKey = NULL, *pThisRotationKey = NULL; const msRotationKey *pLastRotationKey = nullptr, *pThisRotationKey = nullptr;
for( size_t j = 0; j < pBone->RotationKeys.size(); ++j ) for( size_t j = 0; j < pBone->RotationKeys.size(); ++j )
{ {
const msRotationKey *pRotationKey = &pBone->RotationKeys[j]; const msRotationKey *pRotationKey = &pBone->RotationKeys[j];
+4 -4
View File
@@ -187,7 +187,7 @@ void MusicWheel::BeginScreen()
if( GAMESTATE->m_pCurSong != nullptr && if( GAMESTATE->m_pCurSong != nullptr &&
GameState::GetNumStagesMultiplierForSong( GAMESTATE->m_pCurSong ) > GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() ) GameState::GetNumStagesMultiplierForSong( GAMESTATE->m_pCurSong ) > GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() )
{ {
GAMESTATE->m_pCurSong.Set( NULL ); GAMESTATE->m_pCurSong.Set(nullptr);
} }
/* Invalidate current Steps if it can't be played /* Invalidate current Steps if it can't be played
@@ -201,7 +201,7 @@ void MusicWheel::BeginScreen()
SongUtil::GetPlayableSteps( GAMESTATE->m_pCurSong, vpPossibleSteps ); SongUtil::GetPlayableSteps( GAMESTATE->m_pCurSong, vpPossibleSteps );
bool bStepsIsPossible = find( vpPossibleSteps.begin(), vpPossibleSteps.end(), GAMESTATE->m_pCurSteps[p] ) == vpPossibleSteps.end(); bool bStepsIsPossible = find( vpPossibleSteps.begin(), vpPossibleSteps.end(), GAMESTATE->m_pCurSteps[p] ) == vpPossibleSteps.end();
if( !bStepsIsPossible ) if( !bStepsIsPossible )
GAMESTATE->m_pCurSteps[p].Set( NULL ); GAMESTATE->m_pCurSteps[p].Set(nullptr);
} }
} }
@@ -910,7 +910,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
const int iMaxStagesForSong = GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer(); const int iMaxStagesForSong = GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer();
Song *pExtraStageSong = NULL; Song *pExtraStageSong = nullptr;
if( GAMESTATE->IsAnExtraStage() ) if( GAMESTATE->IsAnExtraStage() )
{ {
Steps *pSteps; Steps *pSteps;
@@ -1342,7 +1342,7 @@ void MusicWheel::SetOpenSection( RString group )
if ( REMIND_WHEEL_POSITIONS && HIDE_INACTIVE_SECTIONS ) if ( REMIND_WHEEL_POSITIONS && HIDE_INACTIVE_SECTIONS )
m_viWheelPositions.resize( SONGMAN->GetNumSongGroups() ); m_viWheelPositions.resize( SONGMAN->GetNumSongGroups() );
const WheelItemBaseData *old = NULL; const WheelItemBaseData *old = nullptr;
if( !m_CurWheelItemData.empty() ) if( !m_CurWheelItemData.empty() )
old = GetCurWheelItemData(m_iSelection); old = GetCurWheelItemData(m_iSelection);
+3 -3
View File
@@ -75,7 +75,7 @@ MusicWheelItem::MusicWheelItem( RString sType ):
FOREACH_ENUM( MusicWheelItemType, i ) FOREACH_ENUM( MusicWheelItemType, i )
{ {
m_pText[i] = NULL; m_pText[i] = nullptr;
// Don't init text for Type_Song. It uses a TextBanner. // Don't init text for Type_Song. It uses a TextBanner.
if( i == MusicWheelItemType_Song ) if( i == MusicWheelItemType_Song )
@@ -147,7 +147,7 @@ MusicWheelItem::MusicWheelItem( const MusicWheelItem &cpy ):
{ {
if( cpy.m_pText[i] == nullptr ) if( cpy.m_pText[i] == nullptr )
{ {
m_pText[i] = NULL; m_pText[i] = nullptr;
} }
else else
{ {
@@ -345,7 +345,7 @@ void MusicWheelItem::RefreshGrades()
Profile *pProfile = PROFILEMAN->GetProfile(ps); Profile *pProfile = PROFILEMAN->GetProfile(ps);
HighScoreList *pHSL = NULL; HighScoreList *pHSL = nullptr;
if( PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid ) if( PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid )
{ {
if( pWID->m_pSong ) if( pWID->m_pSong )
+1 -1
View File
@@ -62,7 +62,7 @@ private:
struct MusicWheelItemData : public WheelItemBaseData struct MusicWheelItemData : public WheelItemBaseData
{ {
MusicWheelItemData() : m_pCourse(NULL), m_pSong(NULL), m_Flags(), MusicWheelItemData() : m_pCourse(nullptr), m_pSong(nullptr), m_Flags(),
m_iSectionCount(0), m_sLabel(""), m_pAction() { } m_iSectionCount(0), m_sLabel(""), m_pAction() { }
MusicWheelItemData( WheelItemDataType type, Song* pSong, MusicWheelItemData( WheelItemDataType type, Song* pSong,
RString sSectionName, Course* pCourse, RString sSectionName, Course* pCourse,
+2 -2
View File
@@ -68,8 +68,8 @@ int NetworkSyncManager::GetSMOnlineSalt()
static LocalizedString INITIALIZING_CLIENT_NETWORK ( "NetworkSyncManager", "Initializing Client Network..." ); static LocalizedString INITIALIZING_CLIENT_NETWORK ( "NetworkSyncManager", "Initializing Client Network..." );
NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld ) NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld )
{ {
LANserver = NULL; //So we know if it has been created yet LANserver = nullptr; //So we know if it has been created yet
BroadcastReception = NULL; BroadcastReception = nullptr;
ld->SetText( INITIALIZING_CLIENT_NETWORK ); ld->SetText( INITIALIZING_CLIENT_NETWORK );
NetPlayerClient = new EzSockets; NetPlayerClient = new EzSockets;
+1 -1
View File
@@ -109,7 +109,7 @@ public:
class NetworkSyncManager class NetworkSyncManager
{ {
public: public:
NetworkSyncManager( LoadingWindow *ld = NULL ); NetworkSyncManager( LoadingWindow *ld = nullptr );
~NetworkSyncManager(); ~NetworkSyncManager();
// If "useSMserver" then send score to server // If "useSMserver" then send score to server
+1 -1
View File
@@ -255,7 +255,7 @@ public:
void GetTracksHeldAtRow( int row, set<int>& addTo ); void GetTracksHeldAtRow( int row, set<int>& addTo );
int GetNumTracksHeldAtRow( int row ); int GetNumTracksHeldAtRow( int row );
bool IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow = NULL ) const; bool IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow = nullptr ) const;
bool IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) const; bool IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) const;
// statistics // statistics
+4 -4
View File
@@ -119,7 +119,7 @@ struct NoteResource
NoteResource( const NoteSkinAndPath &nsap ): m_nsap(nsap) NoteResource( const NoteSkinAndPath &nsap ): m_nsap(nsap)
{ {
m_iRefCount = 0; m_iRefCount = 0;
m_pActor = NULL; m_pActor = nullptr;
} }
~NoteResource() ~NoteResource()
@@ -173,7 +173,7 @@ static void DeleteNoteResource( NoteResource *pRes )
NoteColorActor::NoteColorActor() NoteColorActor::NoteColorActor()
{ {
m_p = NULL; m_p = nullptr;
} }
NoteColorActor::~NoteColorActor() NoteColorActor::~NoteColorActor()
@@ -197,7 +197,7 @@ Actor *NoteColorActor::Get()
NoteColorSprite::NoteColorSprite() NoteColorSprite::NoteColorSprite()
{ {
m_p = NULL; m_p = nullptr;
} }
NoteColorSprite::~NoteColorSprite() NoteColorSprite::~NoteColorSprite()
@@ -750,7 +750,7 @@ void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat,
float fDrawDistanceBeforeTargetsPixels, float fDrawDistanceBeforeTargetsPixels,
float fFadeInPercentOfDrawFar) float fFadeInPercentOfDrawFar)
{ {
Actor* pActor = NULL; Actor* pActor = nullptr;
NotePart part = NotePart_Tap; NotePart part = NotePart_Tap;
/* /*
if( tn.source == TapNote::addition ) if( tn.source == TapNote::addition )
+3 -3
View File
@@ -38,8 +38,8 @@ static ThemeMetric1D<RString> ROUTINE_NOTESKIN( "NoteField", RoutineNoteSkinName
NoteField::NoteField() NoteField::NoteField()
{ {
m_pNoteData = NULL; m_pNoteData = nullptr;
m_pCurDisplay = NULL; m_pCurDisplay = nullptr;
m_textMeasureNumber.LoadFromFont( THEME->GetPathF("NoteField","MeasureNumber") ); m_textMeasureNumber.LoadFromFont( THEME->GetPathF("NoteField","MeasureNumber") );
m_textMeasureNumber.SetZoom( 1.0f ); m_textMeasureNumber.SetZoom( 1.0f );
@@ -77,7 +77,7 @@ void NoteField::Unload()
it != m_NoteDisplays.end(); ++it ) it != m_NoteDisplays.end(); ++it )
delete it->second; delete it->second;
m_NoteDisplays.clear(); m_NoteDisplays.clear();
m_pCurDisplay = NULL; m_pCurDisplay = nullptr;
memset( m_pDisplays, 0, sizeof(m_pDisplays) ); memset( m_pDisplays, 0, sizeof(m_pDisplays) );
} }
+2 -2
View File
@@ -18,7 +18,7 @@
#include "SpecialFiles.h" #include "SpecialFiles.h"
/** @brief Have the NoteSkinManager available throughout the program. */ /** @brief Have the NoteSkinManager available throughout the program. */
NoteSkinManager* NOTESKIN = NULL; NoteSkinManager* NOTESKIN = nullptr;
const RString GAME_COMMON_NOTESKIN_NAME = "common"; const RString GAME_COMMON_NOTESKIN_NAME = "common";
const RString GAME_BASE_NOTESKIN_NAME = "default"; const RString GAME_BASE_NOTESKIN_NAME = "default";
@@ -47,7 +47,7 @@ namespace
NoteSkinManager::NoteSkinManager() NoteSkinManager::NoteSkinManager()
{ {
m_pCurGame = NULL; m_pCurGame = nullptr;
m_PlayerNumber = PlayerNumber_Invalid; m_PlayerNumber = PlayerNumber_Invalid;
m_GameController = GameController_Invalid; m_GameController = GameController_Invalid;
+3 -2
View File
@@ -25,11 +25,12 @@ public:
void SetCurrentNoteSkin( const RString &sNoteSkin ) { m_sCurrentNoteSkin = sNoteSkin; } void SetCurrentNoteSkin( const RString &sNoteSkin ) { m_sCurrentNoteSkin = sNoteSkin; }
const RString &GetCurrentNoteSkin() { return m_sCurrentNoteSkin; } const RString &GetCurrentNoteSkin() { return m_sCurrentNoteSkin; }
void SetPlayerNumber( PlayerNumber pn ) { m_PlayerNumber = pn; }
void SetPlayerNumber( PlayerNumber pn ) { m_PlayerNumber = pn; }
void SetGameController( GameController gc ) { m_GameController = gc; } void SetGameController( GameController gc ) { m_GameController = gc; }
RString GetPath( const RString &sButtonName, const RString &sElement ); RString GetPath( const RString &sButtonName, const RString &sElement );
bool PushActorTemplate( Lua *L, const RString &sButton, const RString &sElement, bool bSpriteOnly ); bool PushActorTemplate( Lua *L, const RString &sButton, const RString &sElement, bool bSpriteOnly );
Actor *LoadActor( const RString &sButton, const RString &sElement, Actor *pParent = NULL, bool bSpriteOnly = false ); Actor *LoadActor( const RString &sButton, const RString &sElement, Actor *pParent = nullptr, bool bSpriteOnly = false );
RString GetMetric( const RString &sButtonName, const RString &sValue ); RString GetMetric( const RString &sButtonName, const RString &sValue );
int GetMetricI( const RString &sButtonName, const RString &sValueName ); int GetMetricI( const RString &sButtonName, const RString &sValueName );
+1 -1
View File
@@ -969,7 +969,7 @@ bool SMLoader::LoadEditFromBuffer( const RString &sBuffer, const RString &sEditF
bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath, ProfileSlot slot, bool bAddStepsToSong ) bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath, ProfileSlot slot, bool bAddStepsToSong )
{ {
Song* pSong = NULL; Song* pSong = nullptr;
for( unsigned i=0; i<msd.GetNumValues(); i++ ) for( unsigned i=0; i<msd.GetNumValues(); i++ )
{ {
+1 -1
View File
@@ -162,7 +162,7 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
out.m_sSongFileName = sPath; out.m_sSongFileName = sPath;
int state = SMA_GETTING_SONG_INFO; int state = SMA_GETTING_SONG_INFO;
Steps* pNewNotes = NULL; Steps* pNewNotes = nullptr;
int iRowsPerBeat = -1; // Start with an invalid value: needed for checking. int iRowsPerBeat = -1; // Start with an invalid value: needed for checking.
for( unsigned i=0; i<msd.GetNumValues(); i++ ) for( unsigned i=0; i<msd.GetNumValues(); i++ )
+3 -3
View File
@@ -250,7 +250,7 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
int state = GETTING_SONG_INFO; int state = GETTING_SONG_INFO;
const unsigned values = msd.GetNumValues(); const unsigned values = msd.GetNumValues();
Steps* pNewNotes = NULL; Steps* pNewNotes = nullptr;
TimingData stepsTiming; TimingData stepsTiming;
bool bHasOwnTiming = false; bool bHasOwnTiming = false;
@@ -836,8 +836,8 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
ProfileSlot slot, ProfileSlot slot,
bool bAddStepsToSong ) bool bAddStepsToSong )
{ {
Song* pSong = NULL; Song* pSong = nullptr;
Steps* pNewNotes = NULL; Steps* pNewNotes = nullptr;
bool bSSCFormat = false; bool bSSCFormat = false;
bool bHasOwnTiming = false; bool bHasOwnTiming = false;
TimingData stepsTiming; TimingData stepsTiming;
+2 -2
View File
@@ -33,9 +33,9 @@ RString MOD_ICON_X_NAME( size_t p ) { return ssprintf("ModIconP%dX",int(p+1));
OptionRow::OptionRow( const OptionRowType *pSource ) OptionRow::OptionRow( const OptionRowType *pSource )
{ {
m_pParentType = pSource; m_pParentType = pSource;
m_pHand = NULL; m_pHand = nullptr;
m_textTitle = NULL; m_textTitle = nullptr;
ZERO( m_ModIcons ); ZERO( m_ModIcons );
Clear(); Clear();
+9 -9
View File
@@ -510,8 +510,8 @@ public:
void Init() void Init()
{ {
OptionRowHandler::Init(); OptionRowHandler::Init();
m_ppStepsToFill = NULL; m_ppStepsToFill = nullptr;
m_pDifficultyToFill = NULL; m_pDifficultyToFill = nullptr;
m_vSteps.clear(); m_vSteps.clear();
m_vDifficulties.clear(); m_vDifficulties.clear();
} }
@@ -569,7 +569,7 @@ public:
if( sParam == "EditSteps" ) if( sParam == "EditSteps" )
{ {
m_vSteps.push_back( NULL ); m_vSteps.push_back(nullptr);
m_vDifficulties.push_back( Difficulty_Edit ); m_vDifficulties.push_back( Difficulty_Edit );
} }
@@ -596,7 +596,7 @@ public:
else else
{ {
m_vDifficulties.push_back( Difficulty_Edit ); m_vDifficulties.push_back( Difficulty_Edit );
m_vSteps.push_back( NULL ); m_vSteps.push_back(nullptr);
m_Def.m_vsChoices.push_back( "none" ); m_Def.m_vsChoices.push_back( "none" );
} }
@@ -672,7 +672,7 @@ class OptionRowHandlerListCharacters: public OptionRowHandlerList
{ {
m_Def.m_vsChoices.push_back( OFF ); m_Def.m_vsChoices.push_back( OFF );
GameCommand mc; GameCommand mc;
mc.m_pCharacter = NULL; mc.m_pCharacter = nullptr;
m_aListEntries.push_back( mc ); m_aListEntries.push_back( mc );
} }
@@ -1100,7 +1100,7 @@ public:
void Init() void Init()
{ {
OptionRowHandler::Init(); OptionRowHandler::Init();
m_pOpt = NULL; m_pOpt = nullptr;
} }
virtual void LoadInternal( const Commands &cmds ) virtual void LoadInternal( const Commands &cmds )
{ {
@@ -1180,7 +1180,7 @@ public:
void Init() void Init()
{ {
OptionRowHandler::Init(); OptionRowHandler::Init();
m_pstToFill = NULL; m_pstToFill = nullptr;
m_vStepsTypesToShow.clear(); m_vStepsTypesToShow.clear();
} }
@@ -1320,7 +1320,7 @@ public:
OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds ) OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds )
{ {
OptionRowHandler* pHand = NULL; OptionRowHandler* pHand = nullptr;
if( cmds.v.size() == 0 ) if( cmds.v.size() == 0 )
return nullptr; return nullptr;
@@ -1362,7 +1362,7 @@ OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds )
OptionRowHandler* OptionRowHandlerUtil::MakeNull() OptionRowHandler* OptionRowHandlerUtil::MakeNull()
{ {
OptionRowHandler* pHand = NULL; OptionRowHandler* pHand = nullptr;
Commands cmds; Commands cmds;
MAKE( OptionRowHandlerNull ) MAKE( OptionRowHandlerNull )
return pHand; return pHand;
+2 -2
View File
@@ -172,7 +172,7 @@ void OptionListRow::PositionCursor( Actor *pCursor, int iSelection )
OptionsList::OptionsList() OptionsList::OptionsList()
{ {
m_iCurrentRow = 0; m_iCurrentRow = 0;
m_pLinked = NULL; m_pLinked = nullptr;
} }
OptionsList::~OptionsList() OptionsList::~OptionsList()
@@ -265,7 +265,7 @@ void OptionsList::Open()
Push( TOP_MENU ); Push( TOP_MENU );
this->FinishTweening(); this->FinishTweening();
m_Row[!m_iCurrentRow].SetFromHandler( NULL ); m_Row[!m_iCurrentRow].SetFromHandler(nullptr);
this->PlayCommand( "TweenOn" ); this->PlayCommand( "TweenOn" );
} }
+1 -1
View File
@@ -179,7 +179,7 @@ void PaneDisplay::GetPaneTextAndLevel( PaneCategory c, RString & sTextOut, float
{ {
RadarValues rv; RadarValues rv;
HighScoreList *pHSL = NULL; HighScoreList *pHSL = nullptr;
ProfileSlot slot = ProfileSlot_Machine; ProfileSlot slot = ProfileSlot_Machine;
switch( c ) switch( c )
{ {
+2 -2
View File
@@ -16,8 +16,8 @@ REGISTER_ACTOR_CLASS( PercentageDisplay );
PercentageDisplay::PercentageDisplay() PercentageDisplay::PercentageDisplay()
{ {
m_pPlayerState = NULL; m_pPlayerState = nullptr;
m_pPlayerStageStats = NULL; m_pPlayerStageStats = nullptr;
m_Last = -1; m_Last = -1;
m_LastMax = -1; m_LastMax = -1;
+20 -20
View File
@@ -223,27 +223,27 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd)
{ {
m_bLoaded = false; m_bLoaded = false;
m_pPlayerState = NULL; m_pPlayerState = nullptr;
m_pPlayerStageStats = NULL; m_pPlayerStageStats = nullptr;
m_fNoteFieldHeight = 0; m_fNoteFieldHeight = 0;
m_pLifeMeter = NULL; m_pLifeMeter = nullptr;
m_pCombinedLifeMeter = NULL; m_pCombinedLifeMeter = nullptr;
m_pScoreDisplay = NULL; m_pScoreDisplay = nullptr;
m_pSecondaryScoreDisplay = NULL; m_pSecondaryScoreDisplay = nullptr;
m_pPrimaryScoreKeeper = NULL; m_pPrimaryScoreKeeper = nullptr;
m_pSecondaryScoreKeeper = NULL; m_pSecondaryScoreKeeper = nullptr;
m_pInventory = NULL; m_pInventory = nullptr;
m_pIterNeedsTapJudging = NULL; m_pIterNeedsTapJudging = nullptr;
m_pIterNeedsHoldJudging = NULL; m_pIterNeedsHoldJudging = nullptr;
m_pIterUncrossedRows = NULL; m_pIterUncrossedRows = nullptr;
m_pIterUnjudgedRows = NULL; m_pIterUnjudgedRows = nullptr;
m_pIterUnjudgedMineRows = NULL; m_pIterUnjudgedMineRows = nullptr;
m_bPaused = false; m_bPaused = false;
m_bDelay = false; m_bDelay = false;
m_pAttackDisplay = NULL; m_pAttackDisplay = nullptr;
if( bVisibleParts ) if( bVisibleParts )
{ {
m_pAttackDisplay = new AttackDisplay; m_pAttackDisplay = new AttackDisplay;
@@ -252,7 +252,7 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd)
PlayerAI::InitFromDisk(); PlayerAI::InitFromDisk();
m_pNoteField = NULL; m_pNoteField = nullptr;
if( bVisibleParts ) if( bVisibleParts )
{ {
m_pNoteField = new NoteField; m_pNoteField = new NoteField;
@@ -504,14 +504,14 @@ void Player::Init(
} }
else else
{ {
m_pActorWithComboPosition = NULL; m_pActorWithComboPosition = nullptr;
m_pActorWithJudgmentPosition = NULL; m_pActorWithJudgmentPosition = nullptr;
} }
// Load HoldJudgments // Load HoldJudgments
m_vpHoldJudgment.resize( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer ); m_vpHoldJudgment.resize( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
for( int i = 0; i < GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; ++i ) for( int i = 0; i < GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; ++i )
m_vpHoldJudgment[i] = NULL; m_vpHoldJudgment[i] = nullptr;
if( HasVisibleParts() ) if( HasVisibleParts() )
{ {
@@ -2209,7 +2209,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
const float fSecondsFromExact = fabsf( fNoteOffset ); const float fSecondsFromExact = fabsf( fNoteOffset );
TapNote tnDummy = TAP_ORIGINAL_TAP; TapNote tnDummy = TAP_ORIGINAL_TAP;
TapNote *pTN = NULL; TapNote *pTN = nullptr;
switch( pbt ) switch( pbt )
{ {
DEFAULT_FAIL(pbt); DEFAULT_FAIL(pbt);
+1 -1
View File
@@ -48,7 +48,7 @@ template <class T>
class Preference : public IPreference class Preference : public IPreference
{ {
public: public:
Preference( const RString& sName, const T& defaultValue, void (pfnValidate)(T& val) = NULL ): Preference( const RString& sName, const T& defaultValue, void (pfnValidate)(T& val) = nullptr ):
IPreference( sName ), IPreference( sName ),
m_currentValue( defaultValue ), m_currentValue( defaultValue ),
m_defaultValue( defaultValue ), m_defaultValue( defaultValue ),
+1 -1
View File
@@ -16,7 +16,7 @@
//STATIC_INI_PATH = "Data/Static.ini"; // overlay on the 2 above, can't be overridden //STATIC_INI_PATH = "Data/Static.ini"; // overlay on the 2 above, can't be overridden
//TYPE_TXT_FILE = "Data/Type.txt"; //TYPE_TXT_FILE = "Data/Type.txt";
PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program PrefsManager* PREFSMAN = nullptr; // global and accessable from anywhere in our program
static const char *MusicWheelUsesSectionsNames[] = { static const char *MusicWheelUsesSectionsNames[] = {
"Never", "Never",
+1 -1
View File
@@ -25,7 +25,7 @@
#include "CharacterManager.h" #include "CharacterManager.h"
ProfileManager* PROFILEMAN = NULL; // global and accessable from anywhere in our program ProfileManager* PROFILEMAN = nullptr; // global and accessable from anywhere in our program
static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut )
{ {
+8 -8
View File
@@ -36,9 +36,9 @@ RString GetErrorString( HRESULT hr )
} }
// Globals // Globals
HMODULE g_D3D9_Module = NULL; HMODULE g_D3D9_Module = nullptr;
LPDIRECT3D9 g_pd3d = NULL; LPDIRECT3D9 g_pd3d = nullptr;
LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; LPDIRECT3DDEVICE9 g_pd3dDevice = nullptr;
D3DCAPS9 g_DeviceCaps; D3DCAPS9 g_DeviceCaps;
D3DDISPLAYMODE g_DesktopMode; D3DDISPLAYMODE g_DesktopMode;
D3DPRESENT_PARAMETERS g_d3dpp; D3DPRESENT_PARAMETERS g_d3dpp;
@@ -252,13 +252,13 @@ RageDisplay_D3D::~RageDisplay_D3D()
if( g_pd3dDevice ) if( g_pd3dDevice )
{ {
g_pd3dDevice->Release(); g_pd3dDevice->Release();
g_pd3dDevice = NULL; g_pd3dDevice = nullptr;
} }
if( g_pd3d ) if( g_pd3d )
{ {
g_pd3d->Release(); g_pd3d->Release();
g_pd3d = NULL; g_pd3d = nullptr;
} }
/* Even after we call Release(), D3D may still affect our window. It seems /* Even after we call Release(), D3D may still affect our window. It seems
@@ -267,7 +267,7 @@ RageDisplay_D3D::~RageDisplay_D3D()
if( g_D3D9_Module ) if( g_D3D9_Module )
{ {
FreeLibrary( g_D3D9_Module ); FreeLibrary( g_D3D9_Module );
g_D3D9_Module = NULL; g_D3D9_Module = nullptr;
} }
} }
@@ -621,7 +621,7 @@ bool RageDisplay_D3D::SupportsThreadedRendering()
RageSurface* RageDisplay_D3D::CreateScreenshot() RageSurface* RageDisplay_D3D::CreateScreenshot()
{ {
RageSurface * result = NULL; RageSurface * result = nullptr;
// Get the back buffer. // Get the back buffer.
IDirect3DSurface9* pSurface; IDirect3DSurface9* pSurface;
@@ -702,7 +702,7 @@ void RageDisplay_D3D::SendCurrentMatrices()
g_pd3dDevice->SetTextureStageState( tu, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); g_pd3dDevice->SetTextureStageState( tu, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );
// If no texture is set for this texture unit, don't bother setting it up. // If no texture is set for this texture unit, don't bother setting it up.
IDirect3DBaseTexture9* pTexture = NULL; IDirect3DBaseTexture9* pTexture = nullptr;
g_pd3dDevice->GetTexture( tu, &pTexture ); g_pd3dDevice->GetTexture( tu, &pTexture );
if( pTexture == nullptr ) if( pTexture == nullptr )
continue; continue;
+1 -1
View File
@@ -220,7 +220,7 @@ RageDisplay_GLES2::RageDisplay_GLES2()
FixLittleEndian(); FixLittleEndian();
// RageDisplay_GLES2_Helpers::Init(); // RageDisplay_GLES2_Helpers::Init();
g_pWind = NULL; g_pWind = nullptr;
} }
RString RString
+6 -6
View File
@@ -64,7 +64,7 @@ static const GLenum RageSpriteVertexFormat = GL_T2F_C4F_N3F_V3F;
static GLhandleARB g_bTextureMatrixShader = 0; static GLhandleARB g_bTextureMatrixShader = 0;
static map<unsigned, RenderTarget *> g_mapRenderTargets; static map<unsigned, RenderTarget *> g_mapRenderTargets;
static RenderTarget *g_pCurrentRenderTarget = NULL; static RenderTarget *g_pCurrentRenderTarget = nullptr;
static LowLevelWindow *g_pWind; static LowLevelWindow *g_pWind;
@@ -262,7 +262,7 @@ RageDisplay_Legacy::RageDisplay_Legacy()
FixLittleEndian(); FixLittleEndian();
RageDisplay_Legacy_Helpers::Init(); RageDisplay_Legacy_Helpers::Init();
g_pWind = NULL; g_pWind = nullptr;
g_bTextureMatrixShader = 0; g_bTextureMatrixShader = 0;
} }
@@ -650,8 +650,8 @@ static void CheckPalettedTextures()
/* If 8-bit palettes don't work, disable them entirely--don't trust 4-bit /* If 8-bit palettes don't work, disable them entirely--don't trust 4-bit
* palettes if it can't even get 8-bit ones right. */ * palettes if it can't even get 8-bit ones right. */
glColorTableEXT = NULL; glColorTableEXT = nullptr;
glGetColorTableParameterivEXT = NULL; glGetColorTableParameterivEXT = nullptr;
LOG->Info( "Paletted textures disabled: %s.", sError.c_str() ); LOG->Info( "Paletted textures disabled: %s.", sError.c_str() );
} }
@@ -2252,7 +2252,7 @@ public:
if (bChanged) if (bChanged)
DISPLAY->UpdateTexture( m_iTexHandle, pSurface, 0, 0, pSurface->w, pSurface->h ); DISPLAY->UpdateTexture( m_iTexHandle, pSurface, 0, 0, pSurface->w, pSurface->h );
pSurface->pixels = NULL; pSurface->pixels = nullptr;
m_iTexHandle = 0; m_iTexHandle = 0;
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, 0 ); glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );
@@ -2482,7 +2482,7 @@ void RageDisplay_Legacy::SetRenderTarget( unsigned iTexture, bool bPreserveTextu
if (g_pCurrentRenderTarget) if (g_pCurrentRenderTarget)
g_pCurrentRenderTarget->FinishRenderingTo(); g_pCurrentRenderTarget->FinishRenderingTo();
g_pCurrentRenderTarget = NULL; g_pCurrentRenderTarget = nullptr;
return; return;
} }
+1 -1
View File
@@ -15,7 +15,7 @@ using CrashHandler::DebugBreak;
#endif #endif
static uint64_t g_HandlerThreadID = RageThread::GetInvalidThreadID(); static uint64_t g_HandlerThreadID = RageThread::GetInvalidThreadID();
static void (*g_CleanupHandler)( const RString &sError ) = NULL; static void (*g_CleanupHandler)( const RString &sError ) = nullptr;
void RageException::SetCleanupHandler( void (*pHandler)(const RString &sError) ) void RageException::SetCleanupHandler( void (*pHandler)(const RString &sError) )
{ {
g_HandlerThreadID = RageThread::GetCurrentThreadID(); g_HandlerThreadID = RageThread::GetCurrentThreadID();
+2 -2
View File
@@ -13,7 +13,7 @@
RageFile::RageFile() RageFile::RageFile()
{ {
m_File = NULL; m_File = nullptr;
} }
RageFile::RageFile( const RageFile &cpy ): RageFile::RageFile( const RageFile &cpy ):
@@ -83,7 +83,7 @@ void RageFile::Close()
delete m_File; delete m_File;
if( m_Mode & WRITE ) if( m_Mode & WRITE )
FILEMAN->CacheFile( m_File, m_Path ); FILEMAN->CacheFile( m_File, m_Path );
m_File = NULL; m_File = nullptr;
} }
#define ASSERT_OPEN ASSERT_M( IsOpen(), ssprintf("\"%s\" is not open.", m_Path.c_str()) ); #define ASSERT_OPEN ASSERT_M( IsOpen(), ssprintf("\"%s\" is not open.", m_Path.c_str()) );
+4 -4
View File
@@ -7,8 +7,8 @@ REGISTER_CLASS_TRAITS( RageFileBasic, pCopy->Copy() );
RageFileObj::RageFileObj() RageFileObj::RageFileObj()
{ {
m_pReadBuffer = NULL; m_pReadBuffer = nullptr;
m_pWriteBuffer = NULL; m_pWriteBuffer = nullptr;
ResetReadBuf(); ResetReadBuf();
@@ -35,7 +35,7 @@ RageFileObj::RageFileObj( const RageFileObj &cpy ):
} }
else else
{ {
m_pReadBuffer = NULL; m_pReadBuffer = nullptr;
} }
if( cpy.m_pWriteBuffer != nullptr ) if( cpy.m_pWriteBuffer != nullptr )
@@ -45,7 +45,7 @@ RageFileObj::RageFileObj( const RageFileObj &cpy ):
} }
else else
{ {
m_pWriteBuffer = NULL; m_pWriteBuffer = nullptr;
} }
m_iReadBufAvail = cpy.m_iReadBufAvail; m_iReadBufAvail = cpy.m_iReadBufAvail;
+2 -2
View File
@@ -68,7 +68,7 @@ void RageFileDriver::FlushDirCache( const RString &sPath )
} }
const struct FileDriverEntry *g_pFileDriverList = NULL; const struct FileDriverEntry *g_pFileDriverList = nullptr;
FileDriverEntry::FileDriverEntry( const RString &sType ) FileDriverEntry::FileDriverEntry( const RString &sType )
{ {
@@ -79,7 +79,7 @@ FileDriverEntry::FileDriverEntry( const RString &sType )
FileDriverEntry::~FileDriverEntry() FileDriverEntry::~FileDriverEntry()
{ {
g_pFileDriverList = NULL; /* invalidate */ g_pFileDriverList = nullptr; /* invalidate */
} }
RageFileDriver *MakeFileDriver( const RString &sType, const RString &sRoot ) RageFileDriver *MakeFileDriver( const RString &sType, const RString &sRoot )
+1 -1
View File
@@ -11,7 +11,7 @@ struct RageFileObjMemFile;
class RageFileObjMem: public RageFileObj class RageFileObjMem: public RageFileObj
{ {
public: public:
RageFileObjMem( RageFileObjMemFile *pFile = NULL ); RageFileObjMem( RageFileObjMemFile *pFile = nullptr );
RageFileObjMem( const RageFileObjMem &cpy ); RageFileObjMem( const RageFileObjMem &cpy );
~RageFileObjMem(); ~RageFileObjMem();
+32 -32
View File
@@ -161,10 +161,10 @@ ThreadedFileWorker::ThreadedFileWorker( RString sPath ):
if( m_pChildDriver == nullptr ) if( m_pChildDriver == nullptr )
WARN( ssprintf("ThreadedFileWorker: Mountpoint \"%s\" not found", sPath.c_str()) ); WARN( ssprintf("ThreadedFileWorker: Mountpoint \"%s\" not found", sPath.c_str()) );
m_pResultFile = NULL; m_pResultFile = nullptr;
m_pRequestFile = NULL; m_pRequestFile = nullptr;
m_pResultBuffer = NULL; m_pResultBuffer = nullptr;
m_pRequestBuffer = NULL; m_pRequestBuffer = nullptr;
g_apWorkersMutex.Lock(); g_apWorkersMutex.Lock();
g_apWorkers.push_back( this ); g_apWorkers.push_back( this );
@@ -220,7 +220,7 @@ void ThreadedFileWorker::HandleRequest( int iRequest )
delete m_pRequestFile; delete m_pRequestFile;
/* Clear m_pRequestFile, so RequestTimedOut doesn't double-delete. */ /* Clear m_pRequestFile, so RequestTimedOut doesn't double-delete. */
m_pRequestFile = NULL; m_pRequestFile = nullptr;
break; break;
case REQ_GET_FILE_SIZE: case REQ_GET_FILE_SIZE:
@@ -321,7 +321,7 @@ RageFileBasic *ThreadedFileWorker::Open( const RString &sPath, int iMode, int &i
iErr = m_iResultRequest; iErr = m_iResultRequest;
RageFileBasic *pRet = m_pResultFile; RageFileBasic *pRet = m_pResultFile;
m_pResultFile = NULL; m_pResultFile = nullptr;
return pRet; return pRet;
} }
@@ -340,7 +340,7 @@ void ThreadedFileWorker::Close( RageFileBasic *pFile )
m_pRequestFile = pFile; m_pRequestFile = pFile;
if( !DoRequest(REQ_CLOSE) ) if( !DoRequest(REQ_CLOSE) )
return; return;
m_pRequestFile = NULL; m_pRequestFile = nullptr;
} }
else else
{ {
@@ -359,7 +359,7 @@ int ThreadedFileWorker::GetFileSize( RageFileBasic *&pFile )
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -370,11 +370,11 @@ int ThreadedFileWorker::GetFileSize( RageFileBasic *&pFile )
if( !DoRequest(REQ_GET_FILE_SIZE) ) if( !DoRequest(REQ_GET_FILE_SIZE) )
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
pFile = NULL; pFile = nullptr;
return -1; return -1;
} }
m_pRequestFile = NULL; m_pRequestFile = nullptr;
return m_iResultRequest; return m_iResultRequest;
} }
@@ -387,7 +387,7 @@ int ThreadedFileWorker::GetFD( RageFileBasic *&pFile )
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -398,11 +398,11 @@ int ThreadedFileWorker::GetFD( RageFileBasic *&pFile )
if( !DoRequest(REQ_GET_FD) ) if( !DoRequest(REQ_GET_FD) )
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
pFile = NULL; pFile = nullptr;
return -1; return -1;
} }
m_pRequestFile = NULL; m_pRequestFile = nullptr;
return m_iResultRequest; return m_iResultRequest;
} }
@@ -415,7 +415,7 @@ int ThreadedFileWorker::Seek( RageFileBasic *&pFile, int iPos, RString &sError )
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -431,13 +431,13 @@ int ThreadedFileWorker::Seek( RageFileBasic *&pFile, int iPos, RString &sError )
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
sError = "Operation timed out"; sError = "Operation timed out";
pFile = NULL; pFile = nullptr;
return -1; return -1;
} }
if( m_iResultRequest == -1 ) if( m_iResultRequest == -1 )
sError = m_sResultError; sError = m_sResultError;
m_pRequestFile = NULL; m_pRequestFile = nullptr;
return m_iResultRequest; return m_iResultRequest;
} }
@@ -450,7 +450,7 @@ int ThreadedFileWorker::Read( RageFileBasic *&pFile, void *pBuf, int iSize, RStr
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -467,7 +467,7 @@ int ThreadedFileWorker::Read( RageFileBasic *&pFile, void *pBuf, int iSize, RStr
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
sError = "Operation timed out"; sError = "Operation timed out";
pFile = NULL; pFile = nullptr;
return -1; return -1;
} }
@@ -477,9 +477,9 @@ int ThreadedFileWorker::Read( RageFileBasic *&pFile, void *pBuf, int iSize, RStr
else else
memcpy( pBuf, m_pResultBuffer, iGot ); memcpy( pBuf, m_pResultBuffer, iGot );
m_pRequestFile = NULL; m_pRequestFile = nullptr;
delete [] m_pResultBuffer; delete [] m_pResultBuffer;
m_pResultBuffer = NULL; m_pResultBuffer = nullptr;
return iGot; return iGot;
} }
@@ -492,7 +492,7 @@ int ThreadedFileWorker::Write( RageFileBasic *&pFile, const void *pBuf, int iSiz
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -510,7 +510,7 @@ int ThreadedFileWorker::Write( RageFileBasic *&pFile, const void *pBuf, int iSiz
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
sError = "Operation timed out"; sError = "Operation timed out";
pFile = NULL; pFile = nullptr;
return -1; return -1;
} }
@@ -518,9 +518,9 @@ int ThreadedFileWorker::Write( RageFileBasic *&pFile, const void *pBuf, int iSiz
if( m_iResultRequest == -1 ) if( m_iResultRequest == -1 )
sError = m_sResultError; sError = m_sResultError;
m_pRequestFile = NULL; m_pRequestFile = nullptr;
delete [] m_pRequestBuffer; delete [] m_pRequestBuffer;
m_pRequestBuffer = NULL; m_pRequestBuffer = nullptr;
return iGot; return iGot;
} }
@@ -533,7 +533,7 @@ int ThreadedFileWorker::Flush( RageFileBasic *&pFile, RString &sError )
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -548,14 +548,14 @@ int ThreadedFileWorker::Flush( RageFileBasic *&pFile, RString &sError )
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
sError = "Operation timed out"; sError = "Operation timed out";
pFile = NULL; pFile = nullptr;
return -1; return -1;
} }
if( m_iResultRequest == -1 ) if( m_iResultRequest == -1 )
sError = m_sResultError; sError = m_sResultError;
m_pRequestFile = NULL; m_pRequestFile = nullptr;
return m_iResultRequest; return m_iResultRequest;
} }
@@ -568,7 +568,7 @@ RageFileBasic *ThreadedFileWorker::Copy( RageFileBasic *&pFile, RString &sError
if( IsTimedOut() ) if( IsTimedOut() )
{ {
this->Close( pFile ); this->Close( pFile );
pFile = NULL; pFile = nullptr;
} }
if( pFile == nullptr ) if( pFile == nullptr )
@@ -582,13 +582,13 @@ RageFileBasic *ThreadedFileWorker::Copy( RageFileBasic *&pFile, RString &sError
{ {
/* If we time out, we can no longer access pFile. */ /* If we time out, we can no longer access pFile. */
sError = "Operation timed out"; sError = "Operation timed out";
pFile = NULL; pFile = nullptr;
return nullptr; return nullptr;
} }
RageFileBasic *pRet = m_pResultFile; RageFileBasic *pRet = m_pResultFile;
m_pRequestFile = NULL; m_pRequestFile = nullptr;
m_pResultFile = NULL; m_pResultFile = nullptr;
return pRet; return pRet;
} }
@@ -848,7 +848,7 @@ public:
TimedFilenameDB() TimedFilenameDB()
{ {
ExpireSeconds = -1; ExpireSeconds = -1;
m_pWorker = NULL; m_pWorker = nullptr;
} }
void SetWorker( ThreadedFileWorker *pWorker ) void SetWorker( ThreadedFileWorker *pWorker )
+2 -2
View File
@@ -24,7 +24,7 @@ RageFileDriverZip::RageFileDriverZip():
m_Mutex( "RageFileDriverZip" ) m_Mutex( "RageFileDriverZip" )
{ {
m_bFileOwned = false; m_bFileOwned = false;
m_pZip = NULL; m_pZip = nullptr;
} }
RageFileDriverZip::RageFileDriverZip( const RString &sPath ): RageFileDriverZip::RageFileDriverZip( const RString &sPath ):
@@ -32,7 +32,7 @@ RageFileDriverZip::RageFileDriverZip( const RString &sPath ):
m_Mutex( "RageFileDriverZip" ) m_Mutex( "RageFileDriverZip" )
{ {
m_bFileOwned = false; m_bFileOwned = false;
m_pZip = NULL; m_pZip = nullptr;
Load( sPath ); Load( sPath );
} }
+6 -6
View File
@@ -18,7 +18,7 @@
#include <paths.h> #include <paths.h>
#endif #endif
RageFileManager *FILEMAN = NULL; RageFileManager *FILEMAN = nullptr;
/* Lock this before touching any of these globals (except FILEMAN itself). */ /* Lock this before touching any of these globals (except FILEMAN itself). */
static RageEvent *g_Mutex; static RageEvent *g_Mutex;
@@ -38,7 +38,7 @@ struct LoadedDriver
int m_iRefs; int m_iRefs;
LoadedDriver() { m_pDriver = NULL; m_iRefs = 0; } LoadedDriver() { m_pDriver = nullptr; m_iRefs = 0; }
RString GetPath( const RString &sPath ) const; RString GetPath( const RString &sPath ) const;
}; };
@@ -73,7 +73,7 @@ RageFileDriver *RageFileManager::GetFileDriver( RString sMountpoint )
sMountpoint += '/'; sMountpoint += '/';
g_Mutex->Lock(); g_Mutex->Lock();
RageFileDriver *pRet = NULL; RageFileDriver *pRet = nullptr;
for( unsigned i = 0; i < g_pDrivers.size(); ++i ) for( unsigned i = 0; i < g_pDrivers.size(); ++i )
{ {
if( g_pDrivers[i]->m_sType == "mountpoints" ) if( g_pDrivers[i]->m_sType == "mountpoints" )
@@ -170,7 +170,7 @@ public:
FDB->AddFile( apDrivers[i]->m_sMountPoint, 0, 0 ); FDB->AddFile( apDrivers[i]->m_sMountPoint, 0, 0 );
} }
}; };
static RageFileDriverMountpoints *g_Mountpoints = NULL; static RageFileDriverMountpoints *g_Mountpoints = nullptr;
static RString GetDirOfExecutable( RString argv0 ) static RString GetDirOfExecutable( RString argv0 )
{ {
@@ -311,10 +311,10 @@ RageFileManager::~RageFileManager()
g_pDrivers.clear(); g_pDrivers.clear();
// delete g_Mountpoints; // g_Mountpoints was in g_pDrivers // delete g_Mountpoints; // g_Mountpoints was in g_pDrivers
g_Mountpoints = NULL; g_Mountpoints = nullptr;
delete g_Mutex; delete g_Mutex;
g_Mutex = NULL; g_Mutex = nullptr;
} }
/* path must be normalized (FixSlashesInPlace, CollapsePath). */ /* path must be normalized (FixSlashesInPlace, CollapsePath). */
+1 -1
View File
@@ -7,7 +7,7 @@
#include "LuaManager.h" #include "LuaManager.h"
#include "LocalizedString.h" #include "LocalizedString.h"
RageInput* INPUTMAN = NULL; // globally accessable input device RageInput* INPUTMAN = nullptr; // globally accessable input device
static Preference<RString> g_sInputDrivers( "InputDrivers", "" ); // "" == DEFAULT_INPUT_DRIVER_LIST static Preference<RString> g_sInputDrivers( "InputDrivers", "" ); // "" == DEFAULT_INPUT_DRIVER_LIST
+5 -5
View File
@@ -48,7 +48,7 @@ RageSoundLoadParams::RageSoundLoadParams():
m_bSupportRateChanging(false), m_bSupportPan(false) {} m_bSupportRateChanging(false), m_bSupportPan(false) {}
RageSound::RageSound(): RageSound::RageSound():
m_Mutex( "RageSound" ), m_pSource(NULL), m_Mutex( "RageSound" ), m_pSource(nullptr),
m_sFilePath(""), m_Param(), m_iStreamFrame(0), m_sFilePath(""), m_Param(), m_iStreamFrame(0),
m_iStoppedSourceFrame(0), m_bPlaying(false), m_iStoppedSourceFrame(0), m_bPlaying(false),
m_bDeleteWhenFinished(false), m_sError("") m_bDeleteWhenFinished(false), m_sError("")
@@ -67,7 +67,7 @@ RageSound::RageSound( const RageSound &cpy ):
{ {
ASSERT(SOUNDMAN != nullptr); ASSERT(SOUNDMAN != nullptr);
m_pSource = NULL; m_pSource = nullptr;
*this = cpy; *this = cpy;
} }
@@ -90,7 +90,7 @@ RageSound &RageSound::operator=( const RageSound &cpy )
if( cpy.m_pSource ) if( cpy.m_pSource )
m_pSource = cpy.m_pSource->Copy(); m_pSource = cpy.m_pSource->Copy();
else else
m_pSource = NULL; m_pSource = nullptr;
m_sFilePath = cpy.m_sFilePath; m_sFilePath = cpy.m_sFilePath;
@@ -105,7 +105,7 @@ void RageSound::Unload()
LockMut(m_Mutex); LockMut(m_Mutex);
delete m_pSource; delete m_pSource;
m_pSource = NULL; m_pSource = nullptr;
m_sFilePath = ""; m_sFilePath = "";
} }
@@ -364,7 +364,7 @@ void RageSound::SoundIsFinishedPlaying()
return; return;
/* Get our current hardware position. */ /* Get our current hardware position. */
int64_t iCurrentHardwareFrame = SOUNDMAN->GetPosition( NULL ); int64_t iCurrentHardwareFrame = SOUNDMAN->GetPosition(nullptr);
m_Mutex.Lock(); m_Mutex.Lock();
+3 -3
View File
@@ -98,7 +98,7 @@ public:
* they can be ignored most of the time, so we continue to work if a file * they can be ignored most of the time, so we continue to work if a file
* is broken or missing. * is broken or missing.
*/ */
bool Load( RString sFile, bool bPrecache, const RageSoundLoadParams *pParams = NULL ); bool Load( RString sFile, bool bPrecache, const RageSoundLoadParams *pParams = nullptr );
/* Using this version means the "don't care" about caching. Currently, /* Using this version means the "don't care" about caching. Currently,
* this always will not cache the sound; this may become a preference. */ * this always will not cache the sound; this may become a preference. */
@@ -121,7 +121,7 @@ public:
RString GetError() const { return m_sError; } RString GetError() const { return m_sError; }
void Play( const RageSoundParams *params=NULL ); void Play( const RageSoundParams *params=NULL );
void PlayCopy( const RageSoundParams *pParams = NULL ) const; void PlayCopy( const RageSoundParams *pParams = nullptr ) const;
void Stop(); void Stop();
/* Cleanly pause or unpause the sound. If the sound wasn't already playing, /* Cleanly pause or unpause the sound. If the sound wasn't already playing,
@@ -173,7 +173,7 @@ private:
RString m_sError; RString m_sError;
int GetSourceFrameFromHardwareFrame( int64_t iHardwareFrame, bool *bApproximate = NULL ) const; int GetSourceFrameFromHardwareFrame( int64_t iHardwareFrame, bool *bApproximate = nullptr ) const;
bool SetPositionFrames( int frames = -1 ); bool SetPositionFrames( int frames = -1 );
RageSoundParams::StopMode_t GetStopMode() const; // resolves M_AUTO RageSoundParams::StopMode_t GetStopMode() const; // resolves M_AUTO
+2 -2
View File
@@ -33,9 +33,9 @@
static RageMutex g_SoundManMutex("SoundMan"); static RageMutex g_SoundManMutex("SoundMan");
static Preference<RString> g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAULT_SOUND_DRIVER_LIST static Preference<RString> g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAULT_SOUND_DRIVER_LIST
RageSoundManager *SOUNDMAN = NULL; RageSoundManager *SOUNDMAN = nullptr;
RageSoundManager::RageSoundManager(): m_pDriver(NULL), m_fMixVolume(1.0f), RageSoundManager::RageSoundManager(): m_pDriver(nullptr), m_fMixVolume(1.0f),
m_fVolumeOfNonCriticalSounds(1.0f) {} m_fVolumeOfNonCriticalSounds(1.0f) {}
static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" );
+1 -1
View File
@@ -12,7 +12,7 @@ static bool g_bVector = Vector::CheckForVector();
RageSoundMixBuffer::RageSoundMixBuffer() RageSoundMixBuffer::RageSoundMixBuffer()
{ {
m_iBufSize = m_iBufUsed = 0; m_iBufSize = m_iBufUsed = 0;
m_pMixbuf = NULL; m_pMixbuf = nullptr;
m_iOffset = 0; m_iOffset = 0;
} }
+1 -1
View File
@@ -40,7 +40,7 @@ public:
virtual float GetStreamToSourceRatio() const = 0; virtual float GetStreamToSourceRatio() const = 0;
virtual RString GetError() const = 0; virtual RString GetError() const = 0;
int RetriedRead( float *pBuffer, int iFrames, int *iSourceFrame = NULL, float *fRate = NULL ); int RetriedRead( float *pBuffer, int iFrames, int *iSourceFrame = nullptr, float *fRate = nullptr );
}; };
#endif #endif
+3 -3
View File
@@ -55,7 +55,7 @@ void RageSoundReader_Chain::AddSound( int iIndex, float fOffsetSecs, float fPan
s.iIndex = iIndex; s.iIndex = iIndex;
s.iOffsetMS = lrintf( fOffsetSecs * 1000 ); s.iOffsetMS = lrintf( fOffsetSecs * 1000 );
s.fPan = fPan; s.fPan = fPan;
s.pSound = NULL; s.pSound = nullptr;
m_aSounds.push_back( s ); m_aSounds.push_back( s );
} }
@@ -130,7 +130,7 @@ void RageSoundReader_Chain::Finish()
LOG->Warn( "Discarded sound with %i channels, not %i", LOG->Warn( "Discarded sound with %i channels, not %i",
it->GetNumChannels(), m_iChannels ); it->GetNumChannels(), m_iChannels );
delete it; delete it;
it = NULL; it = nullptr;
} }
} }
} }
@@ -240,7 +240,7 @@ void RageSoundReader_Chain::ReleaseSound( Sound *s )
RageSoundReader *&pSound = s->pSound; RageSoundReader *&pSound = s->pSound;
delete pSound; delete pSound;
pSound = NULL; pSound = nullptr;
m_apActiveSounds.erase( it ); m_apActiveSounds.erase( it );
} }
+2 -2
View File
@@ -18,7 +18,7 @@
RageSoundReader_FileReader *RageSoundReader_FileReader::TryOpenFile( RageFileBasic *pFile, RString &error, RString format, bool &bKeepTrying ) RageSoundReader_FileReader *RageSoundReader_FileReader::TryOpenFile( RageFileBasic *pFile, RString &error, RString format, bool &bKeepTrying )
{ {
RageSoundReader_FileReader *Sample = NULL; RageSoundReader_FileReader *Sample = nullptr;
#ifndef NO_WAV_SUPPORT #ifndef NO_WAV_SUPPORT
if( !format.CompareNoCase("wav") ) if( !format.CompareNoCase("wav") )
@@ -38,7 +38,7 @@ RageSoundReader_FileReader *RageSoundReader_FileReader::TryOpenFile( RageFileBas
return nullptr; return nullptr;
OpenResult ret = Sample->Open( pFile ); OpenResult ret = Sample->Open( pFile );
pFile = NULL; // Sample owns it now pFile = nullptr; // Sample owns it now
if( ret == OPEN_OK ) if( ret == OPEN_OK )
return Sample; return Sample;
+1 -1
View File
@@ -34,7 +34,7 @@ public:
/* Open a file. If pPrebuffer is non-NULL, and the file is sufficiently small, /* Open a file. If pPrebuffer is non-NULL, and the file is sufficiently small,
* the (possibly compressed) data will be loaded entirely into memory, and pPrebuffer * the (possibly compressed) data will be loaded entirely into memory, and pPrebuffer
* will be set to true. */ * will be set to true. */
static RageSoundReader_FileReader *OpenFile( RString filename, RString &error, bool *pPrebuffer = NULL ); static RageSoundReader_FileReader *OpenFile( RString filename, RString &error, bool *pPrebuffer = nullptr );
protected: protected:
void SetError( RString sError ) const { m_sError = sError; } void SetError( RString sError ) const { m_sError = sError; }
+1 -1
View File
@@ -754,7 +754,7 @@ bool RageSoundReader_MP3::MADLIB_rewind()
* set it, then we'll be desynced by a frame after an accurate seek. */ * set it, then we'll be desynced by a frame after an accurate seek. */
// mad->header_bytes = 0; // mad->header_bytes = 0;
mad->first_frame = true; mad->first_frame = true;
mad->Stream.this_frame = NULL; mad->Stream.this_frame = nullptr;
return true; return true;
} }
+1 -1
View File
@@ -99,7 +99,7 @@ void RageSoundReader_Merge::Finish( int iPreferredSampleRate )
LOG->Warn( "Discarded sound with %i channels, not %i", LOG->Warn( "Discarded sound with %i channels, not %i",
it->GetNumChannels(), m_iChannels ); it->GetNumChannels(), m_iChannels );
delete it; delete it;
it = NULL; it = nullptr;
} }
else else
{ {
+1 -1
View File
@@ -15,7 +15,7 @@
#include "RageLog.h" #include "RageLog.h"
RageSoundReader_PitchChange::RageSoundReader_PitchChange( RageSoundReader *pSource ): RageSoundReader_PitchChange::RageSoundReader_PitchChange( RageSoundReader *pSource ):
RageSoundReader_Filter( NULL ) RageSoundReader_Filter(nullptr)
{ {
m_pSpeedChange = new RageSoundReader_SpeedChange( pSource ); m_pSpeedChange = new RageSoundReader_SpeedChange( pSource );
m_pResample = new RageSoundReader_Resample_Good( m_pSpeedChange, m_pSpeedChange->GetSampleRate() ); m_pResample = new RageSoundReader_Resample_Good( m_pSpeedChange, m_pSpeedChange->GetSampleRate() );

Some files were not shown because too many files have changed in this diff Show More