CString -> RString in RageUtil

ThemeMetric<CString> -> LocalizedString to eliminate dependencies
This commit is contained in:
Chris Danford
2005-12-20 08:35:47 +00:00
parent 0311b4256b
commit d698a5f1ec
35 changed files with 439 additions and 291 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
GetDirListing( sAniDir+"*.mpg", asImagePaths, false, true );
GetDirListing( sAniDir+"*.mpeg", asImagePaths, false, true );
SortCStringArray( asImagePaths );
SortRStringArray( asImagePaths );
for( unsigned i=0; i<asImagePaths.size(); i++ )
{
+9 -9
View File
@@ -360,7 +360,7 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText,
if( iWrapWidthPixels == -1 )
{
split( CStringToWstring(m_sText), L"\n", m_wTextLines, false );
split( RStringToWstring(m_sText), L"\n", m_wTextLines, false );
}
else
{
@@ -386,7 +386,7 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText,
for( unsigned i=0; i<asWords.size(); i++ )
{
const CString &sWord = asWords[i];
int iWidthWord = m_pFont->GetLineWidthInSourcePixels( CStringToWstring(sWord) );
int iWidthWord = m_pFont->GetLineWidthInSourcePixels( RStringToWstring(sWord) );
if( sCurLine.empty() )
{
@@ -404,12 +404,12 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText,
}
else
{
m_wTextLines.push_back( CStringToWstring(sCurLine) );
m_wTextLines.push_back( RStringToWstring(sCurLine) );
sCurLine = sWord;
iCurLineWidth = iWidthWord;
}
}
m_wTextLines.push_back( CStringToWstring(sCurLine) );
m_wTextLines.push_back( RStringToWstring(sCurLine) );
}
}
@@ -471,11 +471,11 @@ bool BitmapText::StringWillUseAlternate( const CString& sText, const CString& sA
return false;
/* False if the alternate isn't needed. */
if( m_pFont->FontCompleteForString(CStringToWstring(sText)) )
if( m_pFont->FontCompleteForString(RStringToWstring(sText)) )
return false;
/* False if the alternate is also incomplete. */
if( !m_pFont->FontCompleteForString(CStringToWstring(sAlternateText)) )
if( !m_pFont->FontCompleteForString(RStringToWstring(sAlternateText)) )
return false;
return true;
@@ -654,7 +654,7 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate
CString curCStr = m_sText.substr( i, 1 );
char curChar = curCStr.c_str()[0];
int iCharLen = m_pFont->GetLineWidthInSourcePixels( CStringToWstring( curCStr ) );
int iCharLen = m_pFont->GetLineWidthInSourcePixels( RStringToWstring( curCStr ) );
switch( curChar )
{
@@ -673,7 +673,7 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate
SimpleAddLine( sCurrentLine, iLineWidth );
if( iWordWidth > 0 )
iLineWidth = iWordWidth + //Add the width of a space
m_pFont->GetLineWidthInSourcePixels( CStringToWstring( " " ) );
m_pFont->GetLineWidthInSourcePixels( RStringToWstring( " " ) );
sCurrentLine = sCurrentWord + " ";
iWordWidth = 0;
sCurrentWord = "";
@@ -725,7 +725,7 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate
void ColorBitmapText::SimpleAddLine( const CString &sAddition, const int iWidthPixels)
{
m_wTextLines.push_back( CStringToWstring( sAddition ) );
m_wTextLines.push_back( RStringToWstring( sAddition ) );
m_iLineWidths.push_back( iWidthPixels );
}
+1 -1
View File
@@ -538,7 +538,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr
ini.GetPath().c_str(), iFirstFrame, iNumFramesHigh );
/* Decode the string. */
const wstring wdata( CStringToWstring(sValue) );
const wstring wdata( RStringToWstring(sValue) );
if( int(wdata.size()) > iNumFramesWide )
RageException::Throw( "The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font only has %i characters wide",
+6 -3
View File
@@ -516,6 +516,9 @@ void InputMapper::SaveMappingsToDisk()
ini.WriteFile( SpecialFiles::KEYMAPS_PATH );
}
static LocalizedString CONNECTED ( "InputMapper", "Connected" );
static LocalizedString DISCONNECTED ( "InputMapper", "Disconnected" );
static LocalizedString REMAPPING_ALL_JOYSTICKS ( "InputMapper", "Remapping all joysticks." );
bool InputMapper::CheckForChangedInputDevicesAndRemap( CString &sMessage )
{
//
@@ -537,13 +540,13 @@ bool InputMapper::CheckForChangedInputDevicesAndRemap( CString &sMessage )
sMessage = CString();
if( !vsConnects.empty() )
sMessage += "Connected: " + join( "\n", vsConnects ) + "\n";
sMessage += CONNECTED.GetValue()+": " + join( "\n", vsConnects ) + "\n";
if( !vsDisconnects.empty() )
sMessage += "Disconnected: " + join( "\n", vsDisconnects ) + "\n";
sMessage += DISCONNECTED.GetValue()+": " + join( "\n", vsDisconnects ) + "\n";
if( g_bAutoMapOnJoyChange )
{
sMessage += "Remapping all joysticks.";
sMessage += REMAPPING_ALL_JOYSTICKS.GetValue();
AutoMapJoysticksForCurrentGame();
SaveMappingsToDisk();
}
+8 -5
View File
@@ -501,7 +501,9 @@ void NetworkSyncManager::StartRequest(short position)
NetPlayerClient->blocking=false;
}
static LocalizedString CONNECTION_SUCCESSFUL( "NetworkSyncManager", "Connection to '%s' successful." );
static LocalizedString CONNECTION_FAILED ( "NetworkSyncManager", "Connection failed." );
void NetworkSyncManager::DisplayStartupStatus()
{
CString sMessage("");
@@ -512,13 +514,13 @@ void NetworkSyncManager::DisplayStartupStatus()
//Networking wasn't attepmpted
return;
case 1:
sMessage = "Connection to " + m_ServerName + " successful.";
sMessage = ssprintf( CONNECTION_SUCCESSFUL.GetValue(), m_ServerName.c_str() );
break;
case 2:
sMessage = "Connection failed.";
sMessage = CONNECTION_FAILED.GetValue();
break;
}
SCREENMAN->SystemMessage(sMessage);
SCREENMAN->SystemMessage( sMessage );
}
void NetworkSyncManager::Update(float fDeltaTime)
@@ -565,13 +567,14 @@ void NetworkSyncManager::Update(float fDeltaTime)
}
}
static LocalizedString CONNECTION_DROPPED( "NetworkSyncManager", "Connection to server dropped." );
void NetworkSyncManager::ProcessInput()
{
//If we're disconnected, just exit
if ((NetPlayerClient->state!=NetPlayerClient->skCONNECTED) ||
NetPlayerClient->IsError())
{
SCREENMAN->SystemMessageNoAnimate("Connection to server dropped.");
SCREENMAN->SystemMessageNoAnimate( CONNECTION_DROPPED );
useSMserver=false;
isSMOnline = false;
FOREACH_PlayerNumber(pn)
+4 -2
View File
@@ -1308,6 +1308,8 @@ void Player::HandleStep( int col, const RageTimer &tm, bool bHeld )
}
}
static LocalizedString AUTOSYNC_CORRECTION_APPLIED ( "Player", "Autosync: Correction applied." );
static LocalizedString AUTOSYNC_CORRECTION_NOT_APPLIED ( "Player", "Autosync: Correction NOT applied. Deviation too high." );
void Player::HandleAutosync(float fNoteOffset)
{
if( GAMESTATE->m_SongOptions.m_AutosyncType == SongOptions::AUTOSYNC_OFF )
@@ -1349,11 +1351,11 @@ void Player::HandleAutosync(float fNoteOffset)
ASSERT(0);
}
SCREENMAN->SystemMessage( "Autosync: Correction applied." );
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_APPLIED.GetValue() );
}
else
{
SCREENMAN->SystemMessage( "Autosync: Correction NOT applied.\n Timing deviation too high." );
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_NOT_APPLIED.GetValue() );
}
m_iOffsetSample = 0;
+2 -2
View File
@@ -1151,10 +1151,10 @@ ProfileLoadResult Profile::LoadEditableDataFromDir( CString sDir )
ini.GetValue( "Editable", "WeightPounds", m_iWeightPounds );
// This is data that the user can change, so we have to validate it.
wstring wstr = CStringToWstring(m_sDisplayName);
wstring wstr = RStringToWstring(m_sDisplayName);
if( wstr.size() > PROFILE_MAX_DISPLAY_NAME_LENGTH )
wstr = wstr.substr(0, PROFILE_MAX_DISPLAY_NAME_LENGTH);
m_sDisplayName = WStringToCString(wstr);
m_sDisplayName = WStringToRString(wstr);
// TODO: strip invalid chars?
if( m_iWeightPounds != 0 )
CLAMP( m_iWeightPounds, 20, 1000 );
+1 -2
View File
@@ -10,7 +10,6 @@
#include "RageTimer.h"
#include "RageSoundReader_Preload.h"
#include "Foreach.h"
#include "ThemeMetric.h"
#include "arch/Sound/RageSoundDriver.h"
@@ -36,7 +35,7 @@ RageSoundManager::RageSoundManager()
m_bPlayOnlyCriticalSounds = false;
}
static ThemeMetric<CString> COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" );
static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" );
void RageSoundManager::Init( CString sDrivers )
{
+202 -153
View File
File diff suppressed because it is too large Load Diff
+23 -5
View File
@@ -276,9 +276,9 @@ wchar_t utf8_get_char( const RString &s );
bool utf8_is_valid( const RString &s );
void utf8_remove_bom( RString &s );
RString WStringToCString( const wstring &sString );
RString WStringToRString( const wstring &sString );
RString WcharToUTF8( wchar_t c );
wstring CStringToWstring( const RString &sString );
wstring RStringToWstring( const RString &sString );
RString GetLanguageNameFromISO639Code( RString sName );
@@ -311,9 +311,9 @@ unsigned int GetHashForFile( const RString &sPath );
unsigned int GetHashForDirectory( const RString &sDir ); // a hash value that remains the same as long as nothing in the directory has changed
bool DirectoryIsEmpty( const RString &sPath );
bool CompareCStringsAsc( const RString &sStr1, const RString &sStr2 );
bool CompareCStringsDesc( const RString &sStr1, const RString &sStr2 );
void SortCStringArray( vector<RString> &asAddTo, const bool bSortAscending = true );
bool CompareRStringsAsc( const RString &sStr1, const RString &sStr2 );
bool CompareRStringsDesc( const RString &sStr1, const RString &sStr2 );
void SortRStringArray( vector<RString> &asAddTo, const bool bSortAscending = true );
/* Find the mean and standard deviation of all numbers in [start,end). */
float calc_mean( const float *pStart, const float *pEnd );
@@ -503,6 +503,24 @@ void GetConnectsDisconnects( const vector<T> &before, const vector<T> &after, ve
GetAsNotInBs( after, before, connects );
}
// String localization
void RegisterLocalizer( RString (*pfnLocalizer)(const RString&,const RString&) );
void RefreshLocalizedStrings();
class LocalizedString
{
public:
LocalizedString( const RString &sSection, const RString &sName );
~LocalizedString();
void Refresh();
operator const CString&();
const CString &GetValue();
private:
RString m_sSection;
RString m_sName;
RString m_sValue;
};
#endif
/*
+1 -1
View File
@@ -27,7 +27,7 @@ static bool CodePageConvert(CString &txt, int cp)
size = MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, txt.data(), txt.size(), (wchar_t *) out.data(), size);
ASSERT( size != 0 );
txt = WStringToCString(out);
txt = WStringToRString(out);
return true;
}
+2 -1
View File
@@ -157,6 +157,7 @@ void ScreenCenterImage::Input( const InputEventPlus &input )
m_fScale[axis] = fScale;
}
static LocalizedString CENTERING( "ScreenCenterImage", "Centering: x %d, y %d, width %d, height %d" );
void ScreenCenterImage::Move( Axis axis, float fDelta )
{
Preference<int> *piValues[4] =
@@ -176,7 +177,7 @@ void ScreenCenterImage::Move( Axis axis, float fDelta )
PREFSMAN->m_fCenterImageAddHeight );
CString sMessage =
ssprintf( "Centering: x=%d, y=%d, width=%d, height=%d",
ssprintf( CENTERING.GetValue(),
PREFSMAN->m_iCenterImageTranslateX.Get(),
PREFSMAN->m_iCenterImageTranslateY.Get(),
PREFSMAN->m_fCenterImageAddWidth.Get(),
+72 -39
View File
@@ -345,16 +345,49 @@ void ChangeVolume( float fDelta )
//
#define DECLARE_ONE( x ) static x g_##x
static LocalizedString AUTO_PLAY ( "ScreenDebugOverlay", "AutoPlay" );
static LocalizedString ASSIST_TICK ( "ScreenDebugOverlay", "AssistTick" );
static LocalizedString AUTOSYNC ( "ScreenDebugOverlay", "Autosync" );
static LocalizedString COIN_MODE ( "ScreenDebugOverlay", "CoinMode" );
static LocalizedString HALT ( "ScreenDebugOverlay", "Halt" );
static LocalizedString LIGHTS_DEBUG ( "ScreenDebugOverlay", "Lights Debug" );
static LocalizedString MONKEY_INPUT ( "ScreenDebugOverlay", "Monkey Input" );
static LocalizedString RENDERING_STATS ( "ScreenDebugOverlay", "Rendering Stats" );
static LocalizedString VSYNC ( "ScreenDebugOverlay", "Vsync" );
static LocalizedString MULTITEXTURE ( "ScreenDebugOverlay", "Multitexture" );
static LocalizedString SCREEN_TEST_MODE ( "ScreenDebugOverlay", "Screen Test Mode" );
static LocalizedString CLEAR_MACHINE_STATS ( "ScreenDebugOverlay", "Clear Machine Stats" );
static LocalizedString FILL_MACHINE_STATS ( "ScreenDebugOverlay", "Fill Machine Stats" );
static LocalizedString SEND_NOTES_ENDED ( "ScreenDebugOverlay", "Send Notes Ended" );
static LocalizedString RELOAD ( "ScreenDebugOverlay", "Reload" );
static LocalizedString RELOAD_THEME_AND_TEXTURES ( "ScreenDebugOverlay", "Reload Theme and Textures" );
static LocalizedString WRITE_PROFILES ( "ScreenDebugOverlay", "Write Profiles" );
static LocalizedString WRITE_PREFERENCES ( "ScreenDebugOverlay", "Write Preferences" );
static LocalizedString MENU_TIMER ( "ScreenDebugOverlay", "Menu Timer" );
static LocalizedString FLUSH_LOG ( "ScreenDebugOverlay", "Flush Log" );
static LocalizedString PULL_BACK_CAMERA ( "ScreenDebugOverlay", "Pull Back Camera" );
static LocalizedString VOLUME_UP ( "ScreenDebugOverlay", "Volume Up" );
static LocalizedString VOLUME_DOWN ( "ScreenDebugOverlay", "Volume Down" );
static LocalizedString UPTIME ( "ScreenDebugOverlay", "Uptime" );
static LocalizedString SLOW ( "ScreenDebugOverlay", "Slow" );
static LocalizedString ON ( "ScreenDebugOverlay", "on" );
static LocalizedString OFF ( "ScreenDebugOverlay", "off" );
static LocalizedString CPU ( "ScreenDebugOverlay", "CPU" );
static LocalizedString SONG ( "ScreenDebugOverlay", "Song" );
static LocalizedString MACHINE ( "ScreenDebugOverlay", "Machine" );
class DebugLineAutoplay : public IDebugLine
{
virtual CString GetDescription() { return "AutoPlay"; }
virtual CString GetDescription() { return AUTO_PLAY; }
virtual CString GetValue()
{
switch( PREFSMAN->m_AutoPlay )
{
case PC_HUMAN: return "off"; break;
case PC_AUTOPLAY: return "on"; break;
case PC_CPU: return "CPU"; break;
case PC_HUMAN: return OFF; break;
case PC_AUTOPLAY: return ON; break;
case PC_CPU: return CPU; break;
default: ASSERT(0); return NULL;
}
}
@@ -374,8 +407,8 @@ class DebugLineAutoplay : public IDebugLine
class DebugLineAssistTick : public IDebugLine
{
virtual CString GetDescription() { return "AssistTick"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return ASSIST_TICK; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return GAMESTATE->m_SongOptions.m_bAssistTick; }
virtual void Do( CString &sMessageOut )
{
@@ -389,14 +422,14 @@ class DebugLineAssistTick : public IDebugLine
class DebugLineAutosync : public IDebugLine
{
virtual CString GetDescription() { return "Autosync"; }
virtual CString GetDescription() { return AUTOSYNC; }
virtual CString GetValue()
{
switch( GAMESTATE->m_SongOptions.m_AutosyncType )
{
case SongOptions::AUTOSYNC_OFF: return "off"; break;
case SongOptions::AUTOSYNC_SONG: return "Song"; break;
case SongOptions::AUTOSYNC_MACHINE: return "Machine"; break;
case SongOptions::AUTOSYNC_OFF: return OFF; break;
case SongOptions::AUTOSYNC_SONG: return SONG; break;
case SongOptions::AUTOSYNC_MACHINE: return MACHINE; break;
default: ASSERT(0);
}
}
@@ -413,7 +446,7 @@ class DebugLineAutosync : public IDebugLine
class DebugLineCoinMode : public IDebugLine
{
virtual CString GetDescription() { return "CoinMode"; }
virtual CString GetDescription() { return COIN_MODE; }
virtual CString GetValue() { return CoinModeToString(PREFSMAN->m_CoinMode); }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -428,8 +461,8 @@ class DebugLineCoinMode : public IDebugLine
class DebugLineSlow : public IDebugLine
{
virtual CString GetDescription() { return "Slow"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return SLOW; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return g_bIsSlow; }
virtual void Do( CString &sMessageOut )
{
@@ -441,8 +474,8 @@ class DebugLineSlow : public IDebugLine
class DebugLineHalt : public IDebugLine
{
virtual CString GetDescription() { return "Halt"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return HALT; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return g_bIsHalt; }
virtual void Do( CString &sMessageOut )
{
@@ -455,8 +488,8 @@ class DebugLineHalt : public IDebugLine
class DebugLineLightsDebug : public IDebugLine
{
virtual CString GetDescription() { return "Lights Debug"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return LIGHTS_DEBUG; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return PREFSMAN->m_bDebugLights.Get(); }
virtual void Do( CString &sMessageOut )
{
@@ -467,8 +500,8 @@ class DebugLineLightsDebug : public IDebugLine
class DebugLineMonkeyInput : public IDebugLine
{
virtual CString GetDescription() { return "MonkeyInput"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return MONKEY_INPUT; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return PREFSMAN->m_bMonkeyInput.Get(); }
virtual void Do( CString &sMessageOut )
{
@@ -479,8 +512,8 @@ class DebugLineMonkeyInput : public IDebugLine
class DebugLineStats : public IDebugLine
{
virtual CString GetDescription() { return "Rendering Stats"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return RENDERING_STATS; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return PREFSMAN->m_bShowStats.Get(); }
virtual void Do( CString &sMessageOut )
{
@@ -491,8 +524,8 @@ class DebugLineStats : public IDebugLine
class DebugLineVsync : public IDebugLine
{
virtual CString GetDescription() { return "Vsync"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return VSYNC; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return PREFSMAN->m_bVsync.Get(); }
virtual void Do( CString &sMessageOut )
{
@@ -504,8 +537,8 @@ class DebugLineVsync : public IDebugLine
class DebugLineAllowMultitexture : public IDebugLine
{
virtual CString GetDescription() { return "Multitexture"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return MULTITEXTURE; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return PREFSMAN->m_bAllowMultitexture.Get(); }
virtual void Do( CString &sMessageOut )
{
@@ -516,8 +549,8 @@ class DebugLineAllowMultitexture : public IDebugLine
class DebugLineScreenTestMode : public IDebugLine
{
virtual CString GetDescription() { return "Screen Test Mode"; }
virtual CString GetValue() { return IsEnabled() ? "on":"off"; }
virtual CString GetDescription() { return SCREEN_TEST_MODE; }
virtual CString GetValue() { return IsEnabled() ? ON:OFF; }
virtual bool IsEnabled() { return PREFSMAN->m_bScreenTestMode.Get(); }
virtual void Do( CString &sMessageOut )
{
@@ -528,7 +561,7 @@ class DebugLineScreenTestMode : public IDebugLine
class DebugLineClearMachineStats : public IDebugLine
{
virtual CString GetDescription() { return "Clear Machine Stats"; }
virtual CString GetDescription() { return CLEAR_MACHINE_STATS; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -542,7 +575,7 @@ class DebugLineClearMachineStats : public IDebugLine
class DebugLineFillMachineStats : public IDebugLine
{
virtual CString GetDescription() { return "Fill Machine Stats"; }
virtual CString GetDescription() { return FILL_MACHINE_STATS; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -556,7 +589,7 @@ class DebugLineFillMachineStats : public IDebugLine
class DebugLineSendNotesEnded : public IDebugLine
{
virtual CString GetDescription() { return "Send Notes Ended"; }
virtual CString GetDescription() { return SEND_NOTES_ENDED; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -568,7 +601,7 @@ class DebugLineSendNotesEnded : public IDebugLine
class DebugLineReloadCurrentScreen : public IDebugLine
{
virtual CString GetDescription() { return "Reload"; }
virtual CString GetDescription() { return RELOAD; }
virtual CString GetValue() { return SCREENMAN ? SCREENMAN->GetTopScreen()->GetName() : NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -583,7 +616,7 @@ class DebugLineReloadCurrentScreen : public IDebugLine
class DebugLineReloadTheme : public IDebugLine
{
virtual CString GetDescription() { return "Reload Theme and Textures"; }
virtual CString GetDescription() { return RELOAD_THEME_AND_TEXTURES; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -600,7 +633,7 @@ class DebugLineReloadTheme : public IDebugLine
class DebugLineWriteProfiles : public IDebugLine
{
virtual CString GetDescription() { return "Write Profiles"; }
virtual CString GetDescription() { return WRITE_PROFILES; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -639,7 +672,7 @@ class DebugLineWritePreferences : public IDebugLine
class DebugLineMenuTimer : public IDebugLine
{
virtual CString GetDescription() { return "Menu Timer"; }
virtual CString GetDescription() { return MENU_TIMER; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return PREFSMAN->m_bMenuTimer.Get(); }
virtual void Do( CString &sMessageOut )
@@ -651,7 +684,7 @@ class DebugLineMenuTimer : public IDebugLine
class DebugLineFlushLog : public IDebugLine
{
virtual CString GetDescription() { return "Flush Log"; }
virtual CString GetDescription() { return FLUSH_LOG; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -663,7 +696,7 @@ class DebugLineFlushLog : public IDebugLine
class DebugLinePullBackCamera : public IDebugLine
{
virtual CString GetDescription() { return "Pull Back Camera"; }
virtual CString GetDescription() { return PULL_BACK_CAMERA; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return g_fImageScaleDestination != 1; }
virtual void Do( CString &sMessageOut )
@@ -678,7 +711,7 @@ class DebugLinePullBackCamera : public IDebugLine
class DebugLineVolumeUp : public IDebugLine
{
virtual CString GetDescription() { return "Volume Up"; }
virtual CString GetDescription() { return VOLUME_UP; }
virtual CString GetValue() { return ssprintf("%.0f%%",PREFSMAN->m_fSoundVolume.Get()*100); }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -690,7 +723,7 @@ class DebugLineVolumeUp : public IDebugLine
class DebugLineVolumeDown : public IDebugLine
{
virtual CString GetDescription() { return "Volume Down"; }
virtual CString GetDescription() { return VOLUME_DOWN; }
virtual CString GetValue() { return NULL; }
virtual bool IsEnabled() { return true; }
virtual void Do( CString &sMessageOut )
@@ -702,7 +735,7 @@ class DebugLineVolumeDown : public IDebugLine
class DebugLineUptime : public IDebugLine
{
virtual CString GetDescription() { return "Uptime"; }
virtual CString GetDescription() { return UPTIME; }
virtual CString GetValue() { return SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()); }
virtual bool IsEnabled() { return false; }
virtual void Do( CString &sMessageOut ) {}
+12 -6
View File
@@ -1086,6 +1086,8 @@ static void ShiftToRightSide( int &iCol, int iNumTracks )
}
}
static LocalizedString SWITCHED_TO ( "ScreenEdit", "Switched to" );
static LocalizedString NO_BACKGROUNDS_AVAILABLE ( "ScreenEdit", "No backgrounds available" );
void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{
if( input.type == IET_LEVEL_CHANGED )
@@ -1372,7 +1374,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
m_pSteps = pSteps;
pSteps->GetNoteData( m_NoteDataEdit );
CString s = ssprintf(
"Switched to %s %s '%s' (%d of %d)",
SWITCHED_TO.GetValue() + " %s %s '%s' (%d of %d)",
GAMEMAN->StepsTypeToString( pSteps->m_StepsType ).c_str(),
DifficultyToString( pSteps->GetDifficulty() ).c_str(),
pSteps->GetDescription().c_str(),
@@ -1670,7 +1672,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
if( sName.empty() )
{
SCREENMAN->PlayInvalidSound();
SCREENMAN->SystemMessage( "No backgrounds available" );
SCREENMAN->SystemMessage( NO_BACKGROUNDS_AVAILABLE );
}
else
{
@@ -2479,6 +2481,8 @@ static void ChangeArtistTranslit( const CString &sNew )
// End helper functions
static LocalizedString SAVED_AS_SM_AND_DWI ( "ScreenEdit", "Saved as SM and DWI." );
static LocalizedString SAVED_AS_SM ( "ScreenEdit", "Saved as SM." );
void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAnswers )
{
switch( c )
@@ -2591,9 +2595,9 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
// dance, it just looks tacky and people may be wondering where the
// DWI file is :-)
if ((int)pSteps->m_StepsType <= (int)STEPS_TYPE_DANCE_SOLO)
SCREENMAN->SystemMessage( "Saved as SM and DWI." );
SCREENMAN->SystemMessage( SAVED_AS_SM_AND_DWI );
else
SCREENMAN->SystemMessage( "Saved as SM." );
SCREENMAN->SystemMessage( SAVED_AS_SM );
HandleScreenMessage( SM_Success );
}
@@ -3216,6 +3220,8 @@ void ScreenEdit::SaveUndo()
m_Undo.CopyAll( m_NoteDataEdit );
}
static LocalizedString UNDO ("ScreenEdit", "Undo");
static LocalizedString CANT_UNDO ("ScreenEdit", "Can't undo - no undo data.");
void ScreenEdit::Undo()
{
if( m_bHasUndo )
@@ -3225,11 +3231,11 @@ void ScreenEdit::Undo()
m_NoteDataEdit.CopyAll( m_Undo );
m_Undo.CopyAll( temp );
SCREENMAN->SystemMessage( "Undo" );
SCREENMAN->SystemMessage( UNDO );
}
else
{
SCREENMAN->SystemMessage( "Can't undo - no undo data." );
SCREENMAN->SystemMessage( CANT_UNDO );
SCREENMAN->PlayInvalidSound();
}
}
+4 -4
View File
@@ -233,7 +233,7 @@ void ScreenNameEntryTraditional::Init()
/* Add letters to m_Keyboard. */
const CString fontpath = THEME->GetPathF(m_sName,"letters");
const wstring Chars = CStringToWstring(KEYBOARD_LETTERS);
const wstring Chars = RStringToWstring(KEYBOARD_LETTERS);
for( unsigned ch = 0; ch < Chars.size(); ++ch )
{
BitmapText *Letter = new BitmapText;
@@ -293,7 +293,7 @@ void ScreenNameEntryTraditional::Init()
const Profile* pProfile = PROFILEMAN->GetProfile(p);
if( pProfile && !pProfile->m_sLastUsedHighScoreName.empty() )
{
m_sSelection[p] = CStringToWstring( pProfile->m_sLastUsedHighScoreName );
m_sSelection[p] = RStringToWstring( pProfile->m_sLastUsedHighScoreName );
if( (int) m_sSelection[p].size() > MAX_RANKING_NAME_LENGTH )
m_sSelection[p].erase( MAX_RANKING_NAME_LENGTH );
ASSERT( (int) m_sSelection[p].size() <= MAX_RANKING_NAME_LENGTH );
@@ -578,7 +578,7 @@ void ScreenNameEntryTraditional::Finish( PlayerNumber pn )
UpdateSelectionText( pn ); /* hide NAME_ cursor */
CString selection = WStringToCString( m_sSelection[pn] );
CString selection = WStringToRString( m_sSelection[pn] );
// save last used ranking name
Profile* pProfile = PROFILEMAN->GetProfile(pn);
@@ -604,7 +604,7 @@ void ScreenNameEntryTraditional::UpdateSelectionText( int pn )
if( m_bStillEnteringName[pn] && (int) text.size() < MAX_RANKING_NAME_LENGTH )
text += L"_";
m_textSelection[pn].SetText( WStringToCString(text) );
m_textSelection[pn].SetText( WStringToRString(text) );
}
void ScreenNameEntryTraditional::MenuStart( const InputEventPlus &input )
+10 -6
View File
@@ -91,7 +91,8 @@ void ScreenNetworkOptions::Init()
m_pRows[PO_SCOREBOARD]->SetOneSharedSelection(PREFSMAN->m_bEnableScoreboard);
}
static LocalizedString SERVER_STARTED ( "ScreenNetworkOptions", "Server started." );
static LocalizedString SERVER_FAILED ( "ScreenNetworkOptions", "Server failed: %s Code:%d" );
void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_DoneConnecting )
@@ -115,17 +116,20 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
if (NSMAN->LANserver->ServerStart())
{
NSMAN->isLanServer = true;
SCREENMAN->SystemMessage( "Server Started." );
SCREENMAN->SystemMessage( SERVER_STARTED );
}
else
SCREENMAN->SystemMessage( "Server failed: " + NSMAN->LANserver->lastError + ssprintf(" Code:%d",NSMAN->LANserver->lastErrorCode) );
{
SCREENMAN->SystemMessage( ssprintf(SERVER_FAILED.GetValue(),NSMAN->LANserver->lastError.c_str(),NSMAN->LANserver->lastErrorCode) );
}
}
}
ScreenOptions::HandleScreenMessage( SM );
}
static LocalizedString DISCONNECTED ( "ScreenNetworkOptions", "Disconnected from server." );
static LocalizedString SERVER_STOPPED ( "ScreenNetworkOptions", "Server stopped." );
void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
{
#if defined( WITHOUT_NETWORKING )
@@ -140,7 +144,7 @@ void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
else
{
NSMAN->CloseConnection();
SCREENMAN->SystemMessage("Disconnected from server.");
SCREENMAN->SystemMessage( DISCONNECTED );
UpdateConnectStatus( );
}
break;
@@ -156,7 +160,7 @@ void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
case NO_STOP_SERVER:
if ( NSMAN->LANserver != NULL )
NSMAN->LANserver->ServerStop();
SCREENMAN->SystemMessage( "Server Stopped." );
SCREENMAN->SystemMessage( SERVER_STOPPED );
NSMAN->isLanServer = false;
break;
}
+2 -1
View File
@@ -253,11 +253,12 @@ void ScreenPackages::MenuRight( const InputEventPlus &input )
ScreenWithMenuElements::MenuRight( input );
}
static LocalizedString DOWNLOAD_CANCELLED( "ScreenPackages", "Download cancelled." );
void ScreenPackages::MenuBack( PlayerNumber pn )
{
if ( m_bIsDownloading )
{
SCREENMAN->SystemMessage( "Download Cancelled." );
SCREENMAN->SystemMessage( DOWNLOAD_CANCELLED );
CancelDownload( );
return;
}
+4 -2
View File
@@ -28,6 +28,7 @@ ScreenSMOnlineLogin::ScreenSMOnlineLogin(CString sClassName) : ScreenOptions(sCl
LOG->Trace( "ScreenSMOnlineLogin::ScreenSMOnlineLogin()" );
}
static LocalizedString DEFINE_A_PROFILE( "ScreenSMOnlineLogin", "You must define a Profile." );
void ScreenSMOnlineLogin::Init()
{
ScreenOptions::Init();
@@ -37,7 +38,7 @@ void ScreenSMOnlineLogin::Init()
if( g_ProfileLine[0].m_vsChoices.empty() )
{
SCREENMAN->SystemMessage("You Must Define A Profile!");
SCREENMAN->SystemMessage( DEFINE_A_PROFILE );
SCREENMAN->SetNewScreen("ScreenProfileOptions");
}
else
@@ -92,6 +93,7 @@ void ScreenSMOnlineLogin::ExportOptions( int iRow, const vector<PlayerNumber> &v
}
}
static LocalizedString UNIQUE_PROFILE( "ScreenSMOnlineLogin", "Each player needs a unique Profile." );
void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
{
if( SM == SM_PasswordDone )
@@ -141,7 +143,7 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
if(GAMESTATE->IsPlayerEnabled((PlayerNumber) 0) && GAMESTATE->IsPlayerEnabled((PlayerNumber) 1) &&
(GAMESTATE->GetPlayerDisplayName((PlayerNumber) 0) == GAMESTATE->GetPlayerDisplayName((PlayerNumber) 1)))
{
SCREENMAN->SystemMessage("Each Player Needs A Unique Profile!");
SCREENMAN->SystemMessage( UNIQUE_PROFILE );
SCREENMAN->SetNewScreen("ScreenSMOnlineLogin");
}
else
+2 -1
View File
@@ -229,6 +229,7 @@ int ScreenSelectStyle::GetSelectionIndex( PlayerNumber pn )
return m_iSelection;
}
static LocalizedString NO_STYLES_ARE_SELECTABLE( "ScreenSMOnlineLogin", "No Styles are selectable." );
void ScreenSelectStyle::UpdateSelectableChoices()
{
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
@@ -264,7 +265,7 @@ void ScreenSelectStyle::UpdateSelectableChoices()
if( iSwitchToStyleIndex == -1 )// no styles are enabled. We're stuck!
{
DEBUG_ASSERT(0);
SCREENMAN->SystemMessage( "No Styles are selectable." );
SCREENMAN->SystemMessage( NO_STYLES_ARE_SELECTABLE );
this->PostScreenMessage( SM_GoToPrevScreen, 0 );
return;
}
+4 -2
View File
@@ -155,6 +155,8 @@ void ScreenSyncOverlay::UpdateText()
m_textStatus.SetText( s );
}
static LocalizedString CANT_SYNC_WHILE_PLAYING_A_COURSE ("ScreenSyncOverlay","Can't sync while playing a course.");
static LocalizedString SYNC_CHANGES_REVERTED ("ScreenSyncOverlay","Sync changes reverted.");
bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
{
if( !IsGameplay() )
@@ -172,7 +174,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
case KEY_F12:
if( GAMESTATE->IsCourseMode() )
{
SCREENMAN->SystemMessage( "Can't sync while playing a course." );
SCREENMAN->SystemMessage( CANT_SYNC_WHILE_PLAYING_A_COURSE );
return true;
}
break;
@@ -183,7 +185,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
switch( input.DeviceI.button )
{
case KEY_F4:
SCREENMAN->SystemMessage( "Sync changes reverted." );
SCREENMAN->SystemMessage( SYNC_CHANGES_REVERTED );
GAMESTATE->RevertSyncChanges();
break;
case KEY_F9:
+6 -6
View File
@@ -133,7 +133,7 @@ ScreenTextEntry::~ScreenTextEntry()
void ScreenTextEntry::BeginScreen()
{
m_sAnswer = CStringToWstring( g_sInitialAnswer );
m_sAnswer = RStringToWstring( g_sInitialAnswer );
ScreenWithMenuElements::BeginScreen();
@@ -181,7 +181,7 @@ void ScreenTextEntry::UpdateKeyboardText()
void ScreenTextEntry::UpdateAnswerText()
{
CString s = WStringToCString(m_sAnswer);
CString s = WStringToRString(m_sAnswer);
if( g_bPassword )
{
int len = s.GetLength();
@@ -335,7 +335,7 @@ void ScreenTextEntry::MoveY( int iDir )
void ScreenTextEntry::AppendToAnswer( CString s )
{
wstring sNewAnswer = m_sAnswer+CStringToWstring(s);
wstring sNewAnswer = m_sAnswer+RStringToWstring(s);
if( (int)sNewAnswer.length() > g_iMaxInputLength )
{
SCREENMAN->PlayInvalidSound();
@@ -400,7 +400,7 @@ void ScreenTextEntry::End( bool bCancelled )
}
else
{
CString sAnswer = WStringToCString(m_sAnswer);
CString sAnswer = WStringToRString(m_sAnswer);
CString sError;
if ( g_pValidate != NULL )
{
@@ -414,7 +414,7 @@ void ScreenTextEntry::End( bool bCancelled )
if( g_pOnOK )
{
CString ret = WStringToCString(m_sAnswer);
CString ret = WStringToRString(m_sAnswer);
FontCharAliases::ReplaceMarkers(ret);
g_pOnOK( ret );
}
@@ -429,7 +429,7 @@ void ScreenTextEntry::End( bool bCancelled )
OFF_COMMAND( m_sprCursor );
s_bCancelledLast = bCancelled;
s_sLastAnswer = bCancelled ? CString("") : WStringToCString(m_sAnswer);
s_sLastAnswer = bCancelled ? CString("") : WStringToRString(m_sAnswer);
}
void ScreenTextEntry::MenuBack( PlayerNumber pn )
+4 -2
View File
@@ -59,6 +59,8 @@ ScreenTitleMenu::~ScreenTitleMenu()
CHARMAN->UndemandGraphics();
}
static LocalizedString THEME_ ("ScreenTitleMenu","Theme");
static LocalizedString ANNOUNCER_ ("ScreenTitleMenu","Announcer");
void ScreenTitleMenu::Input( const InputEventPlus &input )
{
LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", input.DeviceI.device, input.DeviceI.button ); // debugging gameport joystick problem
@@ -76,7 +78,7 @@ void ScreenTitleMenu::Input( const InputEventPlus &input )
{
THEME->NextTheme();
StepMania::ApplyGraphicOptions(); // update window title and icon
SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() );
SCREENMAN->SystemMessage( THEME_.GetValue()+": "+THEME->GetCurThemeName() );
SCREENMAN->SetNewScreen( m_sName );
TEXTUREMAN->DoDelayedDelete();
}
@@ -86,7 +88,7 @@ void ScreenTitleMenu::Input( const InputEventPlus &input )
ANNOUNCER->NextAnnouncer();
CString sName = ANNOUNCER->GetCurAnnouncerName();
if( sName=="" ) sName = "(none)";
SCREENMAN->SystemMessage( "Announcer: "+sName );
SCREENMAN->SystemMessage( ANNOUNCER_.GetValue()+": "+sName );
SCREENMAN->SetNewScreen( m_sName );
}
}
+6 -6
View File
@@ -103,7 +103,7 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld )
}
static ThemeMetric<CString> FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder '%s' appears to be a song folder. All song folders must reside in a group folder. For example, 'Songs/Originals/My Song'." );
static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder '%s' appears to be a song folder. All song folders must reside in a group folder. For example, 'Songs/Originals/My Song'." );
void SongManager::SanityCheckGroupDir( CString sDir ) const
{
@@ -161,7 +161,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld )
// Find all group directories in "Songs" folder
vector<CString> arrayGroupDirs;
GetDirListing( sDir+"*", arrayGroupDirs, true );
SortCStringArray( arrayGroupDirs );
SortRStringArray( arrayGroupDirs );
StripCvs( arrayGroupDirs );
FOREACH_CONST( CString, arrayGroupDirs, s ) // foreach dir in /Songs/
@@ -174,7 +174,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld )
vector<CString> arraySongDirs;
GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true );
StripCvs( arraySongDirs );
SortCStringArray( arraySongDirs );
SortRStringArray( arraySongDirs );
LOG->Trace("Attempting to load %i songs from \"%s\"", int(arraySongDirs.size()),
(sDir+sGroupDirName).c_str() );
@@ -227,7 +227,7 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
// Find all symlink files in this folder
vector<CString> arraySymLinks;
GetDirListing( sDir+sGroupFolder+"/*.include", arraySymLinks, false );
SortCStringArray( arraySymLinks );
SortRStringArray( arraySymLinks );
for( unsigned s=0; s< arraySymLinks.size(); s++ ) // for each symlink in this dir, add it in as a song.
{
MsdFile msdF;
@@ -524,14 +524,14 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
vector<CString> vsCourseGroupNames;
GetDirListing( COURSES_DIR+"*", vsCourseGroupNames, true );
StripCvs( vsCourseGroupNames );
SortCStringArray( vsCourseGroupNames );
SortRStringArray( vsCourseGroupNames );
FOREACH( CString, vsCourseGroupNames, sCourseGroup ) // for each dir in /Courses/
{
// Find all CRS files in this group directory
vector<CString> vsCoursePaths;
GetDirListing( COURSES_DIR + *sCourseGroup + "/*.crs", vsCoursePaths, false, true );
SortCStringArray( vsCoursePaths );
SortRStringArray( vsCoursePaths );
FOREACH_CONST( CString, vsCoursePaths, sCoursePath )
{
+1 -1
View File
@@ -90,7 +90,7 @@ static bool CompareSongPointersByBPM( const Song *pSong1, const Song *pSong2 )
if( bpms1.GetMax() > bpms2.GetMax() )
return false;
return CompareCStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() );
return CompareRStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() );
}
void SongUtil::SortSongPointerArrayByBPM( vector<Song*> &vpSongsInOut )
+34 -12
View File
@@ -106,6 +106,16 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams &paramsOut )
);
}
static LocalizedString COLOR ("StepMania","color");
static LocalizedString TEXTURE ("StepMania","texture");
static LocalizedString WINDOWED ("StepMania","Windowed");
static LocalizedString FULLSCREEN ("StepMania","Fullscreen");
static LocalizedString ANNOUNCER_ ("StepMania","Announcer");
static LocalizedString VSYNC ("StepMania","Vsync");
static LocalizedString NO_VSYNC ("StepMania","NoVsync");
static LocalizedString SMOOTH_LINES ("StepMania","SmoothLines");
static LocalizedString NO_SMOOTH_LINES ("StepMania","NoSmoothLines");
static void StoreActualGraphicOptions( bool initial )
{
// find out what we actually have
@@ -116,16 +126,17 @@ static void StoreActualGraphicOptions( bool initial )
PREFSMAN->m_iRefreshRate .Set( DISPLAY->GetActualVideoModeParams().rate );
PREFSMAN->m_bVsync .Set( DISPLAY->GetActualVideoModeParams().vsync );
CString log = ssprintf("%s %s %dx%d %d color %d texture %dHz %s %s",
CString sFormat = "%s %s %dx%d %d "+COLOR.GetValue()+" %d "+TEXTURE.GetValue()+" %dHz %s %s";
CString log = ssprintf( sFormat,
DISPLAY->GetApiDescription().c_str(),
PREFSMAN->m_bWindowed ? "Windowed" : "Fullscreen",
(PREFSMAN->m_bWindowed ? WINDOWED : FULLSCREEN).GetValue().c_str(),
(int)PREFSMAN->m_iDisplayWidth,
(int)PREFSMAN->m_iDisplayHeight,
(int)PREFSMAN->m_iDisplayColorDepth,
(int)PREFSMAN->m_iTextureColorDepth,
(int)PREFSMAN->m_iRefreshRate,
PREFSMAN->m_bVsync ? "Vsync" : "NoVsync",
PREFSMAN->m_bSmoothLines? "AA" : "NoAA" );
(PREFSMAN->m_bVsync ? VSYNC : NO_VSYNC).GetValue().c_str(),
(PREFSMAN->m_bSmoothLines? SMOOTH_LINES : NO_SMOOTH_LINES).GetValue().c_str() );
if( initial )
LOG->Info( "%s", log.c_str() );
else
@@ -664,12 +675,12 @@ found_defaults:
LOG->Info( "Video renderers: '%s'", PREFSMAN->m_sVideoRenderers.Get().c_str() );
}
static ThemeMetric<CString> ERROR_INITIALIZING_CARD ( "StepMania", "There was an error while initializing your video card." );
static ThemeMetric<CString> ERROR_DONT_FILE_BUG ( "StepMania", "Please do not file this error as a bug! Use the web page below to troubleshoot this problem." );
static ThemeMetric<CString> ERROR_VIDEO_DRIVER ( "StepMania", "Video Driver: %s" );
static ThemeMetric<CString> ERROR_NO_VIDEO_RENDERERS ( "StepMania", "No video renderers attempted." );
static ThemeMetric<CString> ERROR_INITIALIZING ( "StepMania", "Initializing %s..." );
static ThemeMetric<CString> ERROR_UNKNOWN_VIDEO_RENDERER ( "StepMania", "Unknown video renderer value: %s" );
static LocalizedString ERROR_INITIALIZING_CARD ( "StepMania", "There was an error while initializing your video card." );
static LocalizedString ERROR_DONT_FILE_BUG ( "StepMania", "Please do not file this error as a bug! Use the web page below to troubleshoot this problem." );
static LocalizedString ERROR_VIDEO_DRIVER ( "StepMania", "Video Driver: %s" );
static LocalizedString ERROR_NO_VIDEO_RENDERERS ( "StepMania", "No video renderers attempted." );
static LocalizedString ERROR_INITIALIZING ( "StepMania", "Initializing %s..." );
static LocalizedString ERROR_UNKNOWN_VIDEO_RENDERER ( "StepMania", "Unknown video renderer value: %s" );
RageDisplay *CreateDisplay()
{
@@ -904,8 +915,14 @@ static void ApplyLogPreferences()
Checkpoints::LogCheckpoints( PREFSMAN->m_bLogCheckpoints );
}
static ThemeMetric<CString> COULDNT_OPEN_LOADING_WINDOW( "StepMania", "Couldn't open any loading windows." );
static CString LocalizeString( const CString &sSection, const CString &s )
{
CString sOut;
THEME->GetMetric( sSection, s, sOut );
return sOut;
}
static LocalizedString COULDNT_OPEN_LOADING_WINDOW( "StepMania", "Couldn't open any loading windows." );
#ifdef _XBOX
void __cdecl main()
@@ -1045,6 +1062,10 @@ int main(int argc, char* argv[])
delete pIcon;
}
RegisterLocalizer( LocalizeString );
RefreshLocalizedStrings();
if( PREFSMAN->m_iSoundWriteAhead )
LOG->Info( "Sound writeahead has been overridden to %i", PREFSMAN->m_iSoundWriteAhead.Get() );
SOUNDMAN = new RageSoundManager;
@@ -1253,6 +1274,7 @@ void StepMania::InsertCredit()
/* Returns true if the key has been handled and should be discarded, false if
* the key should be sent on to screens. */
static LocalizedString SERVICE_SWITCH_PRESED ( "StepMania", "Service switch pressed" );
bool HandleGlobalInputs( const InputEventPlus &input )
{
/* None of the globals keys act on types other than FIRST_PRESS */
@@ -1268,7 +1290,7 @@ bool HandleGlobalInputs( const InputEventPlus &input )
* (to prevent quitting without storing changes). */
if( SCREENMAN->GetTopScreen()->GetScreenType() != system_menu )
{
SCREENMAN->SystemMessage( "Service switch pressed" );
SCREENMAN->SystemMessage( SERVICE_SWITCH_PRESED );
GAMESTATE->Reset();
SCREENMAN->PopAllScreens();
SCREENMAN->SetNewScreen( "ScreenOptionsService" );
+2 -1
View File
@@ -676,13 +676,14 @@ bool ThemeManager::HasMetric( const CString &sClassName, const CString &sValueNa
return GetMetricRawRecursive( sClassName, sValueName, sThrowAway );
}
static LocalizedString RELOADED_METRICS( "ThemeManager", "Reloaded metrics" );
void ThemeManager::ReloadMetrics()
{
// force a reload of the metrics cache
LoadThemeMetrics( g_vThemes, m_sCurThemeName, m_sCurLanguage );
if( SCREENMAN )
SCREENMAN->SystemMessage( "Reloaded metrics" );
SCREENMAN->SystemMessage( RELOADED_METRICS );
//
// clear theme path cache
@@ -218,7 +218,7 @@ void ArchHooks_Unix::SetTime( tm newtime )
#include "RageFileManager.h"
#include <sys/stat.h>
static ThemeMetric<CString> COULDNT_FIND_SONGS( "ArchHooks_Unix", "Couldn't find 'Songs'" );
static LocalizedString COULDNT_FIND_SONGS( "ArchHooks_Unix", "Couldn't find 'Songs'" );
void ArchHooks_Unix::MountInitialFilesystems( const CString &sDirOfExecutable )
{
#if defined(LINUX)
@@ -19,7 +19,7 @@
#include <X11/extensions/XTest.h>
#endif
static ThemeMetric<CString> FAILED_CONNECTION_XSERVER( "LowLevelWindow_X11", "Failed to establish a connection with the X server'" );
static LocalizedString FAILED_CONNECTION_XSERVER( "LowLevelWindow_X11", "Failed to establish a connection with the X server'" );
LowLevelWindow_X11::LowLevelWindow_X11()
{
m_bWindowIsOpen = false;
@@ -77,7 +77,7 @@ void MemoryCardDriverThreaded_Windows::GetUSBStorageDevices( vector<UsbStorageDe
DWORD mask = (1 << i);
if( !(m_dwLastLogicalDrives & mask) )
continue; // drive letter is invalid
if( IsFloppyDrive(i+'a') )
if( IsFloppyDrive((char)i+'a') )
continue;
CString sDrive = ssprintf( "%c:\\", 'a'+i%26 );
@@ -102,7 +102,7 @@ static void GetVideoCodecDebugInfo()
CHECKPOINT;
if( ICGetInfo(hic, &info, sizeof(ICINFO)) )
{
CheckCodecVersion( FourCCToString(info.fccHandler), WStringToCString(info.szDescription) );
CheckCodecVersion( FourCCToString(info.fccHandler), WStringToRString(info.szDescription) );
CHECKPOINT;
LOG->Info( " %s: %ls (%ls)",
@@ -311,7 +311,7 @@ CString MovieTexture_DShow::GetActiveFilterList()
if( ret != "" )
ret += ", ";
ret += WStringToCString(FilterInfo.achName);
ret += WStringToRString(FilterInfo.achName);
if( FilterInfo.pGraph )
FilterInfo.pGraph->Release();
@@ -347,7 +347,7 @@ CString MovieTexture_DShow::Create()
// Add the source filter
CComPtr<IBaseFilter> pFSrc; // Source Filter
wstring wFileName = CStringToWstring(actualID.filename);
wstring wFileName = RStringToWstring(actualID.filename);
// if this fails, it's probably because the user doesn't have DivX installed
/* No, it also happens if the movie can't be opened for some reason; for example,
+4 -5
View File
@@ -9,10 +9,9 @@
#include "arch.h"
#include "arch_platform.h"
#include "Foreach.h"
#include "ThemeMetric.h"
#include "InputHandler/Selector_InputHandler.h"
static ThemeMetric<CString> INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." );
static LocalizedString INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." );
void MakeInputHandlers(CString drivers, vector<InputHandler *> &Add)
{
vector<CString> DriversToTry;
@@ -179,8 +178,8 @@ MemoryCardDriver *MakeMemoryCardDriver()
#include "MovieTexture/Selector_MovieTexture.h"
static void DumpAVIDebugInfo( const CString& fn );
/* Try drivers in order of preference until we find one that works. */
static ThemeMetric<CString> MOVIE_DRIVERS_EMPTY ( "Arch", "Movie Drivers cannot be empty." );
static ThemeMetric<CString> COULDNT_CREATE_MOVIE_DRIVER( "Arch", "Couldn't create a movie driver." );
static LocalizedString MOVIE_DRIVERS_EMPTY ( "Arch", "Movie Drivers cannot be empty." );
static LocalizedString COULDNT_CREATE_MOVIE_DRIVER ( "Arch", "Couldn't create a movie driver." );
RageMovieTexture *MakeRageMovieTexture( RageTextureID ID )
{
DumpAVIDebugInfo( ID.filename );
@@ -232,7 +231,7 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID )
}
#include "Sound/Selector_RageSoundDriver.h"
static ThemeMetric<CString> SOUND_DRIVERS_CANNOT_EMPTY( "Arch", "Sound Drivers cannot be empty." );
static LocalizedString SOUND_DRIVERS_CANNOT_EMPTY( "Arch", "Sound Drivers cannot be empty." );
RageSoundDriver *MakeRageSoundDriver(CString drivers)
{
vector<CString> DriversToTry;
@@ -275,7 +275,7 @@ void GraphicsWindow::ConfigureGraphicsWindow( const VideoModeParams &p )
{
if( m_bWideWindowClass )
{
if( SetWindowTextW( g_hWndMain, CStringToWstring(p.sWindowTitle).c_str() ) )
if( SetWindowTextW( g_hWndMain, RStringToWstring(p.sWindowTitle).c_str() ) )
break;
}
@@ -373,7 +373,7 @@ void GraphicsWindow::Initialize( bool bD3D )
AppInstance inst;
do
{
const wstring wsClassName = CStringToWstring( g_sClassName );
const wstring wsClassName = RStringToWstring( g_sClassName );
WNDCLASSW WindowClassW =
{
CS_OWNDC | CS_BYTEALIGNCLIENT,
+1 -1
View File
@@ -640,7 +640,7 @@ int CompareCStringsDesc(const void* str1, const void* str2)
return int(s1->CompareNoCase( LPCTSTR(s2) ) > 0);
}
void SortCStringArray( CStringArray &arrayCStrings, const bool bSortAscending )
void SortRStringArray( CStringArray &arrayCStrings, const bool bSortAscending )
{
/*sort( arrayCStrings.begin(), arrayCStrings.end(),
bSortAscending?CompareCStringsAsc:CompareCStringsDesc);*/
+1 -1
View File
@@ -179,7 +179,7 @@ DWORD GetFileSizeInBytes( const CString &sFilePath );
int CompareCStringsAsc(const void* str1, const void* str2);
int CompareCStringsDesc(const void* str1, const void* str2);
void SortCStringArray( CStringArray &AddTo, const bool bSortAcsending = true );
void SortRStringArray( CStringArray &AddTo, const bool bSortAcsending = true );
LONG GetRegKey(HKEY key, const char *subkey, LPTSTR retdata);
+2 -2
View File
@@ -213,7 +213,7 @@ BOOL CSmlobbyDlg::OnInitDialog()
// Find all group directories in "Songs" folder
CStringArray arrayGroupDirs;
GetDirListing( sDir+"\\*.*", arrayGroupDirs, true );
SortCStringArray( arrayGroupDirs );
SortRStringArray( arrayGroupDirs );
//FILE *fp = fopen("SongHashes.txt","wt");
//int k=1000;
@@ -227,7 +227,7 @@ BOOL CSmlobbyDlg::OnInitDialog()
// Find all Song folders in this group directory
CStringArray arraySongDirs;
GetDirListing( ssprintf("%s\\%s\\*.*", sDir, sGroupDirName), arraySongDirs, true );
SortCStringArray( arraySongDirs );
SortRStringArray( arraySongDirs );
for( unsigned j=0; j< arraySongDirs.GetSize(); j++ ) // for each song dir
{