diff options
author | Travis Howell | 2005-10-19 11:32:25 +0000 |
---|---|---|
committer | Travis Howell | 2005-10-19 11:32:25 +0000 |
commit | 5fb75ec31cc07d2f14ef5d48b7f6f632d1611847 (patch) | |
tree | 7c6e87bee083a9dfb39d43569a93914688bc2a47 | |
parent | 29c7193195daa708e26a70cb5edfa49ed6f1015f (diff) | |
download | scummvm-rg350-5fb75ec31cc07d2f14ef5d48b7f6f632d1611847.tar.gz scummvm-rg350-5fb75ec31cc07d2f14ef5d48b7f6f632d1611847.tar.bz2 scummvm-rg350-5fb75ec31cc07d2f14ef5d48b7f6f632d1611847.zip |
Cleanup
svn-id: r19177
-rw-r--r-- | simon/charset.cpp | 48 | ||||
-rw-r--r-- | simon/items.cpp | 40 | ||||
-rw-r--r-- | simon/saveload.cpp | 14 | ||||
-rw-r--r-- | simon/simon.cpp | 70 | ||||
-rw-r--r-- | simon/simon.h | 22 | ||||
-rw-r--r-- | simon/verb.cpp | 4 |
6 files changed, 99 insertions, 99 deletions
diff --git a/simon/charset.cpp b/simon/charset.cpp index 1ad9322783..538de6db14 100644 --- a/simon/charset.cpp +++ b/simon/charset.cpp @@ -28,12 +28,12 @@ namespace Simon { void SimonEngine::print_char_helper_1(const byte *src, uint len) { uint ind; - if (_fcsPtr1 == NULL) + if (_textWindow == NULL) return; while (len-- != 0) { - if (*src != 12 && _fcsPtr1->fcs_data != NULL && - _fcsData1[ind = get_fcs_ptr_3_index(_fcsPtr1)] != 2) { + if (*src != 12 && _textWindow->fcs_data != NULL && + _fcsData1[ind = get_fcs_ptr_3_index(_textWindow)] != 2) { _fcsData1[ind] = 2; _fcsData2[ind] = 1; @@ -54,7 +54,7 @@ void SimonEngine::print_char_helper_6(uint i) { if (_fcsData2[i]) { lock(); - fcs = _fcsPtrArray3[i]; + fcs = _windowArray[i]; drawIconArray(i, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2); _fcsData2[i] = 0; unlock(); @@ -226,15 +226,15 @@ void SimonEngine::showMessageFormat(const char *s, ...) { vsnprintf(buf, STRINGBUFLEN, s, va); va_end(va); - if (!_fcsData1[_fcsUnk1]) { + if (!_fcsData1[_curWindow]) { showmessage_helper_2(); if (!_showMessageFlag) { - _fcsPtrArray3[0] = _fcsPtr1; - showmessage_helper_3(_fcsPtr1->textLength, - _fcsPtr1->textMaxLength); + _windowArray[0] = _textWindow; + showmessage_helper_3(_textWindow->textLength, + _textWindow->textMaxLength); } _showMessageFlag = true; - _fcsData1[_fcsUnk1] = 1; + _fcsData1[_curWindow] = 1; } for (str = buf; *str; str++) @@ -244,35 +244,35 @@ void SimonEngine::showMessageFormat(const char *s, ...) { void SimonEngine::showmessage_print_char(byte chr) { if (chr == 12) { _numLettersToPrint = 0; - _printCharUnk1 = 0; + _printCharCurPos = 0; print_char_helper_1(&chr, 1); - print_char_helper_5(_fcsPtr1); + print_char_helper_5(_textWindow); } else if (chr == 0 || chr == ' ' || chr == 10) { - if (_printCharUnk2 - _printCharUnk1 >= _numLettersToPrint) { - _printCharUnk1 += _numLettersToPrint; + if (_printCharMaxPos - _printCharCurPos >= _numLettersToPrint) { + _printCharCurPos += _numLettersToPrint; print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint); - if (_printCharUnk1 == _printCharUnk2) { - _printCharUnk1 = 0; + if (_printCharCurPos == _printCharMaxPos) { + _printCharCurPos = 0; } else { if (chr) print_char_helper_1(&chr, 1); if (chr == 10) - _printCharUnk1 = 0; + _printCharCurPos = 0; else if (chr != 0) - _printCharUnk1++; + _printCharCurPos++; } } else { const byte newline_character = 10; - _printCharUnk1 = _numLettersToPrint; + _printCharCurPos = _numLettersToPrint; print_char_helper_1(&newline_character, 1); print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint); if (chr == ' ') { print_char_helper_1(&chr, 1); - _printCharUnk1++; + _printCharCurPos++; } else { print_char_helper_1(&chr, 1); - _printCharUnk1 = 0; + _printCharCurPos = 0; } } _numLettersToPrint = 0; @@ -282,15 +282,15 @@ void SimonEngine::showmessage_print_char(byte chr) { } void SimonEngine::showmessage_helper_2() { - if (_fcsPtr1) + if (_textWindow) return; - _fcsPtr1 = fcs_alloc(8, 0x90, 0x18, 6, 1, 0, 0xF); + _textWindow = openWindow(8, 0x90, 0x18, 6, 1, 0, 0xF); } void SimonEngine::showmessage_helper_3(uint a, uint b) { - _printCharUnk1 = a; - _printCharUnk2 = b; + _printCharCurPos = a; + _printCharMaxPos = b; _numLettersToPrint = 0; } diff --git a/simon/items.cpp b/simon/items.cpp index c8ba3db449..7bd5e2bbdd 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -566,12 +566,12 @@ int SimonEngine::runScript() { uint e = getVarOrWord(); uint f = getVarOrWord(); uint g = getVarOrWord(); - o_unk26_helper(a, b, c, d, e, f, g, 0); + o_defineWindow(a, b, c, d, e, f, g, 0); } break; case 102:{ - fcs_unk_2(getVarOrByte() & 7); + changeWindow(getVarOrByte() & 7); } break; @@ -581,7 +581,7 @@ int SimonEngine::runScript() { break; case 104:{ - fcs_delete(getVarOrByte() & 7); + closeWindow(getVarOrByte() & 7); } break; @@ -762,7 +762,7 @@ int SimonEngine::runScript() { debug(1, "Switch to CD number %d", readVariable(97)); } else { _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true); - o_quit_if_user_presses_y(); + o_confirmQuit(); _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false); } } @@ -955,12 +955,12 @@ int SimonEngine::runScript() { break; case 175:{ /* vga pointer op 1 */ - o_unk_175(); + o_lockZone(); } break; case 176:{ /* vga pointer op 2 */ - o_unk_176(); + o_unlockZone(); } break; @@ -1004,7 +1004,7 @@ int SimonEngine::runScript() { case 181:{ /* force lock */ o_force_lock(); if (_game & GF_SIMON2) { - fcs_unk_2(1); + changeWindow(1); showMessageFormat("\xC"); } } @@ -1381,7 +1381,7 @@ void SimonEngine::o_inventory_descriptions() { } } -void SimonEngine::o_quit_if_user_presses_y() { +void SimonEngine::o_confirmQuit() { // If all else fails, use English as fallback. byte keyYes = 'y'; byte keyNo = 'n'; @@ -1430,7 +1430,7 @@ void SimonEngine::o_quit_if_user_presses_y() { void SimonEngine::o_restoreIconArray(uint fcs_index) { FillOrCopyStruct *fcs; - fcs = _fcsPtrArray3[fcs_index & 7]; + fcs = _windowArray[fcs_index & 7]; if (fcs->fcs_data == NULL) return; drawIconArray(fcs_index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2); @@ -1447,11 +1447,11 @@ void SimonEngine::o_unk_186() { _vgaFileBufOrg = _vgaFileBufOrg2; } -void SimonEngine::o_unk_175() { +void SimonEngine::o_lockZone() { _vgaBufStart = _vgaBufFreeStart; } -void SimonEngine::o_unk_176() { +void SimonEngine::o_unlockZone() { _vgaBufFreeStart = _vgaFileBufOrg; _vgaBufStart = _vgaFileBufOrg; } @@ -1643,12 +1643,12 @@ void SimonEngine::o_play_sound(uint sound_id) { } void SimonEngine::o_unk_160(uint a) { - fcs_setTextColor(_fcsPtrArray3[_fcsUnk1], a); + fcs_setTextColor(_windowArray[_curWindow], a); } void SimonEngine::o_unk_103() { lock(); - removeIconArray(_fcsUnk1); + removeIconArray(_curWindow); showMessageFormat("\x0C"); unlock(); } @@ -1674,17 +1674,17 @@ void SimonEngine::o_kill_sprite_simon2(uint a, uint b) { } /* OK */ -void SimonEngine::o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) { +void SimonEngine::o_defineWindow(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) { a &= 7; - if (_fcsPtrArray3[a]) - fcs_delete(a); + if (_windowArray[a]) + closeWindow(a); - _fcsPtrArray3[a] = fcs_alloc(b, c, d, e, f, g, h); + _windowArray[a] = openWindow(b, c, d, e, f, g, h); - if (a == _fcsUnk1) { - _fcsPtr1 = _fcsPtrArray3[a]; - showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength); + if (a == _curWindow) { + _textWindow = _windowArray[a]; + showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength); } } diff --git a/simon/saveload.cpp b/simon/saveload.cpp index 426617928a..75f7c7b5bb 100644 --- a/simon/saveload.cpp +++ b/simon/saveload.cpp @@ -223,7 +223,7 @@ restart:; // some code here - fcs = _fcsPtrArray3[5]; + fcs = _windowArray[5]; fcs->textRow = unk132_result; @@ -283,7 +283,7 @@ restart:; goto get_out; clear_hitarea_bit_0x40(0xd0 + unk132_result); if (_saveLoadFlag) { - o_clear_character(_fcsPtrArray3[5], 8); + o_clear_character(_windowArray[5], 8); // move code } goto if_1; @@ -297,7 +297,7 @@ restart:; } while (i >= 0x80 || i == 0); // after_do_2 - o_clear_character(_fcsPtrArray3[5], 8); + o_clear_character(_windowArray[5], 8); if (i == 10 || i == 13) break; if (i == 8) { @@ -316,21 +316,21 @@ restart:; name[name_len] = 0; - o_clear_character(_fcsPtrArray3[5], x, m); + o_clear_character(_windowArray[5], x, m); } } else if (i >= 32 && name_len != 17) { name[name_len++] = i; - video_putchar(_fcsPtrArray3[5], i); + video_putchar(_windowArray[5], i); } } // do_save if (!save_game(_saveLoadRowCurPos + unk132_result, buf + unk132_result * 18)) - o_file_error(_fcsPtrArray3[5], true); + o_file_error(_windowArray[5], true); } else { if (!load_game(_saveLoadRowCurPos + i)) - o_file_error(_fcsPtrArray3[5], false); + o_file_error(_windowArray[5], false); } get_out:; diff --git a/simon/simon.cpp b/simon/simon.cpp index 98380e5c47..eb07ea3e0d 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -547,8 +547,8 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) _scriptCondB = 0; _scriptCondC = 0; - _fcsUnk1 = 0; - _fcsPtr1 = 0; + _curWindow = 0; + _textWindow = 0; _subjectItem = 0; _objectItem = 0; @@ -569,8 +569,8 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) _windowNum = 0; - _printCharUnk1 = 0; - _printCharUnk2 = 0; + _printCharCurPos = 0; + _printCharMaxPos = 0; _numLettersToPrint = 0; _lastTime = 0; @@ -647,7 +647,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) memset(_bitArray, 0, sizeof(_bitArray)); memset(_variableArray, 0, sizeof(_variableArray)); - memset(_fcsPtrArray3, 0, sizeof(_fcsPtrArray3)); + memset(_windowArray, 0, sizeof(_windowArray)); memset(_fcsData1, 0, sizeof(_fcsData1)); memset(_fcsData2, 0, sizeof(_fcsData2)); @@ -1226,7 +1226,7 @@ void SimonEngine::itemChildrenChanged(Item *item) { lock(); for (i = 0; i != 8; i++) { - fcs = _fcsPtrArray3[i]; + fcs = _windowArray[i]; if (fcs && fcs->fcs_data && fcs->fcs_data->item_ptr == item) { if (_fcsData1[i]) { _fcsData2[i] = true; @@ -1735,8 +1735,8 @@ void SimonEngine::startSubroutine170() { uint SimonEngine::get_fcs_ptr_3_index(FillOrCopyStruct *fcs) { uint i; - for (i = 0; i != ARRAYSIZE(_fcsPtrArray3); i++) - if (_fcsPtrArray3[i] == fcs) + for (i = 0; i != ARRAYSIZE(_windowArray); i++) + if (_windowArray[i] == fcs) return i; error("get_fcs_ptr_3_index: not found"); @@ -1837,7 +1837,7 @@ void SimonEngine::drawIconArray(uint fcs_index, Item *item_ptr, int unk1, int un bool item_again; uint x_pos, y_pos; - fcs_ptr = _fcsPtrArray3[fcs_index & 7]; + fcs_ptr = _windowArray[fcs_index & 7]; if (!(_game & GF_SIMON2)) { width_div_3 = fcs_ptr->width / 3; @@ -2243,10 +2243,10 @@ void SimonEngine::startUp_helper_2() { if (!_mortalFlag) { _mortalFlag = true; showmessage_print_char(0); - _fcsUnk1 = 0; - if (_fcsPtrArray3[0] != 0) { - _fcsPtr1 = _fcsPtrArray3[0]; - showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength); + _curWindow = 0; + if (_windowArray[0] != 0) { + _textWindow = _windowArray[0]; + showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength); } _mortalFlag = false; } @@ -3037,34 +3037,34 @@ bool SimonEngine::vc_maybe_skip_proc_1(uint16 a, int16 b) { } // OK -void SimonEngine::fcs_delete(uint a) { - if (_fcsPtrArray3[a] == NULL) +void SimonEngine::closeWindow(uint a) { + if (_windowArray[a] == NULL) return; removeIconArray(a); - video_copy_if_flag_0x8_c(_fcsPtrArray3[a]); - _fcsPtrArray3[a] = NULL; - if (_fcsUnk1 == a) { - _fcsPtr1 = NULL; - fcs_unk_2(0); + video_copy_if_flag_0x8_c(_windowArray[a]); + _windowArray[a] = NULL; + if (_curWindow == a) { + _textWindow = NULL; + changeWindow(0); } } // OK -void SimonEngine::fcs_unk_2(uint a) { +void SimonEngine::changeWindow(uint a) { a &= 7; - if (_fcsPtrArray3[a] == NULL || _fcsUnk1 == a) + if (_windowArray[a] == NULL || _curWindow == a) return; - _fcsUnk1 = a; + _curWindow = a; showmessage_print_char(0); - _fcsPtr1 = _fcsPtrArray3[a]; + _textWindow = _windowArray[a]; - showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength); + showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength); } // OK -FillOrCopyStruct *SimonEngine::fcs_alloc(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color) { +FillOrCopyStruct *SimonEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color) { FillOrCopyStruct *fcs; fcs = _fcs_list; @@ -3146,15 +3146,15 @@ void SimonEngine::removeIconArray(uint fcs_index) { uint16 fcsunk1; uint16 i; - fcs = _fcsPtrArray3[fcs_index & 7]; - fcsunk1 = _fcsUnk1; + fcs = _windowArray[fcs_index & 7]; + fcsunk1 = _curWindow; if (fcs == NULL || fcs->fcs_data == NULL) return; - fcs_unk_2(fcs_index); + changeWindow(fcs_index); fcs_putchar(12); - fcs_unk_2(fcsunk1); + changeWindow(fcsunk1); for (i = 0; fcs->fcs_data->e[i].item != NULL; i++) { delete_hitarea_by_index(fcs->fcs_data->e[i].hit_area); @@ -3189,8 +3189,8 @@ void SimonEngine::delete_hitarea_by_index(uint index) { // ok void SimonEngine::fcs_putchar(uint a) { - if (_fcsPtr1 != _fcsPtrArray3[0]) - video_putchar(_fcsPtr1, a); + if (_textWindow != _windowArray[0]) + video_putchar(_textWindow, a); } // ok @@ -3211,10 +3211,10 @@ void SimonEngine::copy_img_from_3_to_2(FillOrCopyStruct *fcs) { _lockWord |= 0x8000; if (!(_game & GF_SIMON2)) { - dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _fcsPtrArray3[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8); + dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _windowArray[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8); } else { - if (_vgaVar6 && _fcsPtrArray3[2] == fcs) { - fcs = _fcsPtrArray3[0x18 / 4]; + if (_vgaVar6 && _windowArray[2] == fcs) { + fcs = _windowArray[0x18 / 4]; _vgaVar6 = 0; } diff --git a/simon/simon.h b/simon/simon.h index fd455367e3..c4c528c792 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -219,8 +219,8 @@ protected: int16 _scriptCondA, _scriptCondB, _scriptCondC; - uint16 _fcsUnk1; - FillOrCopyStruct *_fcsPtr1; + uint16 _curWindow; + FillOrCopyStruct *_textWindow; Item *_subjectItem, *_objectItem; Item *_item1; @@ -239,7 +239,7 @@ protected: uint16 _windowNum; - uint _printCharUnk1, _printCharUnk2; + uint _printCharCurPos, _printCharMaxPos; uint _numLettersToPrint; uint _lastTime; @@ -309,7 +309,7 @@ protected: uint16 _bitArray[48]; int16 _variableArray[256]; - FillOrCopyStruct *_fcsPtrArray3[8]; + FillOrCopyStruct *_windowArray[8]; byte _fcsData1[8]; bool _fcsData2[8]; @@ -471,9 +471,9 @@ protected: void o_kill_sprite_simon2(uint a, uint b); void o_vga_reset(); - void fcs_unk_2(uint a); + void changeWindow(uint a); void o_unk_103(); - void fcs_delete(uint a); + void closeWindow(uint a); void o_unk_108(uint a); void clear_hitarea_bit_0x40(uint hitarea); void set_hitarea_bit_0x40(uint hitarea); @@ -495,7 +495,7 @@ protected: void o_play_music_resource(); void o_save_game(); void o_load_game(); - void o_quit_if_user_presses_y(); + void o_confirmQuit(); void o_restoreIconArray(uint a); void o_unk_138(); void killAllTimers(); @@ -503,8 +503,8 @@ protected: uint getOffsetOfChild2Param(Child2 *child, uint prop); void o_unk_160(uint a); void o_play_sound(uint a); - void o_unk_175(); - void o_unk_176(); + void o_lockZone(); + void o_unlockZone(); void o_pathfind(int x, int y, uint var_1, uint var_2); void o_force_unlock(); void o_force_lock(); @@ -596,10 +596,10 @@ protected: void ensureVgaResLoaded(uint vga_res); void loadSprite(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint palette); - void o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h); + void o_defineWindow(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h); void talk_with_speech(uint speech_id, uint vga_sprite_id); void talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width); - FillOrCopyStruct *fcs_alloc(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color); + FillOrCopyStruct *openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color); void render_string_amiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt); void render_string(uint vga_sprite_id, uint color, uint width, uint height, const char *txt); diff --git a/simon/verb.cpp b/simon/verb.cpp index aa7733393e..e5b6153425 100644 --- a/simon/verb.cpp +++ b/simon/verb.cpp @@ -251,7 +251,7 @@ void SimonEngine::focusVerb(uint hitarea_id) { void SimonEngine::showActionString(uint x, const byte *string) { FillOrCopyStruct *fcs; - fcs = _fcsPtrArray3[1]; + fcs = _windowArray[1]; if (fcs == NULL || fcs->text_color == 0) return; @@ -270,7 +270,7 @@ void SimonEngine::hitareaChangedHelper() { return; } - fcs = _fcsPtrArray3[1]; + fcs = _windowArray[1]; if (fcs != NULL && fcs->text_color != 0) video_fill_or_copy_from_3_to_2(fcs); |