diff options
author | Max Horn | 2004-09-26 07:30:29 +0000 |
---|---|---|
committer | Max Horn | 2004-09-26 07:30:29 +0000 |
commit | cc7ca9ce4bb071a6d220b945b08a971249e6e892 (patch) | |
tree | 57d1117ea6ce81abf426a6a53d761e4e53b8f2b6 /scumm | |
parent | a53d6ebcf09842466e88465fde22383deb55a5b9 (diff) | |
download | scummvm-rg350-cc7ca9ce4bb071a6d220b945b08a971249e6e892.tar.gz scummvm-rg350-cc7ca9ce4bb071a6d220b945b08a971249e6e892.tar.bz2 scummvm-rg350-cc7ca9ce4bb071a6d220b945b08a971249e6e892.zip |
some more pointless cleanup / moving around of stuff :-)
svn-id: r15284
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 6 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 2 | ||||
-rw-r--r-- | scumm/scumm.cpp | 37 | ||||
-rw-r--r-- | scumm/scumm.h | 3 | ||||
-rw-r--r-- | scumm/verbs.cpp | 9 |
5 files changed, 34 insertions, 23 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 685e744c9b..b7a34ea795 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -209,6 +209,8 @@ protected: public: ScummEngine_v2(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v3(detector, syst, gs, md5sum) {} + virtual void scummInit(); + protected: virtual void setupOpcodes(); virtual void executeOpcode(byte i); @@ -232,6 +234,8 @@ protected: void resetSentence(); void setUserState(byte state); + void initV2MouseOver(); + /* Version 2 script opcodes */ void o2_actorFromPos(); void o2_actorOps(); @@ -567,6 +571,8 @@ protected: public: ScummEngine_v60he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v6(detector, syst, gs, md5sum) {} + virtual void scummInit(); + protected: virtual void setupOpcodes(); virtual void executeOpcode(byte i); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index c5bcc106ea..0efd69cf2e 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -1478,7 +1478,7 @@ void ScummEngine_v6::o6_getInventoryCount() { void ScummEngine_v6::o6_getVerbFromXY() { int y = pop(); int x = pop(); - int over = checkMouseOver(x, y); + int over = findVerbAtPos(x, y); if (over) over = _verbs[over].verbid; push(over); diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 2d1e0b0fd9..52da3e5214 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -1152,15 +1152,6 @@ void ScummEngine::scummInit() { setupEGAPalette(); } - if (_version <= 2) { - initV2MouseOver(); - - // Seems in V2 there was only a single room effect (iris), - // so we set that here. - _switchRoomEffect2 = 1; - _switchRoomEffect = 5; - } - if (_version > 3 && _version < 8) loadCharset(1); @@ -1286,14 +1277,18 @@ void ScummEngine::scummInit() { for (i = 0; i < 512; i++) _keyDownMap[i] = false; - if (_heversion >= 70) { - if (_wizPolygons) - free (_wizPolygons); + _lastSaveTime = _system->get_msecs(); +} - _wizPolygons = (WizPolygon *)calloc(_wizNumPolygons, sizeof(WizPolygon)); - } +void ScummEngine_v2::scummInit() { + ScummEngine::scummInit(); - _lastSaveTime = _system->get_msecs(); + initV2MouseOver(); + + // Seems in V2 there was only a single room effect (iris), + // so we set that here. + _switchRoomEffect2 = 1; + _switchRoomEffect = 5; } void ScummEngine_v6::scummInit() { @@ -1312,6 +1307,16 @@ void ScummEngine_v6::scummInit() { setCursorHotspot(16, 16); } +void ScummEngine_v60he::scummInit() { + ScummEngine::scummInit(); + + if (_heversion >= 70) { + free(_wizPolygons); + + _wizPolygons = (WizPolygon *)calloc(_wizNumPolygons, sizeof(WizPolygon)); + } +} + void ScummEngine::setupMusic(int midi) { _midiDriver = GameDetector::detectMusicDriver(midi); _native_mt32 = ConfMan.getBool("native_mt32"); @@ -1662,7 +1667,7 @@ load_game: } if (_cursor.state > 0) - verbMouseOver(checkMouseOver(_mouse.x, _mouse.y)); + verbMouseOver(findVerbAtPos(_mouse.x, _mouse.y)); if (_version <= 2) { if (oldEgo != VAR(VAR_EGO)) { diff --git a/scumm/scumm.h b/scumm/scumm.h index 02368f12c0..c5e5bae651 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -801,7 +801,7 @@ protected: void redrawVerbs(); void checkExecVerbs(); void verbMouseOver(int verb); - int checkMouseOver(int x, int y) const; + int findVerbAtPos(int x, int y) const; void drawVerb(int verb, int mode); void runInputScript(int a, int cmd, int mode); void restoreVerbBG(int verb); @@ -815,7 +815,6 @@ protected: V2MouseoverBox v2_mouseover_boxes[7]; int8 v2_mouseover_box; - void initV2MouseOver(); void checkV2MouseOver(Common::Point pos); void checkV2Inventory(int x, int y); void redrawV2Inventory(); diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index d65dc2e46e..91b0d7438b 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -22,6 +22,7 @@ #include "stdafx.h" #include "scumm/charset.h" +#include "scumm/intern.h" #include "scumm/object.h" #include "scumm/resource.h" #include "scumm/scumm.h" @@ -35,7 +36,7 @@ enum { kSentenceLine = 6 }; -void ScummEngine::initV2MouseOver() { +void ScummEngine_v2::initV2MouseOver() { int i; int arrow_color, color, hi_color; @@ -266,7 +267,7 @@ void ScummEngine::redrawVerbs() { int i, verb = 0; if (_cursor.state > 0) - verb = checkMouseOver(_mouse.x, _mouse.y); + verb = findVerbAtPos(_mouse.x, _mouse.y); for (i = _numVerbs-1; i >= 0; i--) { if (i == verb && _verbs[verb].hicolor) @@ -308,7 +309,7 @@ void ScummEngine::checkExecVerbs() { // Click into V2 inventory checkV2Inventory(_mouse.x, _mouse.y); } else { - over = checkMouseOver(_mouse.x, _mouse.y); + over = findVerbAtPos(_mouse.x, _mouse.y); if (over != 0) { // Verb was clicked runInputScript(1, _verbs[over].verbid, code); @@ -342,7 +343,7 @@ void ScummEngine::verbMouseOver(int verb) { } } -int ScummEngine::checkMouseOver(int x, int y) const { +int ScummEngine::findVerbAtPos(int x, int y) const { if (!_numVerbs) return 0; |