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