From d4d91fc831bc558a87eccb6ccf1ccb7a700e9766 Mon Sep 17 00:00:00 2001 From: vnctdj Date: Thu, 2 Jul 2015 00:50:07 +0200 Subject: [PATCH] Consistently use *sc for the Screen i18n category --- Core/SaveState.cpp | 23 +++++++++++------------ UI/EmuScreen.cpp | 16 ++++++++-------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 376c55ac79..5a2dee13f5 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -357,7 +357,7 @@ namespace SaveState SaveScreenshot(shot, Callback(), 0); Save(fn + ".tmp", renameCallback, cbUserData); } else { - I18NCategory *s = GetI18NCategory("Screen"); + I18NCategory *sc = GetI18NCategory("Screen"); osm.Show("Failed to save state. Error in the file system.", 2.0); if (callback) callback(false, cbUserData); @@ -508,14 +508,13 @@ namespace SaveState bool callbackResult; std::string reason; - I18NCategory *s = GetI18NCategory("Screen"); - // I couldn't stand the inconsistency. But trying not to break old lang files. - const char *i18nLoadFailure = s->T("Load savestate failed", ""); - const char *i18nSaveFailure = s->T("Save State Failed", ""); + I18NCategory *sc = GetI18NCategory("Screen"); + const char *i18nLoadFailure = sc->T("Load savestate failed", ""); + const char *i18nSaveFailure = sc->T("Save State Failed", ""); if (strlen(i18nLoadFailure) == 0) - i18nLoadFailure = s->T("Failed to load state"); + i18nLoadFailure = sc->T("Failed to load state"); if (strlen(i18nSaveFailure) == 0) - i18nSaveFailure = s->T("Failed to save state"); + i18nSaveFailure = sc->T("Failed to save state"); switch (op.type) { @@ -523,7 +522,7 @@ namespace SaveState INFO_LOG(COMMON, "Loading state from %s", op.filename.c_str()); result = CChunkFileReader::Load(op.filename, REVISION, PPSSPP_GIT_VERSION, state, &reason); if (result == CChunkFileReader::ERROR_NONE) { - osm.Show(s->T("Loaded State"), 2.0); + osm.Show(sc->T("Loaded State"), 2.0); callbackResult = true; hasLoadedState = true; } else if (result == CChunkFileReader::ERROR_BROKEN_STATE) { @@ -532,7 +531,7 @@ namespace SaveState ERROR_LOG(COMMON, "Load state failure: %s", reason.c_str()); callbackResult = false; } else { - osm.Show(s->T(reason.c_str(), i18nLoadFailure), 2.0); + osm.Show(sc->T(reason.c_str(), i18nLoadFailure), 2.0); callbackResult = false; } break; @@ -542,7 +541,7 @@ namespace SaveState result = CChunkFileReader::Save(op.filename, REVISION, PPSSPP_GIT_VERSION, state); if (result == CChunkFileReader::ERROR_NONE) { - osm.Show(s->T("Saved State"), 2.0); + osm.Show(sc->T("Saved State"), 2.0); callbackResult = true; } else if (result == CChunkFileReader::ERROR_BROKEN_STATE) { HandleFailure(); @@ -564,14 +563,14 @@ namespace SaveState INFO_LOG(COMMON, "Rewinding to recent savestate snapshot"); result = rewindStates.Restore(); if (result == CChunkFileReader::ERROR_NONE) { - osm.Show(s->T("Loaded State"), 2.0); + osm.Show(sc->T("Loaded State"), 2.0); callbackResult = true; hasLoadedState = true; } else if (result == CChunkFileReader::ERROR_BROKEN_STATE) { // Cripes. Good news is, we might have more. Let's try those too, better than a reset. if (HandleFailure()) { // Well, we did rewind, even if too much... - osm.Show(s->T("Loaded State"), 2.0); + osm.Show(sc->T("Loaded State"), 2.0); callbackResult = true; hasLoadedState = true; } else { diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index f1becc7139..d4419ba579 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -142,11 +142,11 @@ void EmuScreen::bootComplete() { NOTICE_LOG(BOOT, "Loading %s...", PSP_CoreParameter().fileToStart.c_str()); autoLoad(); - I18NCategory *s = GetI18NCategory("Screen"); + I18NCategory *sc = GetI18NCategory("Screen"); #ifndef MOBILE_DEVICE if (g_Config.bFirstRun) { - osm.Show(s->T("PressESC", "Press ESC to open the pause menu"), 3.0f); + osm.Show(sc->T("PressESC", "Press ESC to open the pause menu"), 3.0f); } #endif memset(virtKeys, 0, sizeof(virtKeys)); @@ -154,9 +154,9 @@ void EmuScreen::bootComplete() { if (g_Config.iGPUBackend == GPU_BACKEND_OPENGL) { const char *renderer = (const char*)glGetString(GL_RENDERER); if (strstr(renderer, "Chainfire3D") != 0) { - osm.Show(s->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true); + osm.Show(sc->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true); } else if (strstr(renderer, "GLTools") != 0) { - osm.Show(s->T("GLToolsWarning", "WARNING: GLTools detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true); + osm.Show(sc->T("GLToolsWarning", "WARNING: GLTools detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true); } } @@ -303,7 +303,7 @@ bool EmuScreen::touch(const TouchInput &touch) { } void EmuScreen::onVKeyDown(int virtualKeyCode) { - I18NCategory *s = GetI18NCategory("Screen"); + I18NCategory *sc = GetI18NCategory("Screen"); switch (virtualKeyCode) { case VIRTKEY_UNTHROTTLE: @@ -313,11 +313,11 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) { case VIRTKEY_SPEED_TOGGLE: if (PSP_CoreParameter().fpsLimit == 0) { PSP_CoreParameter().fpsLimit = 1; - osm.Show(s->T("fixed", "Speed: alternate"), 1.0); + osm.Show(sc->T("fixed", "Speed: alternate"), 1.0); } else if (PSP_CoreParameter().fpsLimit == 1) { PSP_CoreParameter().fpsLimit = 0; - osm.Show(s->T("standard", "Speed: standard"), 1.0); + osm.Show(sc->T("standard", "Speed: standard"), 1.0); } break; @@ -358,7 +358,7 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) { if (SaveState::CanRewind()) { SaveState::Rewind(); } else { - osm.Show(s->T("norewind", "No rewind save states available"), 2.0); + osm.Show(sc->T("norewind", "No rewind save states available"), 2.0); } break; case VIRTKEY_SAVE_STATE: