diff options
Diffstat (limited to 'queen')
-rw-r--r-- | queen/cutaway.cpp | 2 | ||||
-rw-r--r-- | queen/defs.h | 8 | ||||
-rw-r--r-- | queen/display.cpp | 11 | ||||
-rw-r--r-- | queen/graphics.cpp | 8 | ||||
-rw-r--r-- | queen/graphics.h | 26 | ||||
-rw-r--r-- | queen/journal.cpp | 6 | ||||
-rw-r--r-- | queen/logic.cpp | 16 | ||||
-rw-r--r-- | queen/logic.h | 38 | ||||
-rw-r--r-- | queen/walk.h | 6 | ||||
-rw-r--r-- | queen/xref.txt | 48 |
10 files changed, 83 insertions, 86 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 661380441e..43b44433a1 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -954,7 +954,7 @@ void Cutaway::run(char *nextFilename) { if (_roomFade) { _vm->update(); int end = 223; - if (IS_CD_INTRO_ROOM(_vm->logic()->currentRoom())) { + if (_vm->logic()->isIntroRoom(_vm->logic()->currentRoom())) { end = 255; } BobSlot *j = _vm->graphics()->bob(0); diff --git a/queen/defs.h b/queen/defs.h index 58ce4abb12..e64cd99e89 100644 --- a/queen/defs.h +++ b/queen/defs.h @@ -70,10 +70,9 @@ enum { enum { ITEM_NONE = 0, - ITEM_BAT = 1, + ITEM_BAT, ITEM_JOURNAL, - ITEM_JOURNAL_DEMO = 7, - ITEM_KNIFE = 3, + ITEM_KNIFE, ITEM_COCONUT_HALVES, ITEM_BEEF_JERKY, ITEM_PROPELLER, @@ -248,9 +247,6 @@ enum { FRANK_HEAD = 107 }; -#define IS_ALT_INTRO_ROOM(x) ((x) >= 90 && (x) <= 94) -#define IS_CD_INTRO_ROOM(x) ((x) >= 115 && (x) <= 125) - //! GameState vars enum { diff --git a/queen/display.cpp b/queen/display.cpp index c1d4ee4fc7..6268353343 100644 --- a/queen/display.cpp +++ b/queen/display.cpp @@ -23,6 +23,7 @@ #include "queen/display.h" #include "queen/input.h" +#include "queen/logic.h" #include "queen/queen.h" #include "queen/resource.h" @@ -79,7 +80,7 @@ void Display::dynalumInit(const char *roomName, uint16 roomNum) { _dynalum.valid = false; _dynalum.prevColMask = 0xFF; - if (!(IS_ALT_INTRO_ROOM(roomNum) || IS_CD_INTRO_ROOM(roomNum))) { + if (!(_vm->logic()->isAltIntroRoom(roomNum) || _vm->logic()->isIntroRoom(roomNum))) { char filename[20]; sprintf(filename, "%s.msk", roomName); @@ -184,7 +185,7 @@ void Display::palSetPanel() { void Display::palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16 dynaX, int16 dynaY) { debug(9, "Display::palFadeIn(%d, %d)", start, end); memcpy(_pal.screen, _pal.room, 256 * 3); - if (!(IS_ALT_INTRO_ROOM(roomNum) || IS_CD_INTRO_ROOM(roomNum))) { + if (!(_vm->logic()->isAltIntroRoom(roomNum) || _vm->logic()->isIntroRoom(roomNum))) { if (dynalum) { dynalumUpdate(dynaX, dynaY); } @@ -204,7 +205,7 @@ void Display::palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16 } } _pal.dirtyMin = 0; - _pal.dirtyMax = IS_CD_INTRO_ROOM(roomNum) ? 255 : 223; + _pal.dirtyMax = _vm->logic()->isIntroRoom(roomNum) ? 255 : 223; _pal.scrollable = true; } @@ -213,7 +214,7 @@ void Display::palFadeOut(int start, int end, uint16 roomNum) { debug(9, "Display::palFadeOut(%d, %d)", start, end); _pal.scrollable = false; int n = end - start + 1; - if (IS_ALT_INTRO_ROOM(roomNum) || IS_CD_INTRO_ROOM(roomNum)) { + if (_vm->logic()->isAltIntroRoom(roomNum) || _vm->logic()->isIntroRoom(roomNum)) { memset(_pal.screen + start * 3, 0, n * 3); palSet(_pal.screen, start, end, true); } else { @@ -659,7 +660,7 @@ void Display::setupNewRoom(const char *name, uint16 room) { _bdWidth = READ_LE_UINT16(pcxBuf + 12); _bdHeight = READ_LE_UINT16(pcxBuf + 14); readPCX(_backdropBuf, BACKDROP_W, pcxBuf + 128, _bdWidth, _bdHeight); - memcpy(_pal.room, pcxBuf + size - 768, IS_CD_INTRO_ROOM(room) ? 256 * 3 : 144 * 3); + memcpy(_pal.room, pcxBuf + size - 768, _vm->logic()->isIntroRoom(room) ? 256 * 3 : 144 * 3); delete[] pcxBuf; palCustomColors(room); diff --git a/queen/graphics.cpp b/queen/graphics.cpp index 3d4f8c45bb..3f29442bae 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -974,7 +974,7 @@ void BamScene::prepareAnimation() { } -const BamDataBlock BamScene::_carData[] = { +const BamScene::BamDataBlock BamScene::_carData[] = { { { 310, 105, 1 }, { 314, 106, 17 }, { 366, 101, 1 }, 0 }, { { 303, 105, 1 }, { 307, 106, 17 }, { 214, 0, 10 }, 0 }, { { 297, 104, 1 }, { 301, 105, 17 }, { 214, 0, 10 }, 0 }, @@ -1052,7 +1052,7 @@ const BamDataBlock BamScene::_carData[] = { { { 310, 110, 1 }, { 314, 111, 17 }, { 214, 0, 10 }, 99 } }; -const BamDataBlock BamScene::_fight1Data[] = { +const BamScene::BamDataBlock BamScene::_fight1Data[] = { { { 75, 96, 1 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, { { 75, 96, 2 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, { { 75, 96, 3 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, @@ -1101,7 +1101,7 @@ const BamDataBlock BamScene::_fight1Data[] = { { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 99 } }; -const BamDataBlock BamScene::_fight2Data[] = { +const BamScene::BamDataBlock BamScene::_fight2Data[] = { { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, { { 78, 96, 2 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, { { 81, 96, 3 }, { 189, 96, -18 }, { 150, 45, 35 }, 0 }, @@ -1159,7 +1159,7 @@ const BamDataBlock BamScene::_fight2Data[] = { { { 75, 96, 5 }, { 187, 96, -23 }, { 224, 53, 53 }, 99 } }; -const BamDataBlock BamScene::_fight3Data[] = { +const BamScene::BamDataBlock BamScene::_fight3Data[] = { { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, { { 77, 96, 2 }, { 187, 96, -22 }, { 150, 45, 35 }, 0 }, { { 80, 96, 3 }, { 185, 96, -17 }, { 150, 45, 35 }, 0 }, diff --git a/queen/graphics.h b/queen/graphics.h index b0c8369119..312246b77c 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -23,8 +23,8 @@ #define QUEENGRAPHICS_H #include "common/str.h" -#include "queen/defs.h" #include "common/util.h" +#include "queen/defs.h" #include "queen/structs.h" namespace Queen { @@ -173,18 +173,6 @@ private: }; -struct BamDataObj { - int16 x, y; - int16 frame; -}; - -struct BamDataBlock { - BamDataObj obj1; // truck / Frank - BamDataObj obj2; // Rico / robot - BamDataObj fx; - int16 sfx; -}; - class BamScene { public: @@ -210,6 +198,18 @@ public: private: + struct BamDataObj { + int16 x, y; + int16 frame; + }; + + struct BamDataBlock { + BamDataObj obj1; // truck / Frank + BamDataObj obj2; // Rico / robot + BamDataObj fx; + int16 sfx; + }; + BobSlot *_obj1; BobSlot *_obj2; BobSlot *_objfx; diff --git a/queen/journal.cpp b/queen/journal.cpp index 0537645e21..badd891df3 100644 --- a/queen/journal.cpp +++ b/queen/journal.cpp @@ -334,7 +334,6 @@ void Journal::handleYesNoMode(int16 zoneNum) { void Journal::handleMouseWheel(int inc) { - if (_mode == M_NORMAL) { int curSave = _currentSavePage * SAVE_PER_PAGE + _currentSaveSlot + inc; if (curSave >= 0 && curSave < SAVE_PER_PAGE * 10) { @@ -349,7 +348,6 @@ void Journal::handleMouseWheel(int inc) { void Journal::handleMouseDown(int x, int y) { - int16 zone = _vm->grid()->findZoneForPos(GS_ROOM, x, y); if (_mode == M_INFO_BOX) { handleInfoBoxMode(_mode); @@ -363,7 +361,6 @@ void Journal::handleMouseDown(int x, int y) { void Journal::handleKeyDown(uint16 ascii, int keycode) { - if (_mode == M_YES_NO) { if (keycode == 27) { // escape handleYesNoMode(ZN_NO); @@ -377,7 +374,6 @@ void Journal::handleKeyDown(uint16 ascii, int keycode) { void Journal::clearPanelTexts() { - int i; for (i = 0; i < _panelTextCount; ++i) { _vm->graphics()->textClear(_panelTextY[i], _panelTextY[i]); @@ -386,7 +382,6 @@ void Journal::clearPanelTexts() { void Journal::drawPanelText(int y, const char *text) { - char s[80]; strcpy(s, text); char *p = strchr(s, ' '); @@ -403,7 +398,6 @@ void Journal::drawPanelText(int y, const char *text) { void Journal::drawCheckBox(bool active, int bobNum, int16 x, int16 y, int frameNum) { - if (active) { showBob(bobNum, x, y, frameNum); } else { diff --git a/queen/logic.cpp b/queen/logic.cpp index 32f080d55b..8918e6fa33 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -821,16 +821,17 @@ void Logic::roomSetup(const char *room, int comPanel, bool inCutaway) { sprintf(filename, "%s.BBK", room); _vm->bankMan()->load(filename, 15); - _vm->grid()->setupNewRoom(_currentRoom, _roomData[_currentRoom]); _numFrames = 37 + FRAMES_JOE_XTRA; roomSetupFurniture(); roomSetupObjects(); - _vm->display()->forceFullRefresh(); - if (_currentRoom >= 90) { _vm->graphics()->putCameraOnBob(0); } + + _vm->grid()->setupNewRoom(_currentRoom, _roomData[_currentRoom]); + _vm->display()->forceFullRefresh(); + } @@ -850,11 +851,8 @@ void Logic::roomDisplay(uint16 room, RoomDisplayMode mode, uint16 scale, int com if (mode != RDM_NOFADE_JOE) { _vm->update(); BobSlot *joe = _vm->graphics()->bob(0); - if (IS_CD_INTRO_ROOM(_currentRoom)) { - _vm->display()->palFadeIn(0, 255, _currentRoom, joe->active, joe->x, joe->y); - } else { - _vm->display()->palFadeIn(0, 223, _currentRoom, joe->active, joe->x, joe->y); - } + int end = isIntroRoom(_currentRoom) ? 255 : 223; + _vm->display()->palFadeIn(0, end, _currentRoom, joe->active, joe->x, joe->y); } if (pod != NULL) { _vm->walk()->moveJoe(0, pod->x, pod->y, inCutaway); @@ -1469,7 +1467,7 @@ void Logic::objectCopy(int dummyObjectIndex, int realObjectIndex) { } -void Logic::handleSpecialArea(int facing, uint16 areaNum, uint16 walkDataNum) { +void Logic::handleSpecialArea(Direction facing, uint16 areaNum, uint16 walkDataNum) { // queen.c l.2838-2911 debug(9, "handleSpecialArea(%d, %d, %d)\n", facing, areaNum, walkDataNum); diff --git a/queen/logic.h b/queen/logic.h index 14f3cfc869..1a7df1aa39 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -77,6 +77,14 @@ public: error("Invalid room number: %i", room); } + bool isAltIntroRoom(uint16 room) const { + return room >= 90 && room <= 94; + } + + bool isIntroRoom(uint16 room) const { + return room >= 115 && room <= 125; + } + ObjectData *objectData(int index) const; uint16 roomData(int room) const { return _roomData[room]; } GraphicData *graphicData(int index) const { return &_graphicData[index]; } @@ -183,7 +191,7 @@ public: //! Copy data from dummy object to object void objectCopy(int dummyObjectIndex, int objectIndex); - void handleSpecialArea(int facing, uint16 areaNum, uint16 walkDataNum); + void handleSpecialArea(Direction facing, uint16 areaNum, uint16 walkDataNum); void handlePinnacleRoom(); @@ -207,6 +215,20 @@ public: void executeSpecialMove(uint16 sm); + void startCredits(const char *filename); + void stopCredits(); + + enum { + JOE_RESPONSE_MAX = 40, + DEFAULT_TALK_SPEED = 7 * 3, + GAME_STATE_COUNT = 211, + TALK_SELECTED_COUNT = 86 + }; + +protected: + + void initialise(); + void asmMakeJoeUseDress(); void asmMakeJoeUseNormalClothes(); void asmMakeJoeUseUnderwear(); @@ -248,20 +270,6 @@ public: void asmInterviewIntro(); void asmEndInterview(); - void startCredits(const char *filename); - void stopCredits(); - - enum { - JOE_RESPONSE_MAX = 40, - DEFAULT_TALK_SPEED = 7 * 3, - GAME_STATE_COUNT = 211, - TALK_SELECTED_COUNT = 86 - }; - -protected: - - void initialise(); - virtual bool preChangeRoom() = 0; virtual bool handleSpecialMove(uint16 sm) = 0; diff --git a/queen/walk.h b/queen/walk.h index 54238a6250..2f63278afa 100644 --- a/queen/walk.h +++ b/queen/walk.h @@ -31,12 +31,12 @@ namespace Queen { struct MovePersonAnim { int16 firstFrame; int16 lastFrame; - uint16 facing; + Direction facing; - void set(int16 ff, int16 lf, uint16 face) { + void set(int16 ff, int16 lf, Direction dir) { firstFrame = ff; lastFrame = lf; - facing = face; + facing = dir; } }; diff --git a/queen/xref.txt b/queen/xref.txt index 3e5e746456..6251564be6 100644 --- a/queen/xref.txt +++ b/queen/xref.txt @@ -47,7 +47,7 @@ COM_I Command::_cmdInventory COM_I_MAX Command::_numCmdInventory COM_LIST Command::_cmdList COM_LIST_MAX Command::_numCmdList -COMMANDstr Command::_command +COMMANDstr Command::_cmdText DEFCOMM Command::_state.defaultVerb MKEY Command::_mouseKey OLDVERB,VERB Command::_state.*verb @@ -59,18 +59,18 @@ SUBJ1,SUBJ2 Command::_state.subject* CREDIT SCRIPTING SYSTEM ======================= -Cinit() -Ctext() -Cupdate() +Cinit() Credits::Credits() +Ctext() *not needed* (included in Credits::update) +Cupdate() Credits::update - -Ccol -Ccount +Ccol Credits::_color +Ccount Credits::_count Cfp -Cflag -Cfontsize -Cjustify -Cpausecount -Czone +Cflag Credits::_running +Cfontsize Credits::_fontSize +Cjustify Credits::_justify +Cpausecount Credits::_pause +Czone Credits::_zone CUTAWAY @@ -96,22 +96,22 @@ TROOM Cutaway::_temporaryRoom DEBUG ===== cd_sample_check() -debuginfo() Debug::printInfo -select_new_room() Debug::jumpToRoom +debuginfo() Debugger::Cmd_Info +select_new_room() Debugger::Cmd_Room - AREAVAR (boolean, if true display objects/areas boxes) GAME SETTINGS ============= -game_load() Logic::gameLoad() -game_save() Logic::gameSave() +game_load() Logic::gameLoad +game_save() Logic::gameSave - config_request MUSICTOGGLE Sound::_musicToggle / ConfMan.("music_mute") SFXTOGGLE Sound::_sfxToggle / ConfMan.("sfx_mute") -TALKSPD Logic::_talkSpeed / ConfMan.("talkspeed") -TEXTTOGGLE Logic::_subtitles / ConfMan.("subtitles") +TALKSPD QueenEngine::_talkSpeed / ConfMan.("talkspeed") +TEXTTOGGLE QueenEngine::_subtitles / ConfMan.("subtitles") VersionStr GameVersion::versionString VOICETOGGLE Sound::_speechToggle / ConfMan.("speech_mute") VOLUME ? / ConfMan.("master_volume") @@ -126,7 +126,7 @@ clearallbobs() Graphics::bobClearAll clearbob() Graphics::bobClear drawbobs() Graphics::bobDrawAll invbob() Graphics::bobDrawInventoryItem -loadbackdrop() *included in Display::setupNewRoom* +loadbackdrop() *not needed* (included in Display::setupNewRoom) loadpanel() Display::setupPanel MAKE_SPEAK_BOB() Graphics::bobSetText makeanim() BobSlot::animNormal @@ -247,11 +247,9 @@ ITEM_DATA Logic::_itemData NAMETOT Logic::_numNames OBJ_DESC_DATA Logic::_objectDescription OBJ_DESC_MAX Logic::_numObjDesc -OBJECT_BOX Grid::_objectBox OBJECT_DATA Logic::_objectData OBJECT_DESCRstr Logic::_objDescription OBJECT_NAMEstr Logic::_objName -OBJMAX Grid::_objMax OBJTOT Logic::_numObjects OLDROOM,ROOM,NEW_ROOM Logic::_*oom ROOMTOT Logic::_numRooms @@ -353,7 +351,7 @@ FIND_STATE() State::findState* TALK ==== FIND_SACTION() Talk::findSpeechParameters -MOVE_SPEAK() *included in Talk::getSpeakCommand* +MOVE_SPEAK() *not needed* (included in Talk::getSpeakCommand) SPEAK() Talk::speak SPEAK_SUB() Talk::speakSegment talk() Talk::talk @@ -418,18 +416,20 @@ FIND_VERB() Grid::findVerbUnderCursor SETUP_PANEL_ZONES() Grid::setupPanel SETUP_ZONES() Grid::setupNewRoom SetZone() Grid::setZone -zone() Grid:findZoneForPos / Logic::findAreaForPos +zone() Grid::findZoneForPos / Logic::findAreaForPos - AREA Grid::_area AREAMAX Grid::_areaMax +OBJECT_BOX Grid::_objectBox +OBJMAX Grid::_objMax zones Grid::_zones (UNSORTED) ========== -in() defs.h InRange() macro +in() Cutaway::inRange find_cd_cut() findCdCut -find_cd_desc() *not needed* (see Logic::joeSpeak()) +find_cd_desc() *not needed* (included in Logic::joeSpeak) - Kstr bank9 |