Skip to content

Commit

Permalink
TONY: Store savegame names with Common::String.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Aug 25, 2012
1 parent ba20f1d commit ff95695
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions engines/tony/detection.cpp
Expand Up @@ -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));
}
}
}
Expand All @@ -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];

Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions engines/tony/game.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions engines/tony/game.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit ff95695

Please sign in to comment.