The big NULL replacement party part 6.
...and ', NULL' had even more to replace.
This commit is contained in:
+1
-1
@@ -467,7 +467,7 @@ namespace
|
||||
LIST_METHOD( LoadAllCommands ),
|
||||
LIST_METHOD( LoadAllCommandsFromName ),
|
||||
LIST_METHOD( LoadAllCommandsAndSetXY ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ static const char *aliases[][2] = {
|
||||
{ "gameplay combo 900", "gameplay 900 combo" },
|
||||
{ "gameplay combo 1000", "gameplay 1000 combo" },
|
||||
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
|
||||
/* Find an announcer directory with sounds in it. First search sFolderName,
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ RString Course::GetTranslitFullTitle() const
|
||||
/* This is called by many simple functions, like Course::GetTotalSeconds, and may
|
||||
* be called on all songs to sort. It can take time to execute, so we cache the
|
||||
* results. Returned pointers remain valid for the lifetime of the Course. If the
|
||||
* course difficulty doesn't exist, NULL is returned. */
|
||||
* course difficulty doesn't exist, nullptr is returned. */
|
||||
Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
|
||||
{
|
||||
ASSERT( cd != Difficulty_Invalid );
|
||||
|
||||
+1
-1
@@ -975,7 +975,7 @@ ZRESULT TZip::AddCentral()
|
||||
ulg center_size = writ - pos_at_start_of_central;
|
||||
if (okay)
|
||||
{
|
||||
int res = putend(numentries, center_size, pos_at_start_of_central+ooffset, 0, NULL, swrite,this);
|
||||
int res = putend(numentries, center_size, pos_at_start_of_central+ooffset, 0, nullptr, swrite,this);
|
||||
if (res!=ZE_OK)
|
||||
okay=false;
|
||||
writ += 4 + ENDHEAD + 0;
|
||||
|
||||
@@ -6,7 +6,7 @@ PRNGWrapper::PRNGWrapper( const struct ltc_prng_descriptor *pPRNGDescriptor )
|
||||
m_iPRNG = register_prng( pPRNGDescriptor );
|
||||
ASSERT( m_iPRNG >= 0 );
|
||||
|
||||
int iRet = rng_make_prng( 128, m_iPRNG, &m_PRNG, NULL );
|
||||
int iRet = rng_make_prng( 128, m_iPRNG, &m_PRNG, nullptr );
|
||||
ASSERT_M( iRet == CRYPT_OK, error_to_string(iRet) );
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void PRNGWrapper::AddEntropy( const void *pData, int iSize )
|
||||
void PRNGWrapper::AddRandomEntropy()
|
||||
{
|
||||
unsigned char buf[256];
|
||||
int iRet = rng_get_bytes( buf, sizeof(buf), NULL );
|
||||
int iRet = rng_get_bytes( buf, sizeof(buf), nullptr );
|
||||
ASSERT( iRet == sizeof(buf) );
|
||||
|
||||
AddEntropy( buf, sizeof(buf) );
|
||||
|
||||
@@ -72,7 +72,7 @@ void StepsDisplayList::LoadFromNode( const XNode* pNode )
|
||||
{
|
||||
// todo: Use Row1, Row2 for names? also m_sName+"Row" -aj
|
||||
m_Lines[m].m_Meter.SetName( "Row" );
|
||||
m_Lines[m].m_Meter.Load( "StepsDisplayListRow", NULL );
|
||||
m_Lines[m].m_Meter.Load( "StepsDisplayListRow", nullptr );
|
||||
this->AddChild( &m_Lines[m].m_Meter );
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -165,12 +165,12 @@ void EditMenu::Load( const RString &sType )
|
||||
this->AddChild( &m_SongTextBanner );
|
||||
|
||||
m_StepsDisplay.SetName( "StepsDisplay" );
|
||||
m_StepsDisplay.Load( "StepsDisplayEdit", NULL );
|
||||
m_StepsDisplay.Load( "StepsDisplayEdit", nullptr );
|
||||
ActorUtil::SetXY( m_StepsDisplay, sType );
|
||||
this->AddChild( &m_StepsDisplay );
|
||||
|
||||
m_StepsDisplaySource.SetName( "StepsDisplaySource" );
|
||||
m_StepsDisplaySource.Load( "StepsDisplayEdit", NULL );
|
||||
m_StepsDisplaySource.Load( "StepsDisplayEdit", nullptr );
|
||||
ActorUtil::SetXY( m_StepsDisplaySource, sType );
|
||||
this->AddChild( &m_StepsDisplaySource );
|
||||
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ namespace
|
||||
static const luaL_Reg EnumLib[] = {
|
||||
{ "GetName", GetName },
|
||||
{ "Reverse", Reverse },
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
|
||||
static void PushEnumMethodTable( lua_State *L )
|
||||
|
||||
+645
-645
File diff suppressed because it is too large
Load Diff
@@ -839,7 +839,7 @@ public:
|
||||
fadeOut = FArg(5);
|
||||
}
|
||||
}
|
||||
p->PlayMusic(musicPath, NULL, false, musicStart, musicLength,
|
||||
p->PlayMusic(musicPath, nullptr, false, musicStart, musicLength,
|
||||
fadeIn, fadeOut);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ void GrooveRadar::LoadFromNode( const XNode* pNode )
|
||||
|
||||
void GrooveRadar::SetEmpty( PlayerNumber pn )
|
||||
{
|
||||
SetFromSteps( pn, NULL );
|
||||
SetFromSteps( pn, nullptr );
|
||||
}
|
||||
|
||||
void GrooveRadar::SetFromRadarValues( PlayerNumber pn, const RadarValues &rv )
|
||||
|
||||
+1
-1
@@ -1076,7 +1076,7 @@ namespace
|
||||
LIST_METHOD( ReadFile ),
|
||||
LIST_METHOD( RunWithThreadVariables ),
|
||||
LIST_METHOD( GetThreadVariable ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -502,7 +502,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
split( MODE_MENU_CHOICE_NAMES, ",", vsNames );
|
||||
for( unsigned i=0; i<vsNames.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData wid( WheelItemDataType_Sort, NULL, "", NULL, SORT_MENU_COLOR, 0 );
|
||||
MusicWheelItemData wid( WheelItemDataType_Sort, nullptr, "", nullptr, SORT_MENU_COLOR, 0 );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( new GameCommand );
|
||||
wid.m_pAction->m_sName = vsNames[i];
|
||||
wid.m_pAction->Load( i, ParseCommands(CHOICE.GetValue(vsNames[i])) );
|
||||
@@ -676,18 +676,18 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
// In certain situations (e.g. simulating Pump it Up), themes may
|
||||
// want to only show one group at a time.
|
||||
if( !HIDE_INACTIVE_SECTIONS )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, colorSection, iSectionCount) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, nullptr, sThisSection, nullptr, colorSection, iSectionCount) );
|
||||
sLastSection = sThisSection;
|
||||
}
|
||||
}
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, NULL, SONGMAN->GetSongColor(pSong), 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, nullptr, SONGMAN->GetSongColor(pSong), 0) );
|
||||
}
|
||||
|
||||
if( so != SORT_ROULETTE )
|
||||
{
|
||||
// todo: allow themers to change the order of the items. -aj
|
||||
if( SHOW_ROULETTE )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Roulette, NULL, "", NULL, ROULETTE_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Roulette, nullptr, "", nullptr, ROULETTE_COLOR, 0) );
|
||||
|
||||
// Only add WheelItemDataType_Random and WheelItemDataType_Portal if there's at least
|
||||
// one song on the list.
|
||||
@@ -697,17 +697,17 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
bFoundAnySong = true;
|
||||
|
||||
if( SHOW_RANDOM && bFoundAnySong )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Random, NULL, "", NULL, RANDOM_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Random, nullptr, "", nullptr, RANDOM_COLOR, 0) );
|
||||
|
||||
if( SHOW_PORTAL && bFoundAnySong )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Portal, NULL, "", NULL, PORTAL_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Portal, nullptr, "", nullptr, PORTAL_COLOR, 0) );
|
||||
|
||||
// add custom wheel items
|
||||
vector<RString> vsNames;
|
||||
split( CUSTOM_WHEEL_ITEM_NAMES, ",", vsNames );
|
||||
for( unsigned i=0; i<vsNames.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData wid( WheelItemDataType_Custom, NULL, "", NULL, CUSTOM_CHOICE_COLORS.GetValue(vsNames[i]), 0 );
|
||||
MusicWheelItemData wid( WheelItemDataType_Custom, nullptr, "", nullptr, CUSTOM_CHOICE_COLORS.GetValue(vsNames[i]), 0 );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( new GameCommand );
|
||||
wid.m_pAction->m_sName = vsNames[i];
|
||||
wid.m_pAction->Load( i, ParseCommands(CUSTOM_CHOICES.GetValue(vsNames[i])) );
|
||||
@@ -833,12 +833,12 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
{
|
||||
RageColor c = SECTION_COLORS.GetValue(iSectionColorIndex);
|
||||
iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS;
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, c, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, nullptr, sThisSection, nullptr, c, 0) );
|
||||
sLastSection = sThisSection;
|
||||
}
|
||||
|
||||
RageColor c = ( pCourse->m_sGroupName.size() == 0 ) ? pCourse->GetColor() : SONGMAN->GetCourseColor(pCourse);
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Course, NULL, sThisSection, pCourse, c, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Course, nullptr, sThisSection, pCourse, c, 0) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
|
||||
// If we've filtered all items, insert a dummy.
|
||||
if( aFilteredData.empty() )
|
||||
aFilteredData.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, EMPTY_STRING, NULL, EMPTY_COLOR, 0) );
|
||||
aFilteredData.push_back( new MusicWheelItemData(WheelItemDataType_Section, nullptr, EMPTY_STRING, nullptr, EMPTY_COLOR, 0) );
|
||||
}
|
||||
|
||||
void MusicWheel::UpdateSwitch()
|
||||
|
||||
@@ -933,7 +933,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
if( 0 == stricmp(sFieldName,"X-SM-Build") )
|
||||
{
|
||||
bSuccess = true;
|
||||
uCurrentSMBuild = strtoul( sFieldValue, NULL, 10 );
|
||||
uCurrentSMBuild = strtoul( sFieldValue, nullptr, 10 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ static NoteResource *MakeNoteResource( const RString &sButton, const RString &sE
|
||||
{
|
||||
NoteResource *pRes = new NoteResource( nsap );
|
||||
|
||||
pRes->m_pActor = NOTESKIN->LoadActor( sButton, sElement, NULL, bSpriteOnly );
|
||||
pRes->m_pActor = NOTESKIN->LoadActor( sButton, sElement, nullptr, bSpriteOnly );
|
||||
ASSERT( pRes->m_pActor != nullptr );
|
||||
|
||||
g_NoteResource[nsap] = pRes;
|
||||
|
||||
@@ -328,7 +328,7 @@ int BMSSong::AllocateKeysound( RString filename, RString path )
|
||||
|
||||
if( !IsAFile(dir + normalizedFilename) )
|
||||
{
|
||||
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
|
||||
const char *exts[] = { "oga", "ogg", "wav", "mp3", nullptr }; // XXX: stop duplicating these everywhere
|
||||
for( unsigned i = 0; exts[i] != nullptr; ++i )
|
||||
{
|
||||
RString fn = SetExtension( normalizedFilename, exts[i] );
|
||||
@@ -393,7 +393,7 @@ bool BMSSong::GetBackground( RString filename, RString path, RString &bgfile )
|
||||
|
||||
if( !IsAFile(dir + normalizedFilename) )
|
||||
{
|
||||
const char *exts[] = { "ogv", "avi", "mpg", "mpeg", "bmp", "png", "jpeg", NULL }; // XXX: stop duplicating these everywhere
|
||||
const char *exts[] = { "ogv", "avi", "mpg", "mpeg", "bmp", "png", "jpeg", nullptr }; // XXX: stop duplicating these everywhere
|
||||
for( unsigned i = 0; exts[i] != nullptr; ++i )
|
||||
{
|
||||
RString fn = SetExtension( normalizedFilename, exts[i] );
|
||||
@@ -424,7 +424,7 @@ void BMSSong::PrecacheBackgrounds(const RString &dir)
|
||||
backgroundsPrecached = true;
|
||||
vector<RString> arrayPossibleFiles;
|
||||
|
||||
const char *exts[] = { "ogv", "avi", "mpg", "mpeg", "bmp", "png", "jpeg", NULL }; // XXX: stop duplicating these everywhere
|
||||
const char *exts[] = { "ogv", "avi", "mpg", "mpeg", "bmp", "png", "jpeg", nullptr }; // XXX: stop duplicating these everywhere
|
||||
|
||||
for( unsigned i = 0; exts[i] != nullptr; ++i )
|
||||
{
|
||||
|
||||
@@ -169,11 +169,11 @@ void SMLoader::ProcessAttacks( AttackArray &attacks, MsdFile::value_t params )
|
||||
Trim( sBits[0] );
|
||||
|
||||
if( !sBits[0].CompareNoCase("TIME") )
|
||||
attack.fStartSecond = strtof( sBits[1], NULL );
|
||||
attack.fStartSecond = strtof( sBits[1], nullptr );
|
||||
else if( !sBits[0].CompareNoCase("LEN") )
|
||||
attack.fSecsRemaining = strtof( sBits[1], NULL );
|
||||
attack.fSecsRemaining = strtof( sBits[1], nullptr );
|
||||
else if( !sBits[0].CompareNoCase("END") )
|
||||
end = strtof( sBits[1], NULL );
|
||||
end = strtof( sBits[1], nullptr );
|
||||
else if( !sBits[0].CompareNoCase("MODS") )
|
||||
{
|
||||
Trim(sBits[1]);
|
||||
|
||||
@@ -573,7 +573,7 @@ bool RageDisplay_D3D::BeginFrame()
|
||||
}
|
||||
}
|
||||
|
||||
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,
|
||||
g_pd3dDevice->Clear( 0, nullptr, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,
|
||||
D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 );
|
||||
g_pd3dDevice->BeginScene();
|
||||
|
||||
@@ -633,9 +633,9 @@ RageSurface* RageDisplay_D3D::CreateScreenshot()
|
||||
|
||||
// Copy the back buffer into a surface of a type we support.
|
||||
IDirect3DSurface9* pCopy;
|
||||
if( SUCCEEDED( g_pd3dDevice->CreateOffscreenPlainSurface( desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pCopy, NULL ) ) )
|
||||
if( SUCCEEDED( g_pd3dDevice->CreateOffscreenPlainSurface( desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pCopy, nullptr ) ) )
|
||||
{
|
||||
if( SUCCEEDED( D3DXLoadSurfaceFromSurface( pCopy, NULL, NULL, pSurface, NULL, NULL, D3DX_FILTER_NONE, 0) ) )
|
||||
if( SUCCEEDED( D3DXLoadSurfaceFromSurface( pCopy, nullptr, nullptr, pSurface, nullptr, nullptr, D3DX_FILTER_NONE, 0) ) )
|
||||
{
|
||||
// Update desc from the copy.
|
||||
pCopy->GetDesc( &desc );
|
||||
@@ -1029,7 +1029,7 @@ void RageDisplay_D3D::SetTexture( TextureUnit tu, unsigned iTexture )
|
||||
|
||||
if( iTexture == 0 )
|
||||
{
|
||||
g_pd3dDevice->SetTexture( tu, NULL );
|
||||
g_pd3dDevice->SetTexture( tu, nullptr );
|
||||
|
||||
/* Intentionally commented out. Don't mess with texture stage state
|
||||
* when just setting the texture. Model sets its texture modes before
|
||||
@@ -1215,7 +1215,7 @@ void RageDisplay_D3D::SetZTestMode( ZTestMode mode )
|
||||
|
||||
void RageDisplay_D3D::ClearZBuffer()
|
||||
{
|
||||
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 );
|
||||
g_pd3dDevice->Clear( 0, nullptr, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 );
|
||||
}
|
||||
|
||||
void RageDisplay_D3D::SetTextureWrapping( TextureUnit tu, bool b )
|
||||
@@ -1346,7 +1346,7 @@ unsigned RageDisplay_D3D::CreateTexture(
|
||||
{
|
||||
HRESULT hr;
|
||||
IDirect3DTexture9* pTex;
|
||||
hr = g_pd3dDevice->CreateTexture( power_of_two(img->w), power_of_two(img->h), 1, 0, D3DFORMATS[pixfmt], D3DPOOL_MANAGED, &pTex, NULL );
|
||||
hr = g_pd3dDevice->CreateTexture( power_of_two(img->w), power_of_two(img->h), 1, 0, D3DFORMATS[pixfmt], D3DPOOL_MANAGED, &pTex, nullptr );
|
||||
|
||||
if( FAILED(hr) )
|
||||
RageException::Throw( "CreateTexture(%i,%i,%s) failed: %s",
|
||||
|
||||
@@ -598,7 +598,7 @@ static void CheckPalettedTextures()
|
||||
glTexImage2D( GL_PROXY_TEXTURE_2D,
|
||||
0, glTexFormat,
|
||||
16, 16, 0,
|
||||
glImageFormat, glImageType, NULL );
|
||||
glImageFormat, glImageType, nullptr );
|
||||
GL_CHECK_ERROR( "glTexImage2D" );
|
||||
|
||||
GLuint iFormat = 0;
|
||||
@@ -662,7 +662,7 @@ static void CheckReversePackedPixels()
|
||||
glTexImage2D( GL_PROXY_TEXTURE_2D,
|
||||
0, GL_RGBA,
|
||||
16, 16, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL );
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, nullptr );
|
||||
|
||||
const GLenum glError = glGetError();
|
||||
if (glError == GL_NO_ERROR)
|
||||
@@ -1272,7 +1272,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
DebugAssertNoGLError();
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nPositions );
|
||||
DebugAssertNoGLError();
|
||||
glVertexPointer(3, GL_FLOAT, 0, NULL );
|
||||
glVertexPointer(3, GL_FLOAT, 0, nullptr );
|
||||
DebugAssertNoGLError();
|
||||
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
@@ -1282,7 +1282,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
DebugAssertNoGLError();
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nTextureCoords );
|
||||
DebugAssertNoGLError();
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, NULL);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, nullptr);
|
||||
DebugAssertNoGLError();
|
||||
|
||||
// TRICKY: Don't bind and send normals if lighting is disabled. This
|
||||
@@ -1301,7 +1301,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
DebugAssertNoGLError();
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nNormals );
|
||||
DebugAssertNoGLError();
|
||||
glNormalPointer(GL_FLOAT, 0, NULL);
|
||||
glNormalPointer(GL_FLOAT, 0, nullptr);
|
||||
DebugAssertNoGLError();
|
||||
}
|
||||
else
|
||||
@@ -1321,7 +1321,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
DebugAssertNoGLError();
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nTextureMatrixScale );
|
||||
DebugAssertNoGLError();
|
||||
glVertexAttribPointerARB( g_iAttribTextureMatrixScale, 2, GL_FLOAT, false, 0, NULL );
|
||||
glVertexAttribPointerARB( g_iAttribTextureMatrixScale, 2, GL_FLOAT, false, 0, nullptr );
|
||||
DebugAssertNoGLError();
|
||||
|
||||
glUseProgramObjectARB( g_bTextureMatrixShader );
|
||||
@@ -2174,7 +2174,7 @@ unsigned RageDisplay_Legacy::CreateTexture(
|
||||
glTexImage2D(
|
||||
GL_TEXTURE_2D, 0, glTexFormat,
|
||||
power_of_two(pImg->w), power_of_two(pImg->h), 0,
|
||||
glImageFormat, glImageType, NULL );
|
||||
glImageFormat, glImageType, nullptr );
|
||||
if (pImg->pixels)
|
||||
glTexSubImage2D( GL_TEXTURE_2D, 0,
|
||||
0, 0,
|
||||
@@ -2236,7 +2236,7 @@ public:
|
||||
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_iBuffer );
|
||||
|
||||
int iSize = pSurface->h * pSurface->pitch;
|
||||
glBufferDataARB( GL_PIXEL_UNPACK_BUFFER_ARB, iSize, NULL, GL_STREAM_DRAW );
|
||||
glBufferDataARB( GL_PIXEL_UNPACK_BUFFER_ARB, iSize, nullptr, GL_STREAM_DRAW );
|
||||
|
||||
void *pSurfaceMemory = glMapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY );
|
||||
pSurface->pixels = (uint8_t *) pSurfaceMemory;
|
||||
@@ -2379,7 +2379,7 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam ¶m, int
|
||||
internalformat = param.bWithAlpha? GL_RGBA8:GL_RGB8;
|
||||
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, internalformat,
|
||||
iTextureWidth, iTextureHeight, 0, type, GL_UNSIGNED_BYTE, NULL );
|
||||
iTextureWidth, iTextureHeight, 0, type, GL_UNSIGNED_BYTE, nullptr );
|
||||
DebugAssertNoGLError();
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
|
||||
|
||||
+1
-1
@@ -437,7 +437,7 @@ namespace RageFileUtil
|
||||
const luaL_Reg RageFileUtilTable[] =
|
||||
{
|
||||
LIST_METHOD( CreateRageFile ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
LUA_REGISTER_NAMESPACE( RageFileUtil );
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ bool RageFileDriverDirect::Move( const RString &sOldPath_, const RString &sNewPa
|
||||
}
|
||||
|
||||
FDB->DelFile( sOldPath );
|
||||
FDB->AddFile( sNewPath, size, hash, NULL );
|
||||
FDB->AddFile( sNewPath, size, hash, nullptr );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ RageSoundReader_FileReader *RageSoundReader_FileReader::OpenFile( RString filena
|
||||
if( pFile->GetFileSize() < 1024*50 )
|
||||
{
|
||||
RageFileObjMem *pMem = new RageFileObjMem;
|
||||
bool bRet = FileCopy( *pFile, *pMem, error, NULL );
|
||||
bool bRet = FileCopy( *pFile, *pMem, error, nullptr );
|
||||
if( !bRet )
|
||||
{
|
||||
delete pMem;
|
||||
|
||||
@@ -745,7 +745,7 @@ bool RageSoundReader_MP3::MADLIB_rewind()
|
||||
|
||||
mad_stream_finish(&mad->Stream);
|
||||
mad_stream_init(&mad->Stream);
|
||||
mad_stream_buffer(&mad->Stream, NULL, 0);
|
||||
mad_stream_buffer(&mad->Stream, nullptr, 0);
|
||||
mad->inbuf_filepos = 0;
|
||||
|
||||
/* Be careful. We need to leave header_bytes alone, so if we try to SetPosition_estimate
|
||||
|
||||
@@ -82,7 +82,7 @@ RageSoundReader_FileReader::OpenResult RageSoundReader_Vorbisfile::Open( RageFil
|
||||
callbacks.close_func = OggRageFile_close_func;
|
||||
callbacks.tell_func = OggRageFile_tell_func;
|
||||
|
||||
int ret = ov_open_callbacks( pFile, vf, NULL, 0, callbacks );
|
||||
int ret = ov_open_callbacks( pFile, vf, nullptr, 0, callbacks );
|
||||
if( ret < 0 )
|
||||
{
|
||||
SetError( ov_ssprintf(ret, "ov_open failed") );
|
||||
|
||||
@@ -80,7 +80,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
png_info *info_ptr = png_create_info_struct(png);
|
||||
if( info_ptr == nullptr )
|
||||
{
|
||||
png_destroy_read_struct( &png, NULL, NULL );
|
||||
png_destroy_read_struct( &png, nullptr, nullptr );
|
||||
sprintf( errorbuf, "creating png_create_info_struct failed");
|
||||
return nullptr;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
CHECKPOINT;
|
||||
if( setjmp(png_jmpbuf(png) ))
|
||||
{
|
||||
png_destroy_read_struct( &png, &info_ptr, NULL );
|
||||
png_destroy_read_struct( &png, &info_ptr, nullptr );
|
||||
delete img;
|
||||
return nullptr;
|
||||
}
|
||||
@@ -101,15 +101,15 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
|
||||
png_uint_32 width, height;
|
||||
int bit_depth, color_type;
|
||||
png_get_IHDR( png, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL );
|
||||
png_get_IHDR( png, info_ptr, &width, &height, &bit_depth, &color_type, nullptr, nullptr, nullptr );
|
||||
|
||||
/* If bHeaderOnly is true, don't allocate the pixel storage space or decompress
|
||||
* the image. Just return an empty surface with only the width and height set. */
|
||||
if( bHeaderOnly )
|
||||
{
|
||||
CHECKPOINT;
|
||||
img = CreateSurfaceFrom( width, height, 32, 0, 0, 0, 0, NULL, width*4 );
|
||||
png_destroy_read_struct( &png, &info_ptr, NULL );
|
||||
img = CreateSurfaceFrom( width, height, 32, 0, 0, 0, 0, nullptr, width*4 );
|
||||
png_destroy_read_struct( &png, &info_ptr, nullptr );
|
||||
|
||||
return img;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
if( color_type == PNG_COLOR_TYPE_GRAY )
|
||||
{
|
||||
png_color_16 *trans;
|
||||
if( png_get_tRNS( png, info_ptr, NULL, NULL, &trans ) == PNG_INFO_tRNS )
|
||||
if( png_get_tRNS( png, info_ptr, nullptr, nullptr, &trans ) == PNG_INFO_tRNS )
|
||||
iColorKey = trans->gray;
|
||||
}
|
||||
else if( color_type == PNG_COLOR_TYPE_PALETTE )
|
||||
@@ -177,7 +177,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
|
||||
png_byte *trans = nullptr;
|
||||
int num_trans = 0;
|
||||
png_get_tRNS( png, info_ptr, &trans, &num_trans, NULL );
|
||||
png_get_tRNS( png, info_ptr, &trans, &num_trans, nullptr );
|
||||
|
||||
for( int i = 0; i < num_palette; ++i )
|
||||
{
|
||||
@@ -246,7 +246,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
|
||||
|
||||
CHECKPOINT;
|
||||
png_read_end( png, info_ptr );
|
||||
png_destroy_read_struct( &png, &info_ptr, NULL );
|
||||
png_destroy_read_struct( &png, &info_ptr, nullptr );
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ static bool RageSurface_Save_PNG( RageFile &f, char szErrorbuf[1024], RageSurfac
|
||||
png_info *pInfo = png_create_info_struct(pPng);
|
||||
if( pInfo == nullptr )
|
||||
{
|
||||
png_destroy_read_struct( &pPng, NULL, NULL );
|
||||
png_destroy_read_struct( &pPng, nullptr, nullptr );
|
||||
if( bDeleteImg )
|
||||
delete pImg;
|
||||
sprintf( szErrorbuf, "creating png_create_info_struct failed");
|
||||
@@ -99,7 +99,7 @@ static bool RageSurface_Save_PNG( RageFile &f, char szErrorbuf[1024], RageSurfac
|
||||
|
||||
if( setjmp(png_jmpbuf(pPng)) )
|
||||
{
|
||||
png_destroy_read_struct( &pPng, &pInfo, NULL );
|
||||
png_destroy_read_struct( &pPng, &pInfo, nullptr );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ struct ThreadSlot
|
||||
int m_iLine;
|
||||
char m_szFormattedBuf[1024];
|
||||
|
||||
ThreadCheckpoint() { Set( NULL, 0, NULL ); }
|
||||
ThreadCheckpoint() { Set( NULL, 0, nullptr ); }
|
||||
void Set( const char *szFile, int iLine, const char *szMessage = nullptr );
|
||||
const char *GetFormattedCheckpoint();
|
||||
};
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ namespace Checkpoints
|
||||
void GetLogs( char *pBuf, int iSize, const char *delim );
|
||||
};
|
||||
|
||||
#define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, NULL))
|
||||
#define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, nullptr))
|
||||
#define CHECKPOINT_M(m) (Checkpoints::SetCheckpoint(__FILE__, __LINE__, m))
|
||||
|
||||
/* Mutex class that follows the behavior of Windows mutexes: if the same
|
||||
|
||||
+6
-6
@@ -149,7 +149,7 @@ namespace
|
||||
{
|
||||
LIST_METHOD( Seed ),
|
||||
LIST_METHOD( Random ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1347,12 +1347,12 @@ void Regex::Compile()
|
||||
{
|
||||
const char *error;
|
||||
int offset;
|
||||
m_pReg = pcre_compile( m_sPattern.c_str(), PCRE_CASELESS, &error, &offset, NULL );
|
||||
m_pReg = pcre_compile( m_sPattern.c_str(), PCRE_CASELESS, &error, &offset, nullptr );
|
||||
|
||||
if( m_pReg == nullptr )
|
||||
RageException::Throw( "Invalid regex: \"%s\" (%s).", m_sPattern.c_str(), error );
|
||||
|
||||
int iRet = pcre_fullinfo( (pcre *) m_pReg, NULL, PCRE_INFO_CAPTURECOUNT, &m_iBackrefs );
|
||||
int iRet = pcre_fullinfo( (pcre *) m_pReg, nullptr, PCRE_INFO_CAPTURECOUNT, &m_iBackrefs );
|
||||
ASSERT( iRet >= 0 );
|
||||
|
||||
++m_iBackrefs;
|
||||
@@ -1398,7 +1398,7 @@ Regex::~Regex()
|
||||
bool Regex::Compare( const RString &sStr )
|
||||
{
|
||||
int iMat[128*3];
|
||||
int iRet = pcre_exec( (pcre *) m_pReg, NULL, sStr.data(), sStr.size(), 0, 0, iMat, 128*3 );
|
||||
int iRet = pcre_exec( (pcre *) m_pReg, nullptr, sStr.data(), sStr.size(), 0, 0, iMat, 128*3 );
|
||||
|
||||
if( iRet < -1 )
|
||||
RageException::Throw( "Unexpected return from pcre_exec('%s'): %i.", m_sPattern.c_str(), iRet );
|
||||
@@ -1411,7 +1411,7 @@ bool Regex::Compare( const RString &sStr, vector<RString> &asMatches )
|
||||
asMatches.clear();
|
||||
|
||||
int iMat[128*3];
|
||||
int iRet = pcre_exec( (pcre *) m_pReg, NULL, sStr.data(), sStr.size(), 0, 0, iMat, 128*3 );
|
||||
int iRet = pcre_exec( (pcre *) m_pReg, nullptr, sStr.data(), sStr.size(), 0, 0, iMat, 128*3 );
|
||||
|
||||
if( iRet < -1 )
|
||||
RageException::Throw( "Unexpected return from pcre_exec('%s'): %i.", m_sPattern.c_str(), iRet );
|
||||
@@ -1767,7 +1767,7 @@ RString IntToString( const int &iNum )
|
||||
|
||||
float StringToFloat( const RString &sString )
|
||||
{
|
||||
float ret = strtof( sString, NULL );
|
||||
float ret = strtof( sString, nullptr );
|
||||
|
||||
if( !isfinite(ret) )
|
||||
ret = 0.0f;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/* Convert from the given codepage to UTF-8. Return true if successful. */
|
||||
static bool CodePageConvert( RString &sText, int iCodePage )
|
||||
{
|
||||
int iSize = MultiByteToWideChar( iCodePage, MB_ERR_INVALID_CHARS, sText.data(), sText.size(), NULL, 0 );
|
||||
int iSize = MultiByteToWideChar( iCodePage, MB_ERR_INVALID_CHARS, sText.data(), sText.size(), nullptr, 0 );
|
||||
if( iSize == 0 )
|
||||
{
|
||||
LOG->Trace( "%s\n", werr_ssprintf(GetLastError(), "err: ").c_str() );
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ bool RoomWheel::Select()
|
||||
return WheelBase::Select();
|
||||
if( m_iSelection == 0 )
|
||||
{
|
||||
// Since this is not actually an option outside of this wheel, NULL is a good idea.
|
||||
// Since this is not actually an option outside of this wheel, nullptr is a good idea.
|
||||
m_LastSelection = nullptr;
|
||||
ScreenTextEntry::TextEntry( SM_BackFromRoomName, ENTER_ROOM_NAME, "", 255 );
|
||||
}
|
||||
|
||||
+124
-124
@@ -549,49 +549,49 @@ static MenuDef g_MainMenu(
|
||||
"ScreenMiniMenuMainMenu",
|
||||
MenuRowDef(ScreenEdit::play_whole_song,
|
||||
"Play whole song",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::play_current_beat_to_end,
|
||||
"Play current beat to end",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::save,
|
||||
"Save",
|
||||
true, EditMode_Home, true, true, 0, NULL ),
|
||||
true, EditMode_Home, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::play_selection,
|
||||
"Play selection",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::set_selection_start,
|
||||
"Set selection start",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::set_selection_end,
|
||||
"Set selection end",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::revert_to_last_save,
|
||||
"Revert to last save",
|
||||
true, EditMode_Home, true, true, 0, NULL ),
|
||||
true, EditMode_Home, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::revert_from_disk,
|
||||
"Revert from disk",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::options,
|
||||
"Editor options",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::edit_song_info,
|
||||
"Edit song info",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::edit_steps_information,
|
||||
"Edit steps information",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::edit_timing_data,
|
||||
"Edit Timing Data",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::view_steps_data,
|
||||
"View steps data",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::play_preview_music,
|
||||
"Play preview music",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::exit,
|
||||
"Exit Edit Mode",
|
||||
true, EditMode_Practice, true, true, 0, NULL )
|
||||
true, EditMode_Practice, true, true, 0, nullptr )
|
||||
);
|
||||
|
||||
static MenuDef g_AlterMenu(
|
||||
@@ -599,12 +599,12 @@ static MenuDef g_AlterMenu(
|
||||
MenuRowDef(ScreenEdit::cut,
|
||||
"Cut",
|
||||
true,
|
||||
EditMode_Practice, true, true, 0, NULL ),
|
||||
EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::copy,
|
||||
"Copy",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::clear, "Clear area", true,
|
||||
EditMode_Practice, true, true, 0, NULL ),
|
||||
EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::quantize, "Quantize", true,
|
||||
EditMode_Practice, true, true, 0,
|
||||
"4th","8th","12th","16th","24th","32nd","48th","64th","192nd"),
|
||||
@@ -624,57 +624,57 @@ static MenuDef g_AlterMenu(
|
||||
MenuRowDef(ScreenEdit::play,
|
||||
"Play selection",
|
||||
true,
|
||||
EditMode_Practice, true, true, 0, NULL ),
|
||||
EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::record,
|
||||
"Record in selection",
|
||||
true,
|
||||
EditMode_Practice, true, true, 0, NULL ),
|
||||
EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::preview_designation,
|
||||
"Designate as Music Preview",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::convert_to_pause,
|
||||
"Convert selection to pause",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::convert_to_delay,
|
||||
"Convert selection to delay",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::convert_to_warp,
|
||||
"Convert selection to warp",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::convert_to_fake,
|
||||
"Convert selection to fake",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::convert_to_attack,
|
||||
"Convert selection to attack",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL),
|
||||
EditMode_Full, true, true, 0, nullptr),
|
||||
MenuRowDef(ScreenEdit::routine_invert_notes,
|
||||
"Invert notes' player",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::routine_mirror_1_to_2,
|
||||
"Mirror Player 1 to 2",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::routine_mirror_2_to_1,
|
||||
"Mirror Player 2 to 1",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL )
|
||||
EditMode_Full, true, true, 0, nullptr )
|
||||
);
|
||||
|
||||
static MenuDef g_AreaMenu(
|
||||
"ScreenMiniMenuAreaMenu",
|
||||
MenuRowDef(ScreenEdit::paste_at_current_beat,
|
||||
"Paste at current beat",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::paste_at_begin_marker,
|
||||
"Paste at begin marker",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::insert_and_shift,
|
||||
"Insert beat and shift down",
|
||||
true, EditMode_Practice, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ),
|
||||
@@ -690,27 +690,27 @@ static MenuDef g_AreaMenu(
|
||||
MenuRowDef(ScreenEdit::convert_pause_to_beat,
|
||||
"Convert pause to beats",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::convert_delay_to_beat,
|
||||
"Convert delay to beats",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::last_second_at_beat,
|
||||
"Designate last second at current beat",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::undo,
|
||||
"Undo",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::clear_clipboard,
|
||||
"Clear clipboard",
|
||||
true,
|
||||
EditMode_Practice, true, true, 0, NULL ),
|
||||
EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::modify_attacks_at_row,
|
||||
"Modify Attacks at current beat",
|
||||
true, EditMode_CourseMods, true, true, 0, NULL),
|
||||
true, EditMode_CourseMods, true, true, 0, nullptr),
|
||||
MenuRowDef(ScreenEdit::modify_keysounds_at_row,
|
||||
"Modify Keysounds at current beat",
|
||||
true, EditMode_Full, true, true, 0, NULL)
|
||||
true, EditMode_Full, true, true, 0, nullptr)
|
||||
|
||||
);
|
||||
|
||||
@@ -718,98 +718,98 @@ static MenuDef g_StepsInformation(
|
||||
"ScreenMiniMenuStepsInformation",
|
||||
MenuRowDef(ScreenEdit::difficulty,
|
||||
"Difficulty",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::meter,
|
||||
"Meter",
|
||||
true, EditMode_Practice, true, false, 0, NULL ),
|
||||
true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::predict_meter,
|
||||
"Predicted Meter",
|
||||
false, EditMode_Full, true, true, 0, NULL ),
|
||||
false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::chartname,
|
||||
"Chart Name",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::description,
|
||||
"Description",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::chartstyle,
|
||||
"Chart Style",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::step_credit,
|
||||
"Step Author",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::step_display_bpm,
|
||||
"Display BPM",
|
||||
true, EditMode_Full, true, true, 0, "Actual", "Specified", "Random" ),
|
||||
MenuRowDef(ScreenEdit::step_min_bpm,
|
||||
"Min BPM",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::step_max_bpm,
|
||||
"Max BPM",
|
||||
true, EditMode_Full, true, true, 0, NULL )
|
||||
true, EditMode_Full, true, true, 0, nullptr )
|
||||
);
|
||||
|
||||
static MenuDef g_StepsData(
|
||||
"ScreenMiniMenuStepsData",
|
||||
MenuRowDef( ScreenEdit::tap_notes, "Tap Steps", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::jumps, "Jumps", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::hands, "Hands", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::quads, "Quads", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::holds, "Holds", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::mines, "Mines", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::rolls, "Rolls", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::lifts, "Lifts", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::fakes, "Fakes", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::stream, "Stream", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::voltage, "Voltage", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::air, "Air", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::freeze, "Freeze", false, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::chaos, "Chaos", false, EditMode_Full, true, true, 0, NULL )
|
||||
MenuRowDef( ScreenEdit::tap_notes, "Tap Steps", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::jumps, "Jumps", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::hands, "Hands", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::quads, "Quads", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::holds, "Holds", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::mines, "Mines", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::rolls, "Rolls", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::lifts, "Lifts", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::fakes, "Fakes", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::stream, "Stream", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::voltage, "Voltage", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::air, "Air", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::freeze, "Freeze", false, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef( ScreenEdit::chaos, "Chaos", false, EditMode_Full, true, true, 0, nullptr )
|
||||
);
|
||||
|
||||
static MenuDef g_SongInformation(
|
||||
"ScreenMiniMenuSongInformation",
|
||||
MenuRowDef(ScreenEdit::main_title,
|
||||
"Main title",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::sub_title,
|
||||
"Sub title",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::artist,
|
||||
"Artist",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::genre,
|
||||
"Genre",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::credit,
|
||||
"Credit",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::main_title_transliteration,
|
||||
"Main title transliteration",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::sub_title_transliteration,
|
||||
"Sub title transliteration",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::artist_transliteration,
|
||||
"Artist transliteration",
|
||||
true, EditMode_Practice, true, true, 0, NULL ),
|
||||
true, EditMode_Practice, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::last_second_hint,
|
||||
"Last second hint",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::preview_start,
|
||||
"Preview Start",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::preview_length,
|
||||
"Preview Length",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::display_bpm,
|
||||
"Display BPM",
|
||||
true, EditMode_Full, true, true, 0, "Actual", "Specified", "Random" ),
|
||||
MenuRowDef(ScreenEdit::min_bpm,
|
||||
"Min BPM",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::max_bpm,
|
||||
"Max BPM",
|
||||
true, EditMode_Full, true, true, 0, NULL )
|
||||
true, EditMode_Full, true, true, 0, nullptr )
|
||||
);
|
||||
|
||||
|
||||
@@ -817,55 +817,55 @@ static MenuDef g_TimingDataInformation(
|
||||
"ScreenMiniMenuTimingDataInformation",
|
||||
MenuRowDef(ScreenEdit::beat_0_offset,
|
||||
"Beat 0 Offset",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::bpm,
|
||||
"Edit BPM change",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::stop,
|
||||
"Edit stop",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::delay,
|
||||
"Edit delay",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::time_signature,
|
||||
"Edit time signature",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::label,
|
||||
"Edit label",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::tickcount,
|
||||
"Edit tickcount",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::combo,
|
||||
"Edit combo",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::warp,
|
||||
"Edit warp",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::speed_percent,
|
||||
"Edit speed (percent)",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::speed_wait,
|
||||
"Edit speed (wait)",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::speed_mode,
|
||||
"Edit speed (mode)",
|
||||
true, EditMode_Full, true, true, 0, "Beats", "Seconds" ),
|
||||
MenuRowDef(ScreenEdit::scroll,
|
||||
"Edit scrolling factor",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::fake,
|
||||
"Edit fake",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::copy_full_timing,
|
||||
"Copy timing data",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::paste_full_timing,
|
||||
"Paste timing data",
|
||||
true, EditMode_Full, true, true, 0, NULL ),
|
||||
true, EditMode_Full, true, true, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::erase_step_timing,
|
||||
"Erase step timing",
|
||||
true, EditMode_Full, true, true, 0, NULL )
|
||||
true, EditMode_Full, true, true, 0, nullptr )
|
||||
);
|
||||
|
||||
// XXX: What are these enums used for?
|
||||
@@ -911,11 +911,11 @@ static MenuDef g_BackgroundChange(
|
||||
MenuRowDef(ScreenEdit::transition,
|
||||
"Force Transition",
|
||||
true,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::effect,
|
||||
"Force Effect",
|
||||
true,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::color1,
|
||||
"Force Color 1",
|
||||
true,
|
||||
@@ -936,31 +936,31 @@ static MenuDef g_BackgroundChange(
|
||||
MenuRowDef(ScreenEdit::file1_song_bganimation,
|
||||
"File1 Song BGAnimation",
|
||||
EnabledIfSet1SongBGAnimation,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file1_song_movie,
|
||||
"File1 Song Movie",
|
||||
EnabledIfSet1SongMovie,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file1_song_still,
|
||||
"File1 Song Still",
|
||||
EnabledIfSet1SongBitmap,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file1_global_bganimation,
|
||||
"File1 Global BGAnimation",
|
||||
EnabledIfSet1GlobalBGAnimation,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file1_global_movie,
|
||||
"File1 Global Movie",
|
||||
EnabledIfSet1GlobalMovie,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file1_global_movie_song_group,
|
||||
"File1 Global Movie (Group)",
|
||||
EnabledIfSet1GlobalMovieSongGroup,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file1_global_movie_song_group_and_genre,
|
||||
"File1 Global Movie (Group + Genre)",
|
||||
EnabledIfSet1GlobalMovieSongGroupAndGenre,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_type,
|
||||
"File2 Type",
|
||||
true,
|
||||
@@ -971,35 +971,35 @@ static MenuDef g_BackgroundChange(
|
||||
MenuRowDef(ScreenEdit::file2_song_bganimation,
|
||||
"File2 Song BGAnimation",
|
||||
EnabledIfSet2SongBGAnimation,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_song_movie,
|
||||
"File2 Song Movie",
|
||||
EnabledIfSet2SongMovie,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_song_still,
|
||||
"File2 Song Still",
|
||||
EnabledIfSet2SongBitmap,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_global_bganimation,
|
||||
"File2 Global BGAnimation",
|
||||
EnabledIfSet2GlobalBGAnimation,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_global_movie,
|
||||
"File2 Global Movie",
|
||||
EnabledIfSet2GlobalMovie,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_global_movie_song_group,
|
||||
"File2 Global Movie (Group)",
|
||||
EnabledIfSet2GlobalMovieSongGroup,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::file2_global_movie_song_group_and_genre,
|
||||
"File2 Global Movie (Group + Genre)",
|
||||
EnabledIfSet2GlobalMovieSongGroupAndGenre,
|
||||
EditMode_Full, true, false, 0, NULL ),
|
||||
EditMode_Full, true, false, 0, nullptr ),
|
||||
MenuRowDef(ScreenEdit::delete_change,
|
||||
"Remove Change",
|
||||
true,
|
||||
EditMode_Full, true, true, 0, NULL )
|
||||
EditMode_Full, true, true, 0, nullptr )
|
||||
);
|
||||
static bool EnabledIfSet1SongBGAnimation() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_bganimation && !g_BackgroundChange.rows[ScreenEdit::file1_song_bganimation].choices.empty(); }
|
||||
static bool EnabledIfSet1SongMovie() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_movie && !g_BackgroundChange.rows[ScreenEdit::file1_song_movie].choices.empty(); }
|
||||
@@ -1067,7 +1067,7 @@ static MenuDef g_InsertStepAttack(
|
||||
|
||||
static MenuDef g_CourseMode(
|
||||
"ScreenMiniMenuCourseDisplay",
|
||||
MenuRowDef( -1, "Play mods from course", true, EditMode_Practice, true, false, 0, NULL )
|
||||
MenuRowDef( -1, "Play mods from course", true, EditMode_Practice, true, false, 0, nullptr )
|
||||
);
|
||||
|
||||
// HACK: need to remember the track we're inserting on so that we can lay the
|
||||
@@ -1218,7 +1218,7 @@ void ScreenEdit::Init()
|
||||
|
||||
m_bDirty = m_NoteDataEdit.IsEmpty(); // require the usage of saving if empty.
|
||||
|
||||
m_Player->Init( "Player", GAMESTATE->m_pPlayerState[PLAYER_1], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL );
|
||||
m_Player->Init( "Player", GAMESTATE->m_pPlayerState[PLAYER_1], nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr );
|
||||
m_Player->CacheAllUsedNoteSkins();
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PC_HUMAN;
|
||||
m_Player->SetXY( PLAYER_X, PLAYER_Y );
|
||||
@@ -5127,7 +5127,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v
|
||||
ScreenTextEntry::TextEntry(SM_None, ENTER_MIN_BPM,
|
||||
FloatToString(pSteps->GetMinBPM()), 20,
|
||||
ScreenTextEntry::FloatValidate,
|
||||
ChangeStepsMinBPM, NULL);
|
||||
ChangeStepsMinBPM, nullptr);
|
||||
break;
|
||||
}
|
||||
case step_max_bpm:
|
||||
@@ -5135,7 +5135,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v
|
||||
ScreenTextEntry::TextEntry(SM_None, ENTER_MAX_BPM,
|
||||
FloatToString(pSteps->GetMaxBPM()), 20,
|
||||
ScreenTextEntry::FloatValidate,
|
||||
ChangeStepsMaxBPM, NULL);
|
||||
ChangeStepsMaxBPM, nullptr);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -5163,53 +5163,53 @@ void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const vec
|
||||
switch( c )
|
||||
{
|
||||
case main_title:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_MAIN_TITLE, pSong->m_sMainTitle, 100, NULL, ChangeMainTitle, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_MAIN_TITLE, pSong->m_sMainTitle, 100, nullptr, ChangeMainTitle, nullptr );
|
||||
break;
|
||||
case sub_title:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_SUB_TITLE, pSong->m_sSubTitle, 100, NULL, ChangeSubTitle, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_SUB_TITLE, pSong->m_sSubTitle, 100, nullptr, ChangeSubTitle, nullptr );
|
||||
break;
|
||||
case artist:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_ARTIST, pSong->m_sArtist, 100, NULL, ChangeArtist, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_ARTIST, pSong->m_sArtist, 100, nullptr, ChangeArtist, nullptr );
|
||||
break;
|
||||
case genre:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_GENRE, pSong->m_sGenre, 100, NULL, ChangeGenre, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_GENRE, pSong->m_sGenre, 100, nullptr, ChangeGenre, nullptr );
|
||||
break;
|
||||
case credit:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_CREDIT, pSong->m_sCredit, 100, NULL, ChangeCredit, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_CREDIT, pSong->m_sCredit, 100, nullptr, ChangeCredit, nullptr );
|
||||
break;
|
||||
case main_title_transliteration:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_MAIN_TITLE_TRANSLIT, pSong->m_sMainTitleTranslit, 100, NULL, ChangeMainTitleTranslit, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_MAIN_TITLE_TRANSLIT, pSong->m_sMainTitleTranslit, 100, nullptr, ChangeMainTitleTranslit, nullptr );
|
||||
break;
|
||||
case sub_title_transliteration:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_SUB_TITLE_TRANSLIT, pSong->m_sSubTitleTranslit, 100, NULL, ChangeSubTitleTranslit, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_SUB_TITLE_TRANSLIT, pSong->m_sSubTitleTranslit, 100, nullptr, ChangeSubTitleTranslit, nullptr );
|
||||
break;
|
||||
case artist_transliteration:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_ARTIST_TRANSLIT, pSong->m_sArtistTranslit, 100, NULL, ChangeArtistTranslit, NULL );
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_ARTIST_TRANSLIT, pSong->m_sArtistTranslit, 100, nullptr, ChangeArtistTranslit, nullptr );
|
||||
break;
|
||||
case last_second_hint:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_LAST_SECOND_HINT,
|
||||
FloatToString(pSong->GetSpecifiedLastSecond()), 20,
|
||||
ScreenTextEntry::FloatValidate, ChangeLastSecondHint, NULL );
|
||||
ScreenTextEntry::FloatValidate, ChangeLastSecondHint, nullptr );
|
||||
break;
|
||||
case preview_start:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_PREVIEW_START,
|
||||
FloatToString(pSong->m_fMusicSampleStartSeconds), 20,
|
||||
ScreenTextEntry::FloatValidate, ChangePreviewStart, NULL );
|
||||
ScreenTextEntry::FloatValidate, ChangePreviewStart, nullptr );
|
||||
break;
|
||||
case preview_length:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_PREVIEW_LENGTH,
|
||||
FloatToString(pSong->m_fMusicSampleLengthSeconds), 20,
|
||||
ScreenTextEntry::FloatValidate, ChangePreviewLength, NULL );
|
||||
ScreenTextEntry::FloatValidate, ChangePreviewLength, nullptr );
|
||||
break;
|
||||
case min_bpm:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_MIN_BPM,
|
||||
FloatToString(pSong->m_fSpecifiedBPMMin), 20,
|
||||
ScreenTextEntry::FloatValidate, ChangeMinBPM, NULL );
|
||||
ScreenTextEntry::FloatValidate, ChangeMinBPM, nullptr );
|
||||
break;
|
||||
case max_bpm:
|
||||
ScreenTextEntry::TextEntry( SM_None, ENTER_MAX_BPM,
|
||||
FloatToString(pSong->m_fSpecifiedBPMMax), 20,
|
||||
ScreenTextEntry::FloatValidate, ChangeMaxBPM, NULL );
|
||||
ScreenTextEntry::FloatValidate, ChangeMaxBPM, nullptr );
|
||||
break;
|
||||
default: break;
|
||||
};
|
||||
|
||||
@@ -362,7 +362,7 @@ void ScreenInstallOverlay::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
if( playAfterLaunchInfo.bAnySongChanged )
|
||||
SONGMAN->Reload( false, NULL );
|
||||
SONGMAN->Reload( false, nullptr );
|
||||
|
||||
if( !playAfterLaunchInfo.sSongDir.empty() )
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ void ScreenNetSelectMusic::Init()
|
||||
m_DC[p] = GAMESTATE->m_PreferredDifficulty[p];
|
||||
|
||||
m_StepsDisplays[p].SetName( ssprintf("StepsDisplayP%d",p+1) );
|
||||
m_StepsDisplays[p].Load( "StepsDisplayNet", NULL );
|
||||
m_StepsDisplays[p].Load( "StepsDisplayNet", nullptr );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_StepsDisplays[p] );
|
||||
this->AddChild( &m_StepsDisplays[p] );
|
||||
}
|
||||
@@ -475,7 +475,7 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
|
||||
if( GAMESTATE->m_pCurSong == nullptr )
|
||||
{
|
||||
m_StepsDisplays[pn].SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType_Invalid, 0, Difficulty_Beginner, CourseType_Invalid );
|
||||
//m_DifficultyIcon[pn].SetFromSteps( pn, NULL ); // It will blank it out
|
||||
//m_DifficultyIcon[pn].SetFromSteps( pn, nullptr ); // It will blank it out
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ void ScreenNetSelectMusic::MusicChanged()
|
||||
|
||||
SOUND->StopMusic();
|
||||
// todo: handle playing section music correctly. -aj
|
||||
// SOUND->PlayMusic( m_sSectionMusicPath, NULL, true, 0, -1 );
|
||||
// SOUND->PlayMusic( m_sSectionMusicPath, nullptr, true, 0, -1 );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,12 +39,12 @@ static bool CurrentCourseIsSaved()
|
||||
|
||||
static const MenuRowDef g_MenuRows[] =
|
||||
{
|
||||
MenuRowDef( -1, "Play", true, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Edit Course", true, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Shuffle", true, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Rename", CurrentCourseIsSaved, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Delete", CurrentCourseIsSaved, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Save", true, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Play", true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
MenuRowDef( -1, "Edit Course", true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
MenuRowDef( -1, "Shuffle", true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
MenuRowDef( -1, "Rename", CurrentCourseIsSaved, EditMode_Practice, true, false, 0, nullptr ),
|
||||
MenuRowDef( -1, "Delete", CurrentCourseIsSaved, EditMode_Practice, true, false, 0, nullptr ),
|
||||
MenuRowDef( -1, "Save", true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
};
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenOptionsCourseOverview );
|
||||
|
||||
@@ -152,7 +152,7 @@ void ScreenOptionsEditCourse::Init()
|
||||
|
||||
const MenuRowDef g_MenuRows[] =
|
||||
{
|
||||
MenuRowDef( -1, "Max Minutes", true, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Max Minutes", true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
};
|
||||
|
||||
static LocalizedString EMPTY ("ScreenOptionsEditCourse","-Empty-");
|
||||
|
||||
@@ -136,7 +136,7 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
|
||||
m_iPlayer++;
|
||||
if( GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer) && m_iPlayer < NUM_PLAYERS )
|
||||
{
|
||||
ScreenTextEntry::Password(SM_PasswordDone, sLoginQuestion, NULL );
|
||||
ScreenTextEntry::Password(SM_PasswordDone, sLoginQuestion, nullptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -147,7 +147,7 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
|
||||
else
|
||||
{
|
||||
RString Response = NSMAN->m_SMOnlinePacket.ReadNT();
|
||||
ScreenTextEntry::Password( SM_PasswordDone, Response + "\n\n" + sLoginQuestion, NULL );
|
||||
ScreenTextEntry::Password( SM_PasswordDone, Response + "\n\n" + sLoginQuestion, nullptr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
|
||||
while(!GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer))
|
||||
++m_iPlayer;
|
||||
sLoginQuestion = YOU_ARE_LOGGING_ON_AS.GetValue() + "\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n" + ENTER_YOUR_PASSWORD.GetValue();
|
||||
ScreenTextEntry::Password(SM_PasswordDone, sLoginQuestion, NULL );
|
||||
ScreenTextEntry::Password(SM_PasswordDone, sLoginQuestion, nullptr );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace
|
||||
const luaL_Reg ScreenSystemLayerHelpersTable[] =
|
||||
{
|
||||
LIST_METHOD( GetCreditsMessage ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
void(*OnOK)(const RString &sPassword) = nullptr,
|
||||
void(*OnCancel)() = nullptr )
|
||||
{
|
||||
TextEntry( smSendOnPop, sQuestion, "", 255, NULL, OnOK, OnCancel, true );
|
||||
TextEntry( smSendOnPop, sQuestion, "", 255, nullptr, OnOK, OnCancel, true );
|
||||
}
|
||||
|
||||
struct TextEntrySettings {
|
||||
|
||||
+3
-3
@@ -763,7 +763,7 @@ bool SongUtil::IsChartNameUnique( const Song* pSong, StepsType st, const RString
|
||||
|
||||
RString SongUtil::MakeUniqueEditDescription( const Song *pSong, StepsType st, const RString &sPreferredDescription )
|
||||
{
|
||||
if( IsEditDescriptionUnique( pSong, st, sPreferredDescription, NULL ) )
|
||||
if( IsEditDescriptionUnique( pSong, st, sPreferredDescription, nullptr ) )
|
||||
return sPreferredDescription;
|
||||
|
||||
RString sTemp;
|
||||
@@ -774,7 +774,7 @@ RString SongUtil::MakeUniqueEditDescription( const Song *pSong, StepsType st, co
|
||||
RString sNum = ssprintf("%d", i+1);
|
||||
sTemp = sPreferredDescription.Left( MAX_STEPS_DESCRIPTION_LENGTH - sNum.size() ) + sNum;
|
||||
|
||||
if( IsEditDescriptionUnique(pSong, st, sTemp, NULL) )
|
||||
if( IsEditDescriptionUnique(pSong, st, sTemp, nullptr) )
|
||||
return sTemp;
|
||||
}
|
||||
|
||||
@@ -1157,7 +1157,7 @@ namespace
|
||||
LIST_METHOD( GetPlayableSteps ),
|
||||
LIST_METHOD( IsStepsTypePlayable ),
|
||||
LIST_METHOD( IsStepsPlayable ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ void StepsDisplay::SetFromSteps( const Steps* pSteps )
|
||||
return;
|
||||
}
|
||||
|
||||
SetParams params = { pSteps, NULL, pSteps->GetMeter(), pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid };
|
||||
SetParams params = { pSteps, nullptr, pSteps->GetMeter(), pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid };
|
||||
SetInternal( params );
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void StepsDisplay::Unset()
|
||||
|
||||
void StepsDisplay::SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType st, int iMeter, Difficulty dc, CourseType ct )
|
||||
{
|
||||
SetParams params = { NULL, NULL, iMeter, st, dc, ct };
|
||||
SetParams params = { NULL, nullptr, iMeter, st, dc, ct };
|
||||
SetInternal( params );
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ void StepsDisplay::SetInternal( const SetParams ¶ms )
|
||||
class LunaStepsDisplay: public Luna<StepsDisplay>
|
||||
{
|
||||
public:
|
||||
static int Load( T* p, lua_State *L ) { p->Load( SArg(1), NULL ); return 0; }
|
||||
static int Load( T* p, lua_State *L ) { p->Load( SArg(1), nullptr ); return 0; }
|
||||
static int SetFromSteps( T* p, lua_State *L )
|
||||
{
|
||||
if( lua_isnil(L,1) )
|
||||
|
||||
@@ -602,11 +602,11 @@ bool ThemeManager::GetPathInfoToRaw( PathInfo &out, const RString &sThemeName_,
|
||||
{
|
||||
// BGAnimations, Fonts, Graphics, Sounds, Other
|
||||
static const char *masks[NUM_ElementCategory][15] = {
|
||||
{ "redir", "lua", "xml", "png", "jpg", "jpeg", "bmp", "gif", "ogv", "avi", "mpg", "mpeg", "txt", "", NULL},
|
||||
{ "redir", "ini", NULL },
|
||||
{ "redir", "lua", "xml", "png", "jpg", "jpeg", "bmp", "gif", "ogv", "avi", "mpg", "mpeg", "txt", "", NULL},
|
||||
{ "redir", "lua", "mp3", "oga", "ogg", "wav", NULL },
|
||||
{ "*", NULL },
|
||||
{ "redir", "lua", "xml", "png", "jpg", "jpeg", "bmp", "gif", "ogv", "avi", "mpg", "mpeg", "txt", "", nullptr},
|
||||
{ "redir", "ini", nullptr },
|
||||
{ "redir", "lua", "xml", "png", "jpg", "jpeg", "bmp", "gif", "ogv", "avi", "mpg", "mpeg", "txt", "", nullptr},
|
||||
{ "redir", "lua", "mp3", "oga", "ogg", "wav", nullptr },
|
||||
{ "*", nullptr },
|
||||
};
|
||||
const char **asset_masks = masks[category];
|
||||
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ public:
|
||||
}
|
||||
ThemeMetric1D()
|
||||
{
|
||||
Load( RString(), NULL, 0 );
|
||||
Load( RString(), nullptr, 0 );
|
||||
}
|
||||
void Load( const RString& sGroup, MetricName1D pfn, size_t N )
|
||||
{
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ namespace
|
||||
{
|
||||
LIST_METHOD( GetNumSongs ),
|
||||
LIST_METHOD( GetTotalSeconds ),
|
||||
{ NULL, NULL }
|
||||
{ NULL, nullptr }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ void ArchHooks_MacOSX::DumpDebugInfo()
|
||||
}
|
||||
|
||||
size_t size;
|
||||
#define GET_PARAM( name, var ) (size = sizeof(var), sysctlbyname(name, &var, &size, NULL, 0) )
|
||||
#define GET_PARAM( name, var ) (size = sizeof(var), sysctlbyname(name, &var, &size, nullptr, 0) )
|
||||
// Get memory
|
||||
float fRam;
|
||||
char ramPower;
|
||||
@@ -285,18 +285,18 @@ void ArchHooks_MacOSX::DumpDebugInfo()
|
||||
break;
|
||||
}
|
||||
sModel = szModel;
|
||||
CFURLRef urlRef = CFBundleCopyResourceURL( CFBundleGetMainBundle(), CFSTR("Hardware.plist"), NULL, NULL );
|
||||
CFURLRef urlRef = CFBundleCopyResourceURL( CFBundleGetMainBundle(), CFSTR("Hardware.plist"), nullptr, nullptr );
|
||||
|
||||
if( urlRef == nullptr )
|
||||
break;
|
||||
CFDataRef dataRef = nullptr;
|
||||
SInt32 error;
|
||||
CFURLCreateDataAndPropertiesFromResource( NULL, urlRef, &dataRef, NULL, NULL, &error );
|
||||
CFURLCreateDataAndPropertiesFromResource( NULL, urlRef, &dataRef, nullptr, nullptr, &error );
|
||||
CFRelease( urlRef );
|
||||
if( dataRef == nullptr )
|
||||
break;
|
||||
// This also works with binary property lists for some reason.
|
||||
CFPropertyListRef plRef = CFPropertyListCreateFromXMLData( NULL, dataRef, kCFPropertyListImmutable, NULL );
|
||||
CFPropertyListRef plRef = CFPropertyListCreateFromXMLData( NULL, dataRef, kCFPropertyListImmutable, nullptr );
|
||||
CFRelease( dataRef );
|
||||
if( plRef == nullptr )
|
||||
break;
|
||||
@@ -358,8 +358,8 @@ RString ArchHooks::GetPreferredLanguage()
|
||||
bool ArchHooks_MacOSX::GoToURL( RString sUrl )
|
||||
{
|
||||
CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, (const UInt8*)sUrl.data(),
|
||||
sUrl.length(), kCFStringEncodingUTF8, NULL );
|
||||
OSStatus result = LSOpenCFURLRef( url, NULL );
|
||||
sUrl.length(), kCFStringEncodingUTF8, nullptr );
|
||||
OSStatus result = LSOpenCFURLRef( url, nullptr );
|
||||
|
||||
CFRelease( url );
|
||||
return result == 0;
|
||||
@@ -395,7 +395,7 @@ static void PathForFolderType( char dir[PATH_MAX], OSType folderType )
|
||||
void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
|
||||
{
|
||||
char dir[PATH_MAX];
|
||||
CFURLRef dataUrl = CFBundleCopyResourceURL( CFBundleGetMainBundle(), CFSTR("StepMania"), CFSTR("smzip"), NULL );
|
||||
CFURLRef dataUrl = CFBundleCopyResourceURL( CFBundleGetMainBundle(), CFSTR("StepMania"), CFSTR("smzip"), nullptr );
|
||||
|
||||
FILEMAN->Mount( "dir", sDirOfExecutable, "/" );
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static void TestTLS()
|
||||
|
||||
RageThread TestThread;
|
||||
TestThread.SetName( "TestTLS" );
|
||||
TestThread.Create( TestTLSThread, NULL );
|
||||
TestThread.Create( TestTLSThread, nullptr );
|
||||
TestThread.Wait();
|
||||
|
||||
if( g_iTestTLS == 1 )
|
||||
@@ -153,7 +153,7 @@ int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate )
|
||||
int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate )
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday( &tv, NULL );
|
||||
gettimeofday( &tv, nullptr );
|
||||
|
||||
int64_t iRet = int64_t(tv.tv_sec) * 1000000 + int64_t(tv.tv_usec);
|
||||
ret = FixupTimeIfBackwards( ret );
|
||||
|
||||
@@ -100,7 +100,7 @@ bool ArchHooks_Win32::CheckForMultipleInstances(int argc, char* argv[])
|
||||
/* Search for the existing window. Prefer to use the class name, which is less likely to
|
||||
* have a false match, and will match the gameplay window. If that fails, try the window
|
||||
* name, which should match the loading window. */
|
||||
HWND hWnd = FindWindow( PRODUCT_ID, NULL );
|
||||
HWND hWnd = FindWindow( PRODUCT_ID, nullptr );
|
||||
if( hWnd == nullptr )
|
||||
hWnd = FindWindow( NULL, PRODUCT_ID );
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CF
|
||||
DEBUG_ASSERT_M( false, error );
|
||||
return kCFUserNotificationDefaultResponse; // Is this better than displaying an "unknown error" message?
|
||||
}
|
||||
CFUserNotificationDisplayAlert( 0.0, flags, NULL, NULL, NULL, CFSTR(PRODUCT_FAMILY),
|
||||
CFUserNotificationDisplayAlert( 0.0, flags, nullptr, nullptr, nullptr, CFSTR(PRODUCT_FAMILY),
|
||||
text, OK, alt, other, &result );
|
||||
CFRelease( text );
|
||||
|
||||
@@ -36,7 +36,7 @@ static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CF
|
||||
return result;
|
||||
}
|
||||
|
||||
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") )
|
||||
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), nullptr, CFSTR("Localizable") )
|
||||
|
||||
void DialogDriver_MacOSX::OK( RString sMessage, RString sID )
|
||||
{
|
||||
|
||||
@@ -222,7 +222,7 @@ void DialogDriver_Win32::Error( RString sError, RString sID )
|
||||
|
||||
// throw up a pretty error dialog
|
||||
AppInstance handle;
|
||||
DialogBox( handle.Get(), MAKEINTRESOURCE(IDD_ERROR_DIALOG), NULL, ErrorWndProc );
|
||||
DialogBox( handle.Get(), MAKEINTRESOURCE(IDD_ERROR_DIALOG), nullptr, ErrorWndProc );
|
||||
#else
|
||||
::AfxMessageBox( ConvertUTF8ToACP(sError).c_str(), MB_OK, 0 );
|
||||
#endif
|
||||
|
||||
@@ -104,23 +104,23 @@ InputHandler_DInput::InputHandler_DInput()
|
||||
g_iNumJoysticks = 0;
|
||||
|
||||
AppInstance inst;
|
||||
HRESULT hr = DirectInput8Create(inst.Get(), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID *) &g_dinput, NULL);
|
||||
HRESULT hr = DirectInput8Create(inst.Get(), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID *) &g_dinput, nullptr);
|
||||
if( hr != DI_OK )
|
||||
RageException::Throw( hr_ssprintf(hr, "InputHandler_DInput: DirectInputCreate") );
|
||||
|
||||
LOG->Trace( "InputHandler_DInput: IDirectInput::EnumDevices(DIDEVTYPE_KEYBOARD)" );
|
||||
hr = g_dinput->EnumDevices( DI8DEVTYPE_KEYBOARD, EnumDevicesCallback, NULL, DIEDFL_ATTACHEDONLY );
|
||||
hr = g_dinput->EnumDevices( DI8DEVTYPE_KEYBOARD, EnumDevicesCallback, nullptr, DIEDFL_ATTACHEDONLY );
|
||||
if( hr != DI_OK )
|
||||
RageException::Throw( hr_ssprintf(hr, "InputHandler_DInput: IDirectInput::EnumDevices") );
|
||||
|
||||
LOG->Trace( "InputHandler_DInput: IDirectInput::EnumDevices(DIDEVTYPE_JOYSTICK)" );
|
||||
hr = g_dinput->EnumDevices( DI8DEVTYPE_JOYSTICK, EnumDevicesCallback, NULL, DIEDFL_ATTACHEDONLY );
|
||||
hr = g_dinput->EnumDevices( DI8DEVTYPE_JOYSTICK, EnumDevicesCallback, nullptr, DIEDFL_ATTACHEDONLY );
|
||||
if( hr != DI_OK )
|
||||
RageException::Throw( hr_ssprintf(hr, "InputHandler_DInput: IDirectInput::EnumDevices") );
|
||||
|
||||
// mouse
|
||||
LOG->Trace( "InputHandler_DInput: IDirectInput::EnumDevices(DIDEVTYPE_MOUSE)" );
|
||||
hr = g_dinput->EnumDevices( DI8DEVTYPE_MOUSE, EnumDevicesCallback, NULL, DIEDFL_ATTACHEDONLY );
|
||||
hr = g_dinput->EnumDevices( DI8DEVTYPE_MOUSE, EnumDevicesCallback, nullptr, DIEDFL_ATTACHEDONLY );
|
||||
if( hr != DI_OK )
|
||||
RageException::Throw( hr_ssprintf(hr, "InputHandler_DInput: IDirectInput::EnumDevices") );
|
||||
|
||||
@@ -731,7 +731,7 @@ void InputHandler_DInput::InputThreadMain()
|
||||
SetThreadPriorityBoost( GetCurrentThread(), FALSE );
|
||||
|
||||
vector<DIDevice*> BufferedDevices;
|
||||
HANDLE Handle = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
HANDLE Handle = CreateEvent( NULL, FALSE, FALSE, nullptr );
|
||||
for( unsigned i = 0; i < Devices.size(); ++i )
|
||||
{
|
||||
if( !Devices[i].buffered )
|
||||
|
||||
@@ -37,7 +37,7 @@ bool DIDevice::Open()
|
||||
LPDIRECTINPUTDEVICE8 tmpdevice;
|
||||
|
||||
// load joystick
|
||||
HRESULT hr = g_dinput->CreateDevice( JoystickInst.guidInstance, &tmpdevice, NULL );
|
||||
HRESULT hr = g_dinput->CreateDevice( JoystickInst.guidInstance, &tmpdevice, nullptr );
|
||||
if ( hr != DI_OK )
|
||||
{
|
||||
LOG->Info( hr_ssprintf(hr, "OpenDevice: IDirectInput_CreateDevice") );
|
||||
|
||||
@@ -355,7 +355,7 @@ void InputHandler_Linux_Event::InputThread()
|
||||
break;
|
||||
|
||||
struct timeval zero = {0,100000};
|
||||
if( select(iMaxFD+1, &fdset, NULL, NULL, &zero) <= 0 )
|
||||
if( select(iMaxFD+1, &fdset, nullptr, nullptr, &zero) <= 0 )
|
||||
continue;
|
||||
RageTimer now;
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ void InputHandler_Linux_Joystick::InputThread()
|
||||
break;
|
||||
|
||||
struct timeval zero = {0,100000};
|
||||
if( select(max_fd+1, &fdset, NULL, NULL, &zero) <= 0 )
|
||||
if( select(max_fd+1, &fdset, nullptr, nullptr, &zero) <= 0 )
|
||||
continue;
|
||||
RageTimer now;
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ void InputHandler_Linux_tty::Update()
|
||||
FD_SET(fd, &fdset);
|
||||
|
||||
struct timeval zero = {0,0};
|
||||
if ( select(fd+1, &fdset, NULL, NULL, &zero) <= 0 )
|
||||
if ( select(fd+1, &fdset, nullptr, nullptr, &zero) <= 0 )
|
||||
return;
|
||||
|
||||
unsigned char keybuf[BUFSIZ];
|
||||
|
||||
@@ -65,7 +65,7 @@ int InputHandler_MacOSX_HID::Run( void *data )
|
||||
{
|
||||
/* The function copies the information out of the structure, so the memory
|
||||
* pointed to by context does not need to persist beyond the function call. */
|
||||
CFRunLoopObserverContext context = { 0, &This->m_Sem, NULL, NULL, NULL };
|
||||
CFRunLoopObserverContext context = { 0, &This->m_Sem, nullptr, nullptr, nullptr };
|
||||
CFRunLoopObserverRef o = CFRunLoopObserverCreate( kCFAllocatorDefault, kCFRunLoopEntry,
|
||||
false, 0, RunLoopStarted, &context);
|
||||
CFRunLoopAddObserver( This->m_LoopRef, o, kCFRunLoopDefaultMode );
|
||||
@@ -82,7 +82,7 @@ int InputHandler_MacOSX_HID::Run( void *data )
|
||||
void *info = This->m_LoopRef;
|
||||
void (*perform)(void *) = (void (*)(void *))CFRunLoopStop;
|
||||
// { version, info, retain, release, copyDescription, equal, hash, schedule, cancel, perform }
|
||||
CFRunLoopSourceContext context = { 0, info, NULL, NULL, NULL, NULL, NULL, NULL, NULL, perform };
|
||||
CFRunLoopSourceContext context = { 0, info, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, perform };
|
||||
|
||||
// Pass 1 so that it is called after all inputs have been handled (they will have order = 0)
|
||||
This->m_SourceRef = CFRunLoopSourceCreate( kCFAllocatorDefault, 1, &context );
|
||||
|
||||
@@ -27,7 +27,7 @@ InputHandler_Win32_Pump::InputHandler_Win32_Pump()
|
||||
const int pump_usb_pid = pump_usb_pids[p];
|
||||
for( int i = 0; i < NUM_PUMPS; ++i )
|
||||
{
|
||||
if( m_pDevice[i].Open(pump_usb_vid, pump_usb_pid, sizeof(long), i, NULL) )
|
||||
if( m_pDevice[i].Open(pump_usb_vid, pump_usb_pid, sizeof(long), i, nullptr) )
|
||||
{
|
||||
iNumFound++;
|
||||
LOG->Info( "Found Pump pad %i", iNumFound );
|
||||
|
||||
@@ -79,7 +79,7 @@ GdkPixbuf *MakePixbuf( const RageSurface *pSrc )
|
||||
RageSurfaceUtils::Blit( pSrc, pSurface , -1, -1 );
|
||||
|
||||
GdkPixbuf *pBuf = gdk_pixbuf_new_from_data( pSurface->pixels, GDK_COLORSPACE_RGB,
|
||||
true, 8, pSurface->w, pSurface->h , pSurface->pitch, DeletePixels, NULL);
|
||||
true, 8, pSurface->w, pSurface->h , pSurface->pitch, DeletePixels, nullptr);
|
||||
|
||||
if( pBuf != nullptr )
|
||||
pSurface->pixels_owned = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ static HBITMAP LoadWin32Surface( const RageSurface *pSplash, HWND hWnd )
|
||||
}
|
||||
}
|
||||
|
||||
SelectObject( BitmapDC, NULL );
|
||||
SelectObject( BitmapDC, nullptr );
|
||||
DeleteObject( BitmapDC );
|
||||
|
||||
ReleaseDC( NULL, hScreen );
|
||||
@@ -144,7 +144,7 @@ void LoadingWindow_Win32::SetSplash( const RageSurface *pSplash )
|
||||
LoadingWindow_Win32::LoadingWindow_Win32()
|
||||
{
|
||||
m_hIcon = nullptr;
|
||||
hwnd = CreateDialog( handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, WndProc );
|
||||
hwnd = CreateDialog( handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), nullptr, WndProc );
|
||||
for( unsigned i = 0; i < 3; ++i )
|
||||
text[i] = "ABC"; /* always set on first call */
|
||||
SetText( "" );
|
||||
|
||||
@@ -255,7 +255,7 @@ void RenderTarget_MacOSX::Create( const RenderTargetParam ¶m, int &iTextureW
|
||||
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, param.bWithAlpha? GL_RGBA8:GL_RGB8,
|
||||
iTextureWidth, iTextureHeight, 0, param.bWithAlpha? GL_RGBA:GL_RGB,
|
||||
GL_UNSIGNED_BYTE, NULL );
|
||||
GL_UNSIGNED_BYTE, nullptr );
|
||||
GLenum error = glGetError();
|
||||
ASSERT_M(error == GL_NO_ERROR, RageDisplay_Legacy_Helpers::GLToString(error));
|
||||
|
||||
@@ -483,10 +483,10 @@ int LowLevelWindow_MacOSX::ChangeDisplayMode( const VideoModeParams& p )
|
||||
}
|
||||
|
||||
if( p.rate == REFRESH_DEFAULT )
|
||||
newMode = CGDisplayBestModeForParameters( kCGDirectMainDisplay, p.bpp, p.width, p.height, NULL );
|
||||
newMode = CGDisplayBestModeForParameters( kCGDirectMainDisplay, p.bpp, p.width, p.height, nullptr );
|
||||
else
|
||||
newMode = CGDisplayBestModeForParametersAndRefreshRate( kCGDirectMainDisplay, p.bpp,
|
||||
p.width, p.height, p.rate, NULL );
|
||||
p.width, p.height, p.rate, nullptr );
|
||||
|
||||
|
||||
err = CGDisplaySwitchToMode( kCGDirectMainDisplay, newMode );
|
||||
|
||||
@@ -20,7 +20,7 @@ static void DestroyGraphicsWindowAndOpenGLContext()
|
||||
{
|
||||
if( g_HGLRC != nullptr )
|
||||
{
|
||||
wglMakeCurrent( NULL, NULL );
|
||||
wglMakeCurrent( NULL, nullptr );
|
||||
wglDeleteContext( g_HGLRC );
|
||||
g_HGLRC = nullptr;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew
|
||||
LOG->Trace( "Mode requires new pixel format, and we've already set one; resetting OpenGL context" );
|
||||
if( g_HGLRC != nullptr )
|
||||
{
|
||||
wglMakeCurrent( NULL, NULL );
|
||||
wglMakeCurrent( NULL, nullptr );
|
||||
wglDeleteContext( g_HGLRC );
|
||||
g_HGLRC = nullptr;
|
||||
wglDeleteContext( g_HGLRC_Background );
|
||||
@@ -262,7 +262,7 @@ void LowLevelWindow_Win32::BeginConcurrentRendering()
|
||||
|
||||
void LowLevelWindow_Win32::EndConcurrentRendering()
|
||||
{
|
||||
wglMakeCurrent( NULL, NULL );
|
||||
wglMakeCurrent( NULL, nullptr );
|
||||
}
|
||||
|
||||
static LocalizedString OPENGL_NOT_AVAILABLE( "LowLevelWindow_Win32", "OpenGL hardware acceleration is not available." );
|
||||
@@ -357,7 +357,7 @@ void RenderTarget_Win32::Create(const RenderTargetParam ¶m, int &iTextureWid
|
||||
internalformat = param.bWithAlpha? GL_RGBA8:GL_RGB8;
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalformat, iTextureWidth,
|
||||
iTextureHeight, 0, type, GL_UNSIGNED_BYTE, NULL);
|
||||
iTextureHeight, 0, type, GL_UNSIGNED_BYTE, nullptr);
|
||||
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
|
||||
@@ -151,7 +151,7 @@ RString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDe
|
||||
glXDestroyContext( Dpy, g_pContext );
|
||||
if( g_pBackgroundContext )
|
||||
glXDestroyContext( Dpy, g_pBackgroundContext );
|
||||
g_pContext = glXCreateContext( Dpy, xvi, NULL, True );
|
||||
g_pContext = glXCreateContext( Dpy, xvi, nullptr, True );
|
||||
g_pBackgroundContext = glXCreateContext( Dpy, xvi, g_pContext, True );
|
||||
|
||||
glXMakeCurrent( Dpy, Win, g_pContext );
|
||||
@@ -459,7 +459,7 @@ void RenderTarget_X11::Create( const RenderTargetParam ¶m, int &iTextureWidt
|
||||
iTextureHeightOut = iTextureHeight;
|
||||
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, param.bWithAlpha? GL_RGBA8:GL_RGB8,
|
||||
iTextureWidth, iTextureHeight, 0, param.bWithAlpha? GL_RGBA:GL_RGB, GL_UNSIGNED_BYTE, NULL );
|
||||
iTextureWidth, iTextureHeight, 0, param.bWithAlpha? GL_RGBA:GL_RGB, GL_UNSIGNED_BYTE, nullptr );
|
||||
GLenum error = glGetError();
|
||||
ASSERT_M( error == GL_NO_ERROR, GLToString(error) );
|
||||
|
||||
@@ -505,7 +505,7 @@ bool LowLevelWindow_X11::SupportsRenderToTexture() const
|
||||
{
|
||||
// Server must support pbuffers:
|
||||
const int iScreen = DefaultScreen( Dpy );
|
||||
float fVersion = strtof( glXQueryServerString(Dpy, iScreen, GLX_VERSION), NULL );
|
||||
float fVersion = strtof( glXQueryServerString(Dpy, iScreen, GLX_VERSION), nullptr );
|
||||
if( fVersion < 1.3f )
|
||||
return false;
|
||||
|
||||
@@ -540,7 +540,7 @@ void LowLevelWindow_X11::BeginConcurrentRendering()
|
||||
|
||||
void LowLevelWindow_X11::EndConcurrentRendering()
|
||||
{
|
||||
bool b = glXMakeCurrent( Dpy, None, NULL );
|
||||
bool b = glXMakeCurrent( Dpy, None, nullptr );
|
||||
ASSERT(b);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ bool MemoryCardDriverThreaded_MacOSX::USBStorageDevicesChanged()
|
||||
|
||||
static int GetIntProperty( io_registry_entry_t entry, CFStringRef key )
|
||||
{
|
||||
CFTypeRef t = IORegistryEntryCreateCFProperty( entry, key, NULL, 0 );
|
||||
CFTypeRef t = IORegistryEntryCreateCFProperty( entry, key, nullptr, 0 );
|
||||
|
||||
if( !t )
|
||||
return -1;
|
||||
@@ -100,7 +100,7 @@ static int GetIntProperty( io_registry_entry_t entry, CFStringRef key )
|
||||
|
||||
static RString GetStringProperty( io_registry_entry_t entry, CFStringRef key )
|
||||
{
|
||||
CFTypeRef t = IORegistryEntryCreateCFProperty( entry, key, NULL, 0 );
|
||||
CFTypeRef t = IORegistryEntryCreateCFProperty( entry, key, nullptr, 0 );
|
||||
|
||||
if( !t )
|
||||
return RString();
|
||||
|
||||
@@ -47,7 +47,7 @@ bool MemoryCardDriverThreaded_Windows::TestWrite( UsbStorageDevice* pDevice )
|
||||
{
|
||||
HANDLE hFile = CreateFile( ssprintf( "%stmp%i", pDevice->sOsMountDir.c_str(), RandomInt(100000)),
|
||||
GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, CREATE_NEW, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL );
|
||||
NULL, CREATE_NEW, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, nullptr );
|
||||
|
||||
if( hFile == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
@@ -193,7 +193,7 @@ void MemoryCardDriverThreaded_Windows::Unmount( UsbStorageDevice* pDevice )
|
||||
/* Try to flush the device before returning. This requires administrator priviliges. */
|
||||
HANDLE hDevice = CreateFile( pDevice->sDevice, GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr );
|
||||
|
||||
if( hDevice == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
|
||||
@@ -345,7 +345,7 @@ RString MovieTexture_DShow::Create()
|
||||
RageException::Throw( hr_ssprintf(hr, "Could not CoInitialize") );
|
||||
|
||||
// Create the filter graph
|
||||
if( FAILED( hr=m_pGB.CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC) ) )
|
||||
if( FAILED( hr=m_pGB.CoCreateInstance(CLSID_FilterGraph, nullptr, CLSCTX_INPROC) ) )
|
||||
RageException::Throw( hr_ssprintf(hr, "Could not create CLSID_FilterGraph!") );
|
||||
|
||||
// Create the Texture Renderer object
|
||||
|
||||
@@ -13,7 +13,7 @@ struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureR
|
||||
static HRESULT CBV_ret;
|
||||
CTextureRenderer::CTextureRenderer():
|
||||
CBaseVideoRenderer(__uuidof(CLSID_TextureRenderer),
|
||||
NAME("Texture Renderer"), NULL, &CBV_ret),
|
||||
NAME("Texture Renderer"), nullptr, &CBV_ret),
|
||||
m_OneFrameDecoded( "m_OneFrameDecoded", 0 )
|
||||
{
|
||||
if( FAILED(CBV_ret) )
|
||||
|
||||
@@ -547,7 +547,7 @@ void MovieDecoder_FFMpeg::GetFrame( RageSurface *pSurface )
|
||||
m_swsctx = avcodec::sws_getCachedContext( m_swsctx,
|
||||
GetWidth(), GetHeight(), m_pStream->codec->pix_fmt,
|
||||
GetWidth(), GetHeight(), m_AVTexfmt,
|
||||
sws_flags, NULL, NULL, NULL );
|
||||
sws_flags, nullptr, nullptr, nullptr );
|
||||
if( m_swsctx == nullptr )
|
||||
{
|
||||
LOG->Warn("Cannot initialize sws conversion context for (%d,%d) %d->%d", GetWidth(), GetHeight(), m_pStream->codec->pix_fmt, m_AVTexfmt);
|
||||
@@ -631,17 +631,17 @@ RString MovieDecoder_FFMpeg::Open( RString sFile )
|
||||
}
|
||||
|
||||
m_buffer = (unsigned char *)avcodec::av_malloc(STEPMANIA_FFMPEG_BUFFER_SIZE);
|
||||
m_avioContext = avcodec::avio_alloc_context(m_buffer, STEPMANIA_FFMPEG_BUFFER_SIZE, 0, f, AVIORageFile_ReadPacket, NULL, AVIORageFile_Seek);
|
||||
m_avioContext = avcodec::avio_alloc_context(m_buffer, STEPMANIA_FFMPEG_BUFFER_SIZE, 0, f, AVIORageFile_ReadPacket, nullptr, AVIORageFile_Seek);
|
||||
m_fctx->pb = m_avioContext;
|
||||
int ret = avcodec::avformat_open_input( &m_fctx, sFile.c_str(), NULL, NULL );
|
||||
int ret = avcodec::avformat_open_input( &m_fctx, sFile.c_str(), nullptr, nullptr );
|
||||
if( ret < 0 )
|
||||
return RString( averr_ssprintf(ret, "AVCodec: Couldn't open \"%s\"", sFile.c_str()) );
|
||||
|
||||
ret = avcodec::avformat_find_stream_info( m_fctx, NULL );
|
||||
ret = avcodec::avformat_find_stream_info( m_fctx, nullptr );
|
||||
if( ret < 0 )
|
||||
return RString( averr_ssprintf(ret, "AVCodec (%s): Couldn't find codec parameters", sFile.c_str()) );
|
||||
|
||||
int stream_idx = avcodec::av_find_best_stream( m_fctx, avcodec::AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0 );
|
||||
int stream_idx = avcodec::av_find_best_stream( m_fctx, avcodec::AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0 );
|
||||
if ( stream_idx < 0 ||
|
||||
static_cast<unsigned int>(stream_idx) >= m_fctx->nb_streams ||
|
||||
m_fctx->streams[stream_idx] == nullptr )
|
||||
@@ -682,7 +682,7 @@ RString MovieDecoder_FFMpeg::OpenCodec()
|
||||
|
||||
LOG->Trace("Opening codec %s", pCodec->name );
|
||||
|
||||
int ret = avcodec::avcodec_open2( m_pStream->codec, pCodec, NULL );
|
||||
int ret = avcodec::avcodec_open2( m_pStream->codec, pCodec, nullptr );
|
||||
if( ret < 0 )
|
||||
return RString( averr_ssprintf(ret, "Couldn't open codec \"%s\"", pCodec->name) );
|
||||
ASSERT( m_pStream->codec->codec != nullptr );
|
||||
|
||||
@@ -162,7 +162,7 @@ private:
|
||||
m_SurfaceFormat.Mask[0],
|
||||
m_SurfaceFormat.Mask[1],
|
||||
m_SurfaceFormat.Mask[2],
|
||||
m_SurfaceFormat.Mask[3], NULL, 1 );
|
||||
m_SurfaceFormat.Mask[3], nullptr, 1 );
|
||||
|
||||
m_uTexHandle = DISPLAY->CreateTexture( m_PixFmt, pSurface, false );
|
||||
delete pSurface;
|
||||
|
||||
@@ -46,7 +46,7 @@ void DSound::SetPrimaryBufferMode()
|
||||
format.lpwfxFormat = nullptr;
|
||||
|
||||
IDirectSoundBuffer *pBuffer;
|
||||
HRESULT hr = this->GetDS()->CreateSoundBuffer( &format, &pBuffer, NULL );
|
||||
HRESULT hr = this->GetDS()->CreateSoundBuffer( &format, &pBuffer, nullptr );
|
||||
if( FAILED(hr) )
|
||||
{
|
||||
LOG->Warn(hr_ssprintf(hr, "Couldn't create primary buffer"));
|
||||
@@ -106,7 +106,7 @@ DSound::DSound()
|
||||
RString DSound::Init()
|
||||
{
|
||||
HRESULT hr;
|
||||
if( FAILED( hr = DirectSoundCreate(NULL, &m_pDS, NULL) ) )
|
||||
if( FAILED( hr = DirectSoundCreate(NULL, &m_pDS, nullptr) ) )
|
||||
return hr_ssprintf( hr, "DirectSoundCreate" );
|
||||
|
||||
static bool bShownInfo = false;
|
||||
@@ -228,7 +228,7 @@ RString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware,
|
||||
|
||||
format.lpwfxFormat = &waveformat;
|
||||
|
||||
HRESULT hr = ds.GetDS()->CreateSoundBuffer( &format, &m_pBuffer, NULL );
|
||||
HRESULT hr = ds.GetDS()->CreateSoundBuffer( &format, &m_pBuffer, nullptr );
|
||||
if( FAILED(hr) )
|
||||
return hr_ssprintf( hr, "CreateSoundBuffer failed (%i hz)", m_iSampleBits );
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ static void SetSampleRate( AudioUnit au, Float64 desiredRate )
|
||||
return;
|
||||
|
||||
if( (error = AudioDeviceGetPropertyInfo(OutputDevice, 0, false, kAudioDevicePropertyAvailableNominalSampleRates,
|
||||
&size, NULL)) )
|
||||
&size, nullptr)) )
|
||||
{
|
||||
LOG->Warn( WERROR("Couldn't get available nominal sample rates info", error) );
|
||||
return;
|
||||
@@ -114,7 +114,7 @@ static void SetSampleRate( AudioUnit au, Float64 desiredRate )
|
||||
if( bestRate == 0.0 )
|
||||
return;
|
||||
|
||||
if( (error = AudioDeviceSetProperty(OutputDevice, NULL, 0, false, kAudioDevicePropertyNominalSampleRate,
|
||||
if( (error = AudioDeviceSetProperty(OutputDevice, nullptr, 0, false, kAudioDevicePropertyNominalSampleRate,
|
||||
sizeof(Float64), &bestRate)) )
|
||||
{
|
||||
LOG->Warn( WERROR("Couldn't set the device's sample rate", error) );
|
||||
@@ -204,7 +204,7 @@ RString RageSoundDriver_AU::Init()
|
||||
{
|
||||
CFRunLoopObserverRef observerRef;
|
||||
CFRunLoopRef runLoopRef;
|
||||
CFRunLoopObserverContext context = { 0, this, NULL, NULL, NULL };
|
||||
CFRunLoopObserverContext context = { 0, this, nullptr, nullptr, nullptr };
|
||||
UInt32 size = sizeof( CFRunLoopRef );
|
||||
|
||||
if( (error = AudioHardwareGetProperty(kAudioHardwarePropertyRunLoop, &size, &runLoopRef)) )
|
||||
@@ -300,7 +300,7 @@ float RageSoundDriver_AU::GetPlayLatency() const
|
||||
size = sizeof( UInt32 );
|
||||
|
||||
do {
|
||||
if( (error = AudioDeviceGetPropertyInfo(OutputDevice, 0, false, kAudioDevicePropertyStreams, &size, NULL)) )
|
||||
if( (error = AudioDeviceGetPropertyInfo(OutputDevice, 0, false, kAudioDevicePropertyStreams, &size, nullptr)) )
|
||||
{
|
||||
LOG->Warn( WERROR("Device has no streams", error) );
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,7 @@ void RageSoundDriver_OSS::MixerThread()
|
||||
usleep( 10000 );
|
||||
|
||||
struct timeval tv = { 0, 10000 };
|
||||
select(fd+1, NULL, &f, NULL, &tv);
|
||||
select(fd+1, nullptr, &f, nullptr, &tv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ RString RageSoundDriver_PulseAudio::Init()
|
||||
pa_context_set_state_callback(m_PulseCtx, StaticCtxStateCb, this);
|
||||
|
||||
LOG->Trace("Pulse: pa_context_connect()...");
|
||||
error = pa_context_connect(m_PulseCtx, NULL, (pa_context_flags_t)0, NULL);
|
||||
error = pa_context_connect(m_PulseCtx, nullptr, (pa_context_flags_t)0, nullptr);
|
||||
|
||||
if(error < 0)
|
||||
{
|
||||
@@ -224,8 +224,8 @@ void RageSoundDriver_PulseAudio::m_InitStream(void)
|
||||
|
||||
/* connect the stream for playback */
|
||||
LOG->Trace("Pulse: pa_stream_connect_playback()...");
|
||||
error = pa_stream_connect_playback(m_PulseStream, NULL, &attr,
|
||||
PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL);
|
||||
error = pa_stream_connect_playback(m_PulseStream, nullptr, &attr,
|
||||
PA_STREAM_AUTO_TIMING_UPDATE, nullptr, nullptr);
|
||||
if(error < 0)
|
||||
{
|
||||
if(asprintf(&m_Error, "pa_stream_connect_playback(): %s",
|
||||
@@ -316,7 +316,7 @@ void RageSoundDriver_PulseAudio::StreamWriteCb(pa_stream *s, size_t length)
|
||||
int64_t pos1 = m_LastPosition;
|
||||
int64_t pos2 = pos1 + nbframes/2; /* Mix() position in stereo frames */
|
||||
this->Mix( buf, pos2-pos1, pos1, pos2);
|
||||
if(pa_stream_write(m_PulseStream, buf, length, NULL, 0, PA_SEEK_RELATIVE) < 0)
|
||||
if(pa_stream_write(m_PulseStream, buf, length, nullptr, 0, PA_SEEK_RELATIVE) < 0)
|
||||
{
|
||||
RageException::Throw("Pulse: pa_stream_write()");
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ static bool WdmSyncIoctl(
|
||||
|
||||
OVERLAPPED overlapped;
|
||||
memset( &overlapped, 0, sizeof(overlapped) );
|
||||
overlapped.hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
overlapped.hEvent = CreateEvent( NULL, FALSE, FALSE, nullptr );
|
||||
if( !overlapped.hEvent )
|
||||
{
|
||||
sError = werr_ssprintf( GetLastError(), "CreateEvent" );
|
||||
@@ -201,7 +201,7 @@ static bool WdmGetPropertySimple( HANDLE hHandle, const GUID *pGuidPropertySet,
|
||||
if( pInstance )
|
||||
memcpy( &ksProperty[1], pInstance, iInstanceSize );
|
||||
|
||||
return WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, ksProperty, iPropertySize, pValue, iValueSize, NULL, sError );
|
||||
return WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, ksProperty, iPropertySize, pValue, iValueSize, nullptr, sError );
|
||||
}
|
||||
|
||||
static bool WdmSetPropertySimple(
|
||||
@@ -222,7 +222,7 @@ static bool WdmSetPropertySimple(
|
||||
if( instance )
|
||||
memcpy( ((char*)ksProperty + sizeof(KSPROPERTY)), instance, iInstanceSize );
|
||||
|
||||
return WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, ksProperty, iPropertySize, pValue, iValueSize, NULL, sError );
|
||||
return WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, ksProperty, iPropertySize, pValue, iValueSize, nullptr, sError );
|
||||
}
|
||||
|
||||
static bool WdmGetPinPropertySimple( HANDLE hHandle, unsigned long iPinId, const GUID *pGuidPropertySet, unsigned long iProperty,
|
||||
@@ -235,7 +235,7 @@ static bool WdmGetPinPropertySimple( HANDLE hHandle, unsigned long iPinId, const
|
||||
ksPProp.PinId = iPinId;
|
||||
ksPProp.Reserved = 0;
|
||||
|
||||
return WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, &ksPProp, sizeof(KSP_PIN), pValue, iInstanceSize, NULL, sError );
|
||||
return WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, &ksPProp, sizeof(KSP_PIN), pValue, iInstanceSize, nullptr, sError );
|
||||
}
|
||||
|
||||
static bool WdmGetPinPropertyMulti(
|
||||
@@ -255,13 +255,13 @@ static bool WdmGetPinPropertyMulti(
|
||||
ksPProp.Reserved = 0;
|
||||
|
||||
unsigned long multipleItemSize = 0;
|
||||
if( !WdmSyncIoctl(hHandle, IOCTL_KS_PROPERTY, &ksPProp.Property, sizeof(KSP_PIN), NULL, 0, &multipleItemSize, sError) )
|
||||
if( !WdmSyncIoctl(hHandle, IOCTL_KS_PROPERTY, &ksPProp.Property, sizeof(KSP_PIN), nullptr, 0, &multipleItemSize, sError) )
|
||||
return false;
|
||||
|
||||
*ksMultipleItem = (KSMULTIPLE_ITEM*) malloc( multipleItemSize );
|
||||
ASSERT( *ksMultipleItem != nullptr );
|
||||
|
||||
if( !WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, &ksPProp, sizeof(KSP_PIN), (void*)*ksMultipleItem, multipleItemSize, NULL, sError) )
|
||||
if( !WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, &ksPProp, sizeof(KSP_PIN), (void*)*ksMultipleItem, multipleItemSize, nullptr, sError) )
|
||||
{
|
||||
free( ksMultipleItem );
|
||||
return false;
|
||||
@@ -442,7 +442,7 @@ bool WinWdmPin::SetState( KSSTATE state, RString &sError )
|
||||
{
|
||||
ASSERT( m_hHandle != nullptr );
|
||||
return WdmSetPropertySimple( m_hHandle, &KSPROPSETID_Connection, KSPROPERTY_CONNECTION_STATE,
|
||||
&state, sizeof(state), NULL, 0, sError );
|
||||
&state, sizeof(state), nullptr, 0, sError );
|
||||
}
|
||||
|
||||
bool WinWdmPin::Instantiate( const WAVEFORMATEX *pFormat, RString &sError )
|
||||
@@ -587,7 +587,7 @@ bool WinWdmFilter::Use( RString &sError )
|
||||
{
|
||||
/* Open the filter */
|
||||
m_hHandle = CreateFile( m_sFilterName, GENERIC_READ | GENERIC_WRITE, 0,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL );
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, nullptr );
|
||||
|
||||
if( m_hHandle == nullptr )
|
||||
{
|
||||
@@ -804,7 +804,7 @@ static bool GetDevicePath( HANDLE hHandle, SP_DEVICE_INTERFACE_DATA *pInterfaceD
|
||||
devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
devInfoData.Reserved = 0;
|
||||
|
||||
if( !SetupDiGetDeviceInterfaceDetail(hHandle, pInterfaceData, devInterfaceDetails, sizeInterface, NULL, &devInfoData) )
|
||||
if( !SetupDiGetDeviceInterfaceDetail(hHandle, pInterfaceData, devInterfaceDetails, sizeInterface, nullptr, &devInfoData) )
|
||||
return false;
|
||||
sPath = devInterfaceDetails->DevicePath;
|
||||
return true;
|
||||
@@ -816,7 +816,7 @@ static bool BuildFilterList( vector<WinWdmFilter*> &aFilters, RString &sError )
|
||||
const GUID *pCategoryGuid = (GUID*) &KSCATEGORY_RENDER;
|
||||
|
||||
/* Open a handle to search for devices (filters) */
|
||||
HDEVINFO hHandle = SetupDiGetClassDevs( pCategoryGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE );
|
||||
HDEVINFO hHandle = SetupDiGetClassDevs( pCategoryGuid, nullptr, nullptr, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE );
|
||||
if( hHandle == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
sError = werr_ssprintf( GetLastError(), "SetupDiGetClassDevs" );
|
||||
@@ -831,7 +831,7 @@ static bool BuildFilterList( vector<WinWdmFilter*> &aFilters, RString &sError )
|
||||
SP_DEVICE_INTERFACE_DATA interfaceData;
|
||||
interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
|
||||
interfaceData.Reserved = 0;
|
||||
if( !SetupDiEnumDeviceInterfaces(hHandle, NULL, pCategoryGuid, device, &interfaceData) )
|
||||
if( !SetupDiEnumDeviceInterfaces(hHandle, nullptr, pCategoryGuid, device, &interfaceData) )
|
||||
break; /* No more devices */
|
||||
if( !interfaceData.Flags || (interfaceData.Flags & SPINT_REMOVED) )
|
||||
continue;
|
||||
@@ -899,7 +899,7 @@ struct WinWdmStream
|
||||
{
|
||||
memset( this, 0, sizeof(*this) );
|
||||
for( int i = 0; i < MAX_CHUNKS; ++i )
|
||||
m_Signal[i].hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
m_Signal[i].hEvent = CreateEvent( NULL, FALSE, FALSE, nullptr );
|
||||
m_pPlaybackPin = nullptr;
|
||||
}
|
||||
|
||||
@@ -969,12 +969,12 @@ bool WinWdmStream::Open( WinWdmFilter *pFilter,
|
||||
KSALLOCATOR_FRAMING ksaf;
|
||||
KSALLOCATOR_FRAMING_EX ksafex;
|
||||
if( WdmGetPropertySimple(m_pPlaybackPin->m_hHandle, &KSPROPSETID_Connection, KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
|
||||
&ksaf, sizeof(ksaf), NULL, 0, sError) )
|
||||
&ksaf, sizeof(ksaf), nullptr, 0, sError) )
|
||||
{
|
||||
iFrameSize = ksaf.FrameSize;
|
||||
}
|
||||
else if( WdmGetPropertySimple(m_pPlaybackPin->m_hHandle, &KSPROPSETID_Connection, KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX,
|
||||
&ksafex, sizeof(ksafex), NULL, 0, sError) )
|
||||
&ksafex, sizeof(ksafex), nullptr, 0, sError) )
|
||||
{
|
||||
iFrameSize = ksafex.FramingItem[0].FramingRange.Range.MinFrameSize;
|
||||
}
|
||||
@@ -1021,8 +1021,8 @@ error:
|
||||
bool WinWdmStream::SubmitPacket( int iPacket, RString &sError )
|
||||
{
|
||||
KSSTREAM_HEADER *p = &m_Packets[iPacket];
|
||||
int iRet = DeviceIoControl( m_pPlaybackPin->m_hHandle, IOCTL_KS_WRITE_STREAM, NULL, 0,
|
||||
p, p->Size, NULL, &m_Signal[iPacket] );
|
||||
int iRet = DeviceIoControl( m_pPlaybackPin->m_hHandle, IOCTL_KS_WRITE_STREAM, nullptr, 0,
|
||||
p, p->Size, nullptr, &m_Signal[iPacket] );
|
||||
ASSERT_M( iRet == 0, "DeviceIoControl" );
|
||||
|
||||
DWORD iError = GetLastError();
|
||||
@@ -1254,7 +1254,7 @@ int64_t RageSoundDriver_WDMKS::GetPosition() const
|
||||
|
||||
RString sError;
|
||||
WdmGetPropertySimple( m_pStream->m_pPlaybackPin->m_hHandle, &KSPROPSETID_Audio, KSPROPERTY_AUDIO_POSITION,
|
||||
&pos, sizeof(pos), NULL, 0, sError );
|
||||
&pos, sizeof(pos), nullptr, 0, sError );
|
||||
ASSERT_M( sError == "", sError );
|
||||
|
||||
pos.PlayOffset /= m_pStream->m_iBytesPerOutputSample * m_pStream->m_iDeviceOutputChannels;
|
||||
@@ -1267,7 +1267,7 @@ RageSoundDriver_WDMKS::RageSoundDriver_WDMKS()
|
||||
m_pFilter = nullptr;
|
||||
m_bShutdown = false;
|
||||
m_iLastCursorPos = 0;
|
||||
m_hSignal = CreateEvent( NULL, FALSE, FALSE, NULL ); /* abort event */
|
||||
m_hSignal = CreateEvent( NULL, FALSE, FALSE, nullptr ); /* abort event */
|
||||
}
|
||||
|
||||
RString RageSoundDriver_WDMKS::Init()
|
||||
|
||||
@@ -104,7 +104,7 @@ RageSoundDriver_WaveOut::RageSoundDriver_WaveOut()
|
||||
m_bShutdown = false;
|
||||
m_iLastCursorPos = 0;
|
||||
|
||||
m_hSoundEvent = CreateEvent( NULL, false, true, NULL );
|
||||
m_hSoundEvent = CreateEvent( NULL, false, true, nullptr );
|
||||
|
||||
m_hWaveOut = nullptr;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ ThreadImpl *MakeThread( int (*pFunc)(void *pData), void *pData, uint64_t *piThre
|
||||
|
||||
thread->m_StartFinishedSem = new SemaImpl_Pthreads( 0 );
|
||||
|
||||
int ret = pthread_create( &thread->thread, NULL, StartThread, thread );
|
||||
int ret = pthread_create( &thread->thread, nullptr, StartThread, thread );
|
||||
ASSERT_M( ret == 0, ssprintf( "MakeThread: pthread_create: %s", strerror(errno)) );
|
||||
|
||||
// Don't return until StartThread sets m_piThreadID.
|
||||
@@ -94,7 +94,7 @@ ThreadImpl *MakeThread( int (*pFunc)(void *pData), void *pData, uint64_t *piThre
|
||||
MutexImpl_Pthreads::MutexImpl_Pthreads( RageMutex *pParent ):
|
||||
MutexImpl( pParent )
|
||||
{
|
||||
pthread_mutex_init( &mutex, NULL );
|
||||
pthread_mutex_init( &mutex, nullptr );
|
||||
}
|
||||
|
||||
MutexImpl_Pthreads::~MutexImpl_Pthreads()
|
||||
@@ -129,7 +129,7 @@ bool MutexImpl_Pthreads::Lock()
|
||||
/* Wait for ten seconds. If it takes longer than that, we're
|
||||
* probably deadlocked. */
|
||||
timeval tv;
|
||||
gettimeofday( &tv, NULL );
|
||||
gettimeofday( &tv, nullptr );
|
||||
|
||||
timespec ts;
|
||||
ts.tv_sec = tv.tv_sec + len;
|
||||
@@ -327,7 +327,7 @@ bool EventImpl_Pthreads::Wait( RageTimer *pTimeout )
|
||||
{
|
||||
// The RageTimer clock is different than the wait clock; convert it.
|
||||
timeval tv;
|
||||
gettimeofday( &tv, NULL );
|
||||
gettimeofday( &tv, nullptr );
|
||||
|
||||
RageTimer timeofday( tv.tv_sec, tv.tv_usec );
|
||||
|
||||
@@ -427,9 +427,9 @@ bool SemaImpl_Pthreads::TryWait()
|
||||
// Use conditions, to work around OS X "forgetting" to implement semaphores.
|
||||
SemaImpl_Pthreads::SemaImpl_Pthreads( int iInitialValue )
|
||||
{
|
||||
int ret = pthread_cond_init( &m_Cond, NULL );
|
||||
int ret = pthread_cond_init( &m_Cond, nullptr );
|
||||
ASSERT_M( ret == 0, ssprintf( "SemaImpl_Pthreads: pthread_cond_init: %s", strerror(errno)) );
|
||||
ret = pthread_mutex_init( &m_Mutex, NULL );
|
||||
ret = pthread_mutex_init( &m_Mutex, nullptr );
|
||||
ASSERT_M( ret == 0, ssprintf( "SemaImpl_Pthreads: pthread_mutex_init: %s", strerror(errno)) );
|
||||
|
||||
m_iValue = iInitialValue;
|
||||
@@ -456,7 +456,7 @@ bool SemaImpl_Pthreads::Wait()
|
||||
if( UseTimedlock() )
|
||||
{
|
||||
timeval tv;
|
||||
gettimeofday( &tv, NULL );
|
||||
gettimeofday( &tv, nullptr );
|
||||
|
||||
/* Wait for ten seconds. If it takes longer than that, we're probably deadlocked. */
|
||||
timespec ts;
|
||||
|
||||
@@ -174,7 +174,7 @@ ThreadImpl *MakeThread( int (*pFunc)(void *pData), void *pData, uint64_t *piThre
|
||||
MutexImpl_Win32::MutexImpl_Win32( RageMutex *pParent ):
|
||||
MutexImpl( pParent )
|
||||
{
|
||||
mutex = CreateMutex( NULL, false, NULL );
|
||||
mutex = CreateMutex( NULL, false, nullptr );
|
||||
ASSERT_M( mutex != nullptr, werr_ssprintf(GetLastError(), "CreateMutex") );
|
||||
}
|
||||
|
||||
@@ -263,9 +263,9 @@ EventImpl_Win32::EventImpl_Win32( MutexImpl_Win32 *pParent )
|
||||
{
|
||||
m_pParent = pParent;
|
||||
m_iNumWaiting = 0;
|
||||
m_WakeupSema = CreateSemaphore( NULL, 0, 0x7fffffff, NULL );
|
||||
m_WakeupSema = CreateSemaphore( NULL, 0, 0x7fffffff, nullptr );
|
||||
InitializeCriticalSection( &m_iNumWaitingLock );
|
||||
m_WaitersDone = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
m_WaitersDone = CreateEvent( NULL, FALSE, FALSE, nullptr );
|
||||
}
|
||||
|
||||
EventImpl_Win32::~EventImpl_Win32()
|
||||
@@ -432,7 +432,7 @@ EventImpl *MakeEvent( MutexImpl *pMutex )
|
||||
|
||||
SemaImpl_Win32::SemaImpl_Win32( int iInitialValue )
|
||||
{
|
||||
sem = CreateSemaphore( NULL, iInitialValue, 999999999, NULL );
|
||||
sem = CreateSemaphore( NULL, iInitialValue, 999999999, nullptr );
|
||||
m_iCounter = iInitialValue;
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ SemaImpl_Win32::~SemaImpl_Win32()
|
||||
void SemaImpl_Win32::Post()
|
||||
{
|
||||
++m_iCounter;
|
||||
ReleaseSemaphore( sem, 1, NULL );
|
||||
ReleaseSemaphore( sem, 1, nullptr );
|
||||
}
|
||||
|
||||
bool SemaImpl_Win32::Wait()
|
||||
|
||||
@@ -21,7 +21,7 @@ RString CrashHandler::GetLogsDirectory()
|
||||
}
|
||||
|
||||
// XXX Can we use LocalizedString here instead?
|
||||
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") )
|
||||
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), nullptr, CFSTR("Localizable") )
|
||||
|
||||
void CrashHandler::InformUserOfCrash( const RString& sPath )
|
||||
{
|
||||
@@ -38,12 +38,12 @@ void CrashHandler::InformUserOfCrash( const RString& sPath )
|
||||
CFStringRef sFormat = LSTRING( bundle, PRODUCT_FAMILY " has crashed. "
|
||||
"Debugging information has been output to\n\n%s\n\n"
|
||||
"Please file a bug report at\n\n%s" );
|
||||
CFStringRef sBody = CFStringCreateWithFormat( kCFAllocatorDefault, NULL, sFormat,
|
||||
CFStringRef sBody = CFStringCreateWithFormat( kCFAllocatorDefault, nullptr, sFormat,
|
||||
sPath.c_str(), REPORT_BUG_URL );
|
||||
CFOptionFlags response = kCFUserNotificationCancelResponse;
|
||||
CFTimeInterval timeout = 0.0; // Should we ever time out?
|
||||
|
||||
CFUserNotificationDisplayAlert( timeout, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
|
||||
CFUserNotificationDisplayAlert( timeout, kCFUserNotificationStopAlertLevel, nullptr, nullptr, nullptr,
|
||||
sTitle, sBody, sDefault, sAlternate, sOther, &response );
|
||||
|
||||
switch( response )
|
||||
@@ -83,7 +83,7 @@ bool CrashHandler::IsDebuggerPresent()
|
||||
|
||||
// Call sysctl.
|
||||
size = sizeof( info );
|
||||
ret = sysctl( mib, sizeof(mib)/sizeof(*mib), &info, &size, NULL, 0 );
|
||||
ret = sysctl( mib, sizeof(mib)/sizeof(*mib), &info, &size, nullptr, 0 );
|
||||
|
||||
// We're being debugged if the P_TRACED flag is set.
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ protected:
|
||||
// Perform a synchronous set report on the HID interface.
|
||||
inline IOReturn SetReport( IOHIDReportType type, UInt32 reportID, void *buffer, UInt32 size, UInt32 timeoutMS )
|
||||
{
|
||||
return CALL( m_Interface, setReport, type, reportID, buffer, size, timeoutMS, NULL, NULL, NULL );
|
||||
return CALL( m_Interface, setReport, type, reportID, buffer, size, timeoutMS, nullptr, nullptr, nullptr );
|
||||
}
|
||||
public:
|
||||
HIDDevice();
|
||||
|
||||
@@ -10,7 +10,7 @@ bool Vector::CheckForVector()
|
||||
int32_t result = 0;
|
||||
size_t size = 4;
|
||||
|
||||
return !sysctlbyname( "hw.vectorunit", &result, &size, NULL, 0 ) && result;
|
||||
return !sysctlbyname( "hw.vectorunit", &result, &size, nullptr, 0 ) && result;
|
||||
}
|
||||
|
||||
/* for( unsigned pos = 0; pos < size; ++pos )
|
||||
|
||||
@@ -42,7 +42,7 @@ void BacktraceNames::Demangle()
|
||||
return;
|
||||
|
||||
int status = 0;
|
||||
char *name = abi::__cxa_demangle( Symbol, NULL, NULL, &status );
|
||||
char *name = abi::__cxa_demangle( Symbol, nullptr, nullptr, &status );
|
||||
if( name )
|
||||
{
|
||||
Symbol = name;
|
||||
@@ -375,7 +375,7 @@ void BacktraceNames::FromAddr( const void *p )
|
||||
char *p;
|
||||
asprintf(&p, "%d", ppid);
|
||||
|
||||
execl("/usr/bin/atos", "/usr/bin/atos", "-p", p, addy, NULL);
|
||||
execl("/usr/bin/atos", "/usr/bin/atos", "-p", p, addy, nullptr);
|
||||
|
||||
fprintf(stderr, "execl(atos) failed: %s\n", strerror(errno));
|
||||
free(addy);
|
||||
|
||||
@@ -80,13 +80,13 @@ static void NORETURN spawn_child_process( int from_parent )
|
||||
strncpy( magic, CHILD_MAGIC_PARAMETER, sizeof(magic) );
|
||||
|
||||
/* Use execve; it's the lowest-level of the exec calls. The others may allocate. */
|
||||
char *argv[3] = { path, magic, NULL };
|
||||
char *argv[3] = { path, magic, nullptr };
|
||||
char *envp[1] = { NULL };
|
||||
execve( path, argv, envp );
|
||||
|
||||
/* If we got here, the exec failed. We can't call strerror. */
|
||||
// safe_print(fileno(stderr), "Crash handler execl(", path, ") failed: ", strerror(errno), "\n", NULL);
|
||||
safe_print( fileno(stderr), "Crash handler execl(", path, ") failed: ", itoa( errno ), "\n", NULL );
|
||||
// safe_print(fileno(stderr), "Crash handler execl(", path, ") failed: ", strerror(errno), "\n", nullptr);
|
||||
safe_print( fileno(stderr), "Crash handler execl(", path, ") failed: ", itoa( errno ), "\n", nullptr );
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
@@ -108,13 +108,13 @@ static bool parent_write( int to_child, const void *p, size_t size )
|
||||
int ret = retried_write( to_child, p, size );
|
||||
if( ret == -1 )
|
||||
{
|
||||
safe_print( fileno(stderr), "Unexpected write() result (", strerror(errno), ")\n", NULL );
|
||||
safe_print( fileno(stderr), "Unexpected write() result (", strerror(errno), ")\n", nullptr );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( size_t(ret) != size )
|
||||
{
|
||||
safe_print( fileno(stderr), "Unexpected write() result (", itoa(ret), ")\n", NULL );
|
||||
safe_print( fileno(stderr), "Unexpected write() result (", itoa(ret), ")\n", nullptr );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ static void RunCrashHandler( const CrashData *crash )
|
||||
{
|
||||
if( g_pCrashHandlerArgv0 == nullptr )
|
||||
{
|
||||
safe_print( fileno(stderr), "Crash handler failed: CrashHandlerHandleArgs was not called\n", NULL );
|
||||
safe_print( fileno(stderr), "Crash handler failed: CrashHandlerHandleArgs was not called\n", nullptr );
|
||||
_exit( 1 );
|
||||
}
|
||||
|
||||
@@ -213,9 +213,9 @@ static void RunCrashHandler( const CrashData *crash )
|
||||
struct sigaction sa;
|
||||
memset( &sa, 0, sizeof(sa) );
|
||||
sa.sa_handler = SIG_IGN;
|
||||
if( sigaction( SIGPIPE, &sa, NULL ) != 0 )
|
||||
if( sigaction( SIGPIPE, &sa, nullptr ) != 0 )
|
||||
{
|
||||
safe_print( fileno(stderr), "sigaction() failed: %s", strerror(errno), NULL );
|
||||
safe_print( fileno(stderr), "sigaction() failed: %s", strerror(errno), nullptr );
|
||||
/* non-fatal */
|
||||
}
|
||||
|
||||
@@ -229,22 +229,22 @@ static void RunCrashHandler( const CrashData *crash )
|
||||
switch( crash->type )
|
||||
{
|
||||
case CrashData::SIGNAL:
|
||||
safe_print( fileno(stderr), "Fatal signal (", SignalName(crash->signal), ")", NULL );
|
||||
safe_print( fileno(stderr), "Fatal signal (", SignalName(crash->signal), ")", nullptr );
|
||||
break;
|
||||
|
||||
case CrashData::FORCE_CRASH:
|
||||
safe_print( fileno(stderr), "Crash handler failed: \"", crash->reason, "\"", NULL );
|
||||
safe_print( fileno(stderr), "Crash handler failed: \"", crash->reason, "\"", nullptr );
|
||||
break;
|
||||
|
||||
default:
|
||||
safe_print( fileno(stderr), "Unexpected RunCrashHandler call (", itoa(crash->type), ")", NULL );
|
||||
safe_print( fileno(stderr), "Unexpected RunCrashHandler call (", itoa(crash->type), ")", nullptr );
|
||||
break;
|
||||
}
|
||||
|
||||
if( active == 1 )
|
||||
safe_print( fileno(stderr), " while still in the crash handler\n", NULL);
|
||||
safe_print( fileno(stderr), " while still in the crash handler\n", nullptr);
|
||||
else if( active == 2 )
|
||||
safe_print( fileno(stderr), " while in the crash handler child\n", NULL);
|
||||
safe_print( fileno(stderr), " while in the crash handler child\n", nullptr);
|
||||
|
||||
_exit( 1 );
|
||||
}
|
||||
@@ -259,14 +259,14 @@ static void RunCrashHandler( const CrashData *crash )
|
||||
int fds[2];
|
||||
if( pipe(fds) != 0 )
|
||||
{
|
||||
safe_print( fileno(stderr), "Crash handler pipe() failed: ", strerror(errno), "\n", NULL );
|
||||
safe_print( fileno(stderr), "Crash handler pipe() failed: ", strerror(errno), "\n", nullptr );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
pid_t childpid = fork();
|
||||
if( childpid == -1 )
|
||||
{
|
||||
safe_print( fileno(stderr), "Crash handler fork() failed: ", strerror(errno), "\n", NULL );
|
||||
safe_print( fileno(stderr), "Crash handler fork() failed: ", strerror(errno), "\n", nullptr );
|
||||
_exit( 1 );
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ static void RunCrashHandler( const CrashData *crash )
|
||||
RageThread::ResumeAllThreads();
|
||||
|
||||
if( WIFSIGNALED(status) )
|
||||
safe_print( fileno(stderr), "Crash handler child exited with signal ", itoa(WTERMSIG(status)), "\n", NULL );
|
||||
safe_print( fileno(stderr), "Crash handler child exited with signal ", itoa(WTERMSIG(status)), "\n", nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ void CrashHandler::ForceCrash( const char *reason )
|
||||
strncpy( crash.reason, reason, sizeof(crash.reason) );
|
||||
crash.reason[ sizeof(crash.reason)-1 ] = 0;
|
||||
|
||||
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, NULL );
|
||||
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, nullptr );
|
||||
|
||||
RunCrashHandler( &crash );
|
||||
}
|
||||
@@ -344,7 +344,7 @@ void CrashHandler::ForceDeadlock( RString reason, uint64_t iID )
|
||||
|
||||
crash.type = CrashData::FORCE_CRASH;
|
||||
|
||||
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, NULL );
|
||||
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, nullptr );
|
||||
|
||||
if( iID == GetInvalidThreadId() )
|
||||
{
|
||||
@@ -376,7 +376,7 @@ void CrashHandler::CrashSignalHandler( int signal, siginfo_t *si, const ucontext
|
||||
static volatile bool bInCrashSignalHandler = false;
|
||||
if( bInCrashSignalHandler )
|
||||
{
|
||||
safe_print( 2, "Fatal: crash from within the crash signal handler\n", NULL );
|
||||
safe_print( 2, "Fatal: crash from within the crash signal handler\n", nullptr );
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ static void child_process()
|
||||
|
||||
FD_ZERO( &rs );
|
||||
FD_SET( 3, &rs );
|
||||
int ret = select( 4, &rs, NULL, NULL, &timeout );
|
||||
int ret = select( 4, &rs, nullptr, nullptr, &timeout );
|
||||
|
||||
if( ret == 0 )
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ static int waittid( int ThreadID, int *status, int options )
|
||||
static int PtraceAttach( int ThreadID )
|
||||
{
|
||||
int ret;
|
||||
ret = ptrace( PTRACE_ATTACH, ThreadID, NULL, NULL );
|
||||
ret = ptrace( PTRACE_ATTACH, ThreadID, nullptr, nullptr );
|
||||
if( ret == -1 )
|
||||
{
|
||||
printf("ptrace failed: %s\n", strerror(errno) );
|
||||
@@ -114,7 +114,7 @@ static int PtraceAttach( int ThreadID )
|
||||
|
||||
static int PtraceDetach( int ThreadID )
|
||||
{
|
||||
return ptrace( PTRACE_DETACH, ThreadID, NULL, NULL );
|
||||
return ptrace( PTRACE_DETACH, ThreadID, nullptr, nullptr );
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ bool GetThreadBacktraceContext( uint64_t ThreadID, BacktraceContext *ctx )
|
||||
|
||||
#if defined(CPU_X86_64) || defined(CPU_X86)
|
||||
user_regs_struct regs;
|
||||
if( ptrace( PTRACE_GETREGS, pid_t(ThreadID), NULL, ®s ) == -1 )
|
||||
if( ptrace( PTRACE_GETREGS, pid_t(ThreadID), nullptr, ®s ) == -1 )
|
||||
return false;
|
||||
|
||||
ctx->pid = pid_t(ThreadID);
|
||||
|
||||
@@ -57,7 +57,7 @@ SaveSignals::SaveSignals()
|
||||
for( int i = 0; signals[i] != -1; ++i )
|
||||
{
|
||||
struct sigaction sa;
|
||||
sigaction( signals[i], NULL, &sa );
|
||||
sigaction( signals[i], nullptr, &sa );
|
||||
old_handlers.push_back( sa );
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ SaveSignals::~SaveSignals()
|
||||
{
|
||||
/* Restore the old signal handlers. */
|
||||
for( unsigned i = 0; i < old_handlers.size(); ++i )
|
||||
sigaction( signals[i], &old_handlers[i], NULL );
|
||||
sigaction( signals[i], &old_handlers[i], nullptr );
|
||||
}
|
||||
|
||||
static void SigHandler( int signal, siginfo_t *si, void *ucp )
|
||||
@@ -86,7 +86,7 @@ static void SigHandler( int signal, siginfo_t *si, void *ucp )
|
||||
struct sigaction old;
|
||||
sigaction( signal, &sa, &old );
|
||||
raise( signal );
|
||||
sigaction( signal, &old, NULL );
|
||||
sigaction( signal, &old, nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ void SignalHandler::OnClose( handler h )
|
||||
ss.ss_sp = (char*)p; /* cast for Darwin */
|
||||
ss.ss_size = AltStackSize;
|
||||
ss.ss_flags = 0;
|
||||
if( sigaltstack( &ss, NULL ) == -1 )
|
||||
if( sigaltstack( &ss, nullptr ) == -1 )
|
||||
{
|
||||
LOG->Info( "sigaltstack failed: %s", strerror(errno) );
|
||||
p = nullptr; /* no SA_ONSTACK */
|
||||
@@ -185,11 +185,11 @@ void SignalHandler::OnClose( handler h )
|
||||
/* Set up our signal handlers. */
|
||||
sa.sa_sigaction = SigHandler;
|
||||
for( int i = 0; signals[i] != -1; ++i )
|
||||
sigaction( signals[i], &sa, NULL );
|
||||
sigaction( signals[i], &sa, nullptr );
|
||||
|
||||
/* Block SIGPIPE, so we get EPIPE. */
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigaction( SIGPIPE, &sa, NULL );
|
||||
sigaction( SIGPIPE, &sa, nullptr );
|
||||
}
|
||||
handlers.push_back(h);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void WriteToChild( HANDLE hPipe, const void *pData, size_t iSize )
|
||||
while( iSize )
|
||||
{
|
||||
DWORD iActual;
|
||||
if( !WriteFile(hPipe, pData, iSize, &iActual, NULL) )
|
||||
if( !WriteFile(hPipe, pData, iSize, &iActual, nullptr) )
|
||||
return;
|
||||
iSize -= iActual;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ void RunChild()
|
||||
* since GetModuleFileNameEx might not be available. Run the requests here. */
|
||||
HMODULE hMod;
|
||||
DWORD iActual;
|
||||
if( !ReadFile( hFromStdout, &hMod, sizeof(hMod), &iActual, NULL) )
|
||||
if( !ReadFile( hFromStdout, &hMod, sizeof(hMod), &iActual, nullptr) )
|
||||
break;
|
||||
|
||||
TCHAR szName[MAX_PATH];
|
||||
@@ -331,7 +331,7 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc )
|
||||
/* Now things get more risky. If we're fullscreen, the window will obscure
|
||||
* the crash dialog. Try to hide the window. Things might blow up here; do
|
||||
* this after DoSave, so we always write a crash dump. */
|
||||
if( GetWindowThreadProcessId( g_hForegroundWnd, NULL ) == GetCurrentThreadId() )
|
||||
if( GetWindowThreadProcessId( g_hForegroundWnd, nullptr ) == GetCurrentThreadId() )
|
||||
{
|
||||
/* The thread that crashed was the thread that created the main window.
|
||||
* Hide the window. This will also restore the video mode, if necessary. */
|
||||
@@ -445,7 +445,7 @@ static bool PointsToValidCall( unsigned long ptr )
|
||||
|
||||
memset( buf, 0, sizeof(buf) );
|
||||
|
||||
while(len > 0 && !ReadProcessMemory(GetCurrentProcess(), (void *)(ptr-len), buf+7-len, len, NULL))
|
||||
while(len > 0 && !ReadProcessMemory(GetCurrentProcess(), (void *)(ptr-len), buf+7-len, len, nullptr))
|
||||
--len;
|
||||
|
||||
return IsValidCall(buf+7, len);
|
||||
@@ -521,7 +521,7 @@ void CrashHandler::do_backtrace( const void **buf, size_t size,
|
||||
break;
|
||||
|
||||
lpAddr += 4;
|
||||
} while( ReadProcessMemory(hProcess, lpAddr-4, &data, 4, NULL));
|
||||
} while( ReadProcessMemory(hProcess, lpAddr-4, &data, 4, nullptr));
|
||||
|
||||
*buf = nullptr;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace VDDebugInfo
|
||||
GetVDIPath( pctx->sFilename, ARRAYLEN(pctx->sFilename) );
|
||||
pctx->sError = RString();
|
||||
|
||||
HANDLE h = CreateFile( pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
|
||||
HANDLE h = CreateFile( pctx->sFilename, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr );
|
||||
if( h == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
pctx->sError = werr_ssprintf( GetLastError(), "CreateFile failed" );
|
||||
@@ -131,7 +131,7 @@ namespace VDDebugInfo
|
||||
}
|
||||
|
||||
do {
|
||||
DWORD dwFileSize = GetFileSize( h, NULL );
|
||||
DWORD dwFileSize = GetFileSize( h, nullptr );
|
||||
if( dwFileSize == INVALID_FILE_SIZE )
|
||||
break;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace VDDebugInfo
|
||||
break;
|
||||
|
||||
DWORD dwActual;
|
||||
int iRet = ReadFile(h, pBuf, dwFileSize, &dwActual, NULL);
|
||||
int iRet = ReadFile(h, pBuf, dwFileSize, &dwActual, nullptr);
|
||||
CloseHandle(h);
|
||||
pctx->sRawBlock.ReleaseBuffer( dwActual );
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace SymbolLookup
|
||||
{
|
||||
SymSetOptions( SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS );
|
||||
|
||||
if( !SymInitialize(g_hParent, NULL, TRUE) )
|
||||
if( !SymInitialize(g_hParent, nullptr, TRUE) )
|
||||
return false;
|
||||
|
||||
bInitted = true;
|
||||
@@ -745,7 +745,7 @@ BOOL CrashDialog::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
|
||||
m_pPost->Start( CRASH_REPORT_HOST, CRASH_REPORT_PORT, CRASH_REPORT_PATH );
|
||||
|
||||
SetTimer( hDlg, 0, 100, NULL );
|
||||
SetTimer( hDlg, 0, 100, nullptr );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -174,7 +174,7 @@ NetworkStream_Win32::NetworkStream_Win32():
|
||||
#if defined(WINDOWS)
|
||||
m_hResolve = nullptr;
|
||||
m_hResolveHwnd = nullptr;
|
||||
m_hCompletionEvent = CreateEvent( NULL, true, false, NULL );
|
||||
m_hCompletionEvent = CreateEvent( NULL, true, false, nullptr );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ RString werr_ssprintf( int err, const char *fmt, ... )
|
||||
{
|
||||
char buf[1024] = "";
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
0, err, 0, buf, sizeof(buf), NULL);
|
||||
0, err, 0, buf, sizeof(buf), nullptr);
|
||||
|
||||
// Why is FormatMessage returning text ending with \r\n? (who? -aj)
|
||||
// Perhaps it's because you're on Windows, where newlines are \r\n. -aj
|
||||
@@ -31,12 +31,12 @@ RString ConvertWstringToCodepage( wstring s, int iCodePage )
|
||||
return RString();
|
||||
|
||||
int iBytes = WideCharToMultiByte( iCodePage, 0, s.data(), s.size(),
|
||||
NULL, 0, NULL, FALSE );
|
||||
NULL, 0, nullptr, FALSE );
|
||||
ASSERT_M( iBytes > 0, werr_ssprintf( GetLastError(), "WideCharToMultiByte" ).c_str() );
|
||||
|
||||
RString ret;
|
||||
WideCharToMultiByte( CP_ACP, 0, s.data(), s.size(),
|
||||
ret.GetBuffer( iBytes ), iBytes, NULL, FALSE );
|
||||
ret.GetBuffer( iBytes ), iBytes, nullptr, FALSE );
|
||||
ret.ReleaseBuffer( iBytes );
|
||||
|
||||
return ret;
|
||||
@@ -52,7 +52,7 @@ wstring ConvertCodepageToWString( RString s, int iCodePage )
|
||||
if( s.empty() )
|
||||
return wstring();
|
||||
|
||||
int iBytes = MultiByteToWideChar( iCodePage, 0, s.data(), s.size(), NULL, 0 );
|
||||
int iBytes = MultiByteToWideChar( iCodePage, 0, s.data(), s.size(), nullptr, 0 );
|
||||
ASSERT_M( iBytes > 0, werr_ssprintf( GetLastError(), "MultiByteToWideChar" ).c_str() );
|
||||
|
||||
wchar_t *pTemp = new wchar_t[iBytes];
|
||||
|
||||
@@ -25,7 +25,7 @@ static LONG GetRegKey( HKEY key, RString subkey, LPTSTR retdata )
|
||||
bool GotoURL( RString sUrl )
|
||||
{
|
||||
// First try ShellExecute()
|
||||
int iRet = (int) ShellExecute( NULL, "open", sUrl, NULL, NULL, SW_SHOWDEFAULT );
|
||||
int iRet = (int) ShellExecute( NULL, "open", sUrl, nullptr, nullptr, SW_SHOWDEFAULT );
|
||||
|
||||
// If it failed, get the .htm regkey and lookup the program
|
||||
if( iRet > 32 )
|
||||
|
||||
@@ -283,7 +283,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce
|
||||
|
||||
AppInstance inst;
|
||||
HWND hWnd = CreateWindow( g_sClassName, "app", iWindowStyle,
|
||||
0, 0, 0, 0, NULL, NULL, inst, NULL );
|
||||
0, 0, 0, 0, nullptr, nullptr, inst, nullptr );
|
||||
if( hWnd == nullptr )
|
||||
RageException::Throw( "%s", werr_ssprintf( GetLastError(), "CreateWindow" ).c_str() );
|
||||
|
||||
@@ -363,9 +363,9 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce
|
||||
* If we don't do this, then starting up in a D3D fullscreen window may
|
||||
* cause all other windows on the system to be resized. */
|
||||
MSG msg;
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
|
||||
while( PeekMessage( &msg, nullptr, 0, 0, PM_NOREMOVE ) )
|
||||
{
|
||||
GetMessage( &msg, NULL, 0, 0 );
|
||||
GetMessage( &msg, nullptr, 0, 0 );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
}
|
||||
@@ -399,10 +399,10 @@ void GraphicsWindow::DestroyGraphicsWindow()
|
||||
CHECKPOINT;
|
||||
|
||||
MSG msg;
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
|
||||
while( PeekMessage( &msg, nullptr, 0, 0, PM_NOREMOVE ) )
|
||||
{
|
||||
CHECKPOINT;
|
||||
GetMessage( &msg, NULL, 0, 0 );
|
||||
GetMessage( &msg, nullptr, 0, 0 );
|
||||
CHECKPOINT;
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
@@ -487,9 +487,9 @@ const VideoModeParams &GraphicsWindow::GetParams()
|
||||
void GraphicsWindow::Update()
|
||||
{
|
||||
MSG msg;
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
|
||||
while( PeekMessage( &msg, nullptr, 0, 0, PM_NOREMOVE ) )
|
||||
{
|
||||
GetMessage( &msg, NULL, 0, 0 );
|
||||
GetMessage( &msg, nullptr, 0, 0 );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ MessageWindow::MessageWindow( const RString &sClassName )
|
||||
RageException::Throw( "%s", werr_ssprintf( GetLastError(), "RegisterClass" ).c_str() );
|
||||
|
||||
// XXX: on 2k/XP, use HWND_MESSAGE as parent
|
||||
m_hWnd = CreateWindow( sClassName, sClassName, WS_DISABLED, 0, 0, 0, 0, NULL, NULL, inst, NULL );
|
||||
m_hWnd = CreateWindow( sClassName, sClassName, WS_DISABLED, 0, 0, 0, 0, nullptr, nullptr, inst, nullptr );
|
||||
ASSERT( m_hWnd != nullptr );
|
||||
|
||||
SetProp( m_hWnd, "MessageWindow", this );
|
||||
|
||||
@@ -66,7 +66,7 @@ bool RegistryAccess::GetRegValue( const RString &sKey, const RString &sName, RSt
|
||||
char sBuffer[MAX_PATH];
|
||||
DWORD iSize = sizeof(sBuffer);
|
||||
DWORD iType;
|
||||
LONG iRet = RegQueryValueEx( hKey, sName, NULL, &iType, (LPBYTE)sBuffer, &iSize );
|
||||
LONG iRet = RegQueryValueEx( hKey, sName, nullptr, &iType, (LPBYTE)sBuffer, &iSize );
|
||||
RegCloseKey( hKey );
|
||||
if( iRet != ERROR_SUCCESS )
|
||||
return false;
|
||||
@@ -92,7 +92,7 @@ bool RegistryAccess::GetRegValue( const RString &sKey, const RString &sName, int
|
||||
DWORD iValue;
|
||||
DWORD iSize = sizeof(iValue);
|
||||
DWORD iType;
|
||||
LONG iRet = RegQueryValueEx( hKey, sName, NULL, &iType, (LPBYTE) &iValue, &iSize );
|
||||
LONG iRet = RegQueryValueEx( hKey, sName, nullptr, &iType, (LPBYTE) &iValue, &iSize );
|
||||
RegCloseKey( hKey );
|
||||
if( iRet != ERROR_SUCCESS )
|
||||
return false;
|
||||
@@ -126,7 +126,7 @@ bool RegistryAccess::GetRegSubKeys( const RString &sKey, vector<RString> &lst, c
|
||||
FILETIME ft;
|
||||
char szBuffer[MAX_PATH];
|
||||
DWORD iSize = sizeof(szBuffer);
|
||||
LONG iRet = RegEnumKeyEx( hKey, index, szBuffer, &iSize, NULL, NULL, NULL, &ft);
|
||||
LONG iRet = RegEnumKeyEx( hKey, index, szBuffer, &iSize, nullptr, nullptr, nullptr, &ft);
|
||||
if( iRet == ERROR_NO_MORE_ITEMS )
|
||||
break;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ static RString GetUSBDevicePath( int iNum )
|
||||
GUID guid;
|
||||
HidD_GetHidGuid( &guid );
|
||||
|
||||
HDEVINFO DeviceInfo = SetupDiGetClassDevs( &guid, NULL, NULL, (DIGCF_PRESENT | DIGCF_DEVICEINTERFACE) );
|
||||
HDEVINFO DeviceInfo = SetupDiGetClassDevs( &guid, nullptr, nullptr, (DIGCF_PRESENT | DIGCF_DEVICEINTERFACE) );
|
||||
|
||||
SP_DEVICE_INTERFACE_DATA DeviceInterface;
|
||||
DeviceInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
|
||||
@@ -33,14 +33,14 @@ static RString GetUSBDevicePath( int iNum )
|
||||
}
|
||||
|
||||
unsigned long iSize;
|
||||
SetupDiGetDeviceInterfaceDetail( DeviceInfo, &DeviceInterface, NULL, 0, &iSize, 0 );
|
||||
SetupDiGetDeviceInterfaceDetail( DeviceInfo, &DeviceInterface, nullptr, 0, &iSize, 0 );
|
||||
|
||||
PSP_INTERFACE_DEVICE_DETAIL_DATA DeviceDetail = (PSP_INTERFACE_DEVICE_DETAIL_DATA) malloc( iSize );
|
||||
DeviceDetail->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA);
|
||||
|
||||
RString sRet;
|
||||
if( SetupDiGetDeviceInterfaceDetail(DeviceInfo, &DeviceInterface,
|
||||
DeviceDetail, iSize, &iSize, NULL) )
|
||||
DeviceDetail, iSize, &iSize, nullptr) )
|
||||
sRet = DeviceDetail->DevicePath;
|
||||
free( DeviceDetail );
|
||||
|
||||
@@ -56,7 +56,7 @@ bool USBDevice::Open( int iVID, int iPID, int iBlockSize, int iNum, void (*pfnIn
|
||||
while( (path = GetUSBDevicePath(iIndex++)) != "" )
|
||||
{
|
||||
HANDLE h = CreateFile( path, GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr );
|
||||
|
||||
if( h == INVALID_HANDLE_VALUE )
|
||||
continue;
|
||||
@@ -138,7 +138,7 @@ bool WindowsFileIO::Open( RString path, int iBlockSize )
|
||||
CloseHandle( m_Handle );
|
||||
|
||||
m_Handle = CreateFile( path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL );
|
||||
NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, nullptr );
|
||||
|
||||
if( m_Handle == INVALID_HANDLE_VALUE )
|
||||
return false;
|
||||
|
||||
@@ -12,7 +12,7 @@ void WindowsDialogBox::Run( int iDialog )
|
||||
GetModuleFileName( NULL, szFullAppPath, MAX_PATH );
|
||||
HINSTANCE hHandle = LoadLibrary( szFullAppPath );
|
||||
|
||||
DialogBoxParam( hHandle, MAKEINTRESOURCE(iDialog), NULL, DlgProc, (LPARAM) this );
|
||||
DialogBoxParam( hHandle, MAKEINTRESOURCE(iDialog), nullptr, DlgProc, (LPARAM) this );
|
||||
}
|
||||
|
||||
BOOL APIENTRY WindowsDialogBox::DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
|
||||
+2
-2
@@ -201,7 +201,7 @@ bool EzSockets::IsError()
|
||||
FD_ZERO(scks);
|
||||
FD_SET((unsigned)sock, scks);
|
||||
|
||||
if (select(sock+1, NULL, NULL, scks, times) >=0 )
|
||||
if (select(sock+1, nullptr, nullptr, scks, times) >=0 )
|
||||
return false;
|
||||
|
||||
state = skERROR;
|
||||
@@ -213,7 +213,7 @@ bool EzSockets::CanWrite()
|
||||
FD_ZERO(scks);
|
||||
FD_SET((unsigned)sock, scks);
|
||||
|
||||
return select(sock+1, NULL, scks, NULL, times) > 0;
|
||||
return select(sock+1, nullptr, scks, nullptr, times) > 0;
|
||||
}
|
||||
|
||||
void EzSockets::update()
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ namespace Checkpoints
|
||||
void SetCheckpoint( const char *file, int line, const char *message );
|
||||
}
|
||||
/** @brief Set a checkpoint with no message. */
|
||||
#define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, NULL))
|
||||
#define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, nullptr))
|
||||
/** @brief Set a checkpoint with a specified message. */
|
||||
#define CHECKPOINT_M(m) (Checkpoints::SetCheckpoint(__FILE__, __LINE__, m))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user