From ff9569572a3587b96b849fe4ef572ed91c7e6f5d Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 25 Aug 2012 00:08:13 +0200 Subject: [PATCH] TONY: Store savegame names with Common::String. --- engines/tony/detection.cpp | 8 ++++---- engines/tony/game.cpp | 8 ++++---- engines/tony/game.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/engines/tony/detection.cpp b/engines/tony/detection.cpp index c408da3f24d1..8e6d5a64c374 100644 --- a/engines/tony/detection.cpp +++ b/engines/tony/detection.cpp @@ -128,12 +128,12 @@ SaveStateList TonyMetaEngine::listSaves(const char *target) const { if (slotNum >= 0 && slotNum <= 999) { byte thumbnailData[160 * 120 * 2]; - Tony::RMString saveName; + Common::String saveName; byte difficulty; if (Tony::RMOptionScreen::loadThumbnailFromSaveState(slotNum, thumbnailData, saveName, difficulty)) { // Add the save name to the savegame list - saveList.push_back(SaveStateDescriptor(slotNum, (const char *)saveName)); + saveList.push_back(SaveStateDescriptor(slotNum, saveName)); } } } @@ -152,7 +152,7 @@ void TonyMetaEngine::removeSaveState(const char *target, int slot) const { } SaveStateDescriptor TonyMetaEngine::querySaveMetaInfos(const char *target, int slot) const { - Tony::RMString saveName; + Common::String saveName; byte difficulty; byte thumbData[160 * 120 * 2]; @@ -175,7 +175,7 @@ SaveStateDescriptor TonyMetaEngine::querySaveMetaInfos(const char *target, int s } // Create the return descriptor - SaveStateDescriptor desc(slot, (const char *)saveName); + SaveStateDescriptor desc(slot, saveName); desc.setDeletableFlag(true); desc.setWriteProtectedFlag(false); desc.setThumbnail(to); diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index b3b6fe23473b..9b1d85f82785 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -514,7 +514,7 @@ void RMOptionScreen::refreshAll(CORO_PARAM) { if (_statePos == 0 && _ctx->i == 0) s = "Autosave"; else - s = Common::String::format("%02d)%s", _statePos + _ctx->i, (const char *)_curThumbName[_ctx->i]); + s = Common::String::format("%02d)%s", _statePos + _ctx->i, _curThumbName[_ctx->i].c_str()); } _ctx->num[_ctx->i] = new RMText; @@ -558,7 +558,7 @@ void RMOptionScreen::refreshThumbnails() { if (!loadThumbnailFromSaveState(_statePos + i, *_curThumb[i], _curThumbName[i], _curThumbDiff[i])) { delete _curThumb[i]; _curThumb[i] = NULL; - _curThumbName[i] = ""; + _curThumbName[i].clear(); _curThumbDiff[i] = 11; } } @@ -1197,7 +1197,7 @@ void RMOptionScreen::doFrame(CORO_PARAM, RMInput *input) { // Turn on edit mode _bEditSaveName = true; _nEditPos = _ctx->i; - strcpy(_editName, _curThumbName[_ctx->i]); + strcpy(_editName, _curThumbName[_ctx->i].c_str()); _ctx->bRefresh = true; } @@ -1386,7 +1386,7 @@ void RMOptionScreen::removeThis(CORO_PARAM, bool &result) { } -bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, RMString &name, byte &diff) { +bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Common::String &name, byte &diff) { Common::String buf; char namebuf[256]; int i; diff --git a/engines/tony/game.h b/engines/tony/game.h index 1a758dc8ca81..aa7d45bce613 100644 --- a/engines/tony/game.h +++ b/engines/tony/game.h @@ -229,7 +229,7 @@ class RMOptionScreen : public RMGfxWoodyBuffer { RMGfxSourceBuffer8 *_saveEasy; RMGfxSourceBuffer8 *_saveHard; RMGfxSourceBuffer16 *_curThumb[6]; - RMString _curThumbName[6]; + Common::String _curThumbName[6]; byte _curThumbDiff[6]; RMOptionButton *_buttonSave_States[6]; RMOptionButton *_buttonSave_ArrowLeft; @@ -315,7 +315,7 @@ class RMOptionScreen : public RMGfxWoodyBuffer { /** * Retrieves a savegame's thumbnail, description, and difficulty level */ - static bool loadThumbnailFromSaveState(int numState, byte *lpDestBuf, RMString &name, byte &diff); + static bool loadThumbnailFromSaveState(int numState, byte *lpDestBuf, Common::String &name, byte &diff); protected: