Skip to content

Commit

Permalink
TONY: More renaming, reduce some variable scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Sep 7, 2012
1 parent f08978a commit 17d6d73
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 450 deletions.
8 changes: 4 additions & 4 deletions engines/tony/font.cpp
Expand Up @@ -718,8 +718,8 @@ void RMTextDialog::removeThis(CORO_PARAM, bool &result) {
CORO_END_CODE;
}

void RMTextDialog::Unregister() {
RMGfxTask::Unregister();
void RMTextDialog::unregister() {
RMGfxTask::unregister();
assert(_nInList == 0);
CoroScheduler.setEvent(_hEndDisplay);
}
Expand Down Expand Up @@ -934,8 +934,8 @@ RMDialogChoice::~RMDialogChoice() {
CoroScheduler.closeEvent(_hUnreg);
}

void RMDialogChoice::Unregister() {
RMGfxWoodyBuffer::Unregister();
void RMDialogChoice::unregister() {
RMGfxWoodyBuffer::unregister();
assert(!_nInList);
CoroScheduler.pulseEvent(_hUnreg);

Expand Down
4 changes: 2 additions & 2 deletions engines/tony/font.h
Expand Up @@ -252,7 +252,7 @@ class RMTextDialog : public RMText {
virtual void removeThis(CORO_PARAM, bool &result);

// Overloaded de-registration
virtual void Unregister();
virtual void unregister();

// Overloading of the Draw to center the text, if necessary
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
Expand Down Expand Up @@ -344,7 +344,7 @@ class RMDialogChoice : public RMGfxWoodyBuffer {
public:
virtual void removeThis(CORO_PARAM, bool &result);
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
void Unregister();
void unregister();

public:
// Initialization
Expand Down
32 changes: 10 additions & 22 deletions engines/tony/game.cpp
Expand Up @@ -287,9 +287,7 @@ RMOptionScreen::RMOptionScreen() {
_buttonSave_ArrowRight = NULL;
_bEditSaveName = false;

int i;

for (i = 0; i < 6; i++) {
for (int i = 0; i < 6; i++) {
_curThumb[i] = NULL;
_buttonSave_States[i] = NULL;
}
Expand Down Expand Up @@ -500,9 +498,7 @@ void RMOptionScreen::refreshAll(CORO_PARAM) {
}

void RMOptionScreen::refreshThumbnails() {
int i;

for (i = 0; i < 6; i++) {
for (int i = 0; i < 6; i++) {
if (_curThumb[i])
delete _curThumb[i];

Expand Down Expand Up @@ -690,9 +686,7 @@ void RMOptionScreen::closeState() {
_buttonExit = NULL;

if (_nState == MENULOAD || _nState == MENUSAVE) {
int i;

for (i = 0; i < 6; i++) {
for (int i = 0; i < 6; i++) {
if (_curThumb[i] != NULL) {
delete _curThumb[i];
_curThumb[i] = NULL;
Expand Down Expand Up @@ -1342,9 +1336,7 @@ void RMOptionScreen::removeThis(CORO_PARAM, bool &result) {


bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Common::String &name, byte &diff) {
Common::String buf;
char namebuf[256];
int i;
Common::InSaveFile *f;
char id[4];

Expand All @@ -1354,7 +1346,7 @@ bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Com
diff = 10;

// Get the savegame filename for the given slot
buf = g_vm->getSaveStateFileName(nState);
Common::String buf = g_vm->getSaveStateFileName(nState);

// Try and open the savegame
f = g_system->getSavefileManager()->openForLoading(buf);
Expand Down Expand Up @@ -1409,9 +1401,9 @@ bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Com
return true;
}

i = f->readByte();
f->read(namebuf, i);
namebuf[i] = '\0';
int bufSize = f->readByte();
f->read(namebuf, bufSize);
namebuf[bufSize] = '\0';
name = namebuf;

delete f;
Expand All @@ -1435,17 +1427,15 @@ RMPointer::~RMPointer() {
}

void RMPointer::init() {
int i;

for (i = 0; i < 5; i++) {
for (int i = 0; i < 5; i++) {
RMResRaw res(RES_P_GO + i);

_pointer[i] = new RMGfxSourceBuffer8RLEByteAA;
_pointer[i]->init(res, res.width(), res.height(), false);
_pointer[i]->loadPaletteWA(RES_P_PAL);
}

for (i = 0; i < 5; i++) {
for (int i = 0; i < 5; i++) {
RMRes res(RES_P_PAP1 + i);
Common::SeekableReadStream *ds = res.getReadStream();
_specialPointer[i] = new RMItem;
Expand All @@ -1466,9 +1456,7 @@ void RMPointer::init() {
}

void RMPointer::close() {
int i;

for (i = 0; i < 5; i++) {
for (int i = 0; i < 5; i++) {
if (_pointer[i] != NULL) {
delete _pointer[i];
_pointer[i] = NULL;
Expand Down

0 comments on commit 17d6d73

Please sign in to comment.