diff options
author | Arnaud Boutonné | 2010-11-01 15:29:06 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2010-11-01 15:29:06 +0000 |
commit | 4c6eb76d79a958bd6901908b3a002cc71cfc4949 (patch) | |
tree | f2a4f208e38a09148e651198e64b61ec2fc6de07 /engines/hugo | |
parent | fc0adb846a4aa5de82de475c1ba2270f2210f767 (diff) | |
download | scummvm-rg350-4c6eb76d79a958bd6901908b3a002cc71cfc4949.tar.gz scummvm-rg350-4c6eb76d79a958bd6901908b3a002cc71cfc4949.tar.bz2 scummvm-rg350-4c6eb76d79a958bd6901908b3a002cc71cfc4949.zip |
HUGO: Make some scheduler functions and variables protected
svn-id: r53999
Diffstat (limited to 'engines/hugo')
-rw-r--r-- | engines/hugo/hugo.cpp | 9 | ||||
-rw-r--r-- | engines/hugo/object_v1d.cpp | 12 | ||||
-rw-r--r-- | engines/hugo/object_v1w.cpp | 12 | ||||
-rw-r--r-- | engines/hugo/object_v2d.cpp | 12 | ||||
-rw-r--r-- | engines/hugo/object_v3d.cpp | 12 | ||||
-rw-r--r-- | engines/hugo/schedule.cpp | 9 | ||||
-rw-r--r-- | engines/hugo/schedule.h | 22 |
7 files changed, 57 insertions, 31 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index b00b50cb6e..4aca02c748 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -637,8 +637,8 @@ bool HugoEngine::loadHugoDat() { } } -// TODO: For Hugo2 and Hugo3, if not in story mode, increment _screenActs[0][0] (ex: kALcrashStory + 1 == kALcrashNoStory) // Read _screenActs + // TODO: For Hugo2 and Hugo3, if not in story mode, increment _screenActs[0][0] (ex: kALcrashStory + 1 == kALcrashNoStory) for (int varnt = 0; varnt < _numVariant; varnt++) { numElem = in.readUint16BE(); if (varnt == _gameVariant) { @@ -664,14 +664,13 @@ bool HugoEngine::loadHugoDat() { } _object->loadObjectArr(in); -//#define HERO 0 - _hero = &_object->_objects[HERO]; // This always points to hero - _screen_p = &(_object->_objects[HERO].screenIndex); // Current screen is hero's + + _hero = &_object->_objects[HERO]; // This always points to hero + _screen_p = &(_object->_objects[HERO].screenIndex); // Current screen is hero's _heroImage = HERO; // Current in use hero image _scheduler->loadActListArr(in); -//read _actListArr for (int varnt = 0; varnt < _numVariant; varnt++) { if (varnt == _gameVariant) { _tunesNbr = in.readSByte(); diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp index e7e9115a62..8c1a65ebd5 100644 --- a/engines/hugo/object_v1d.cpp +++ b/engines/hugo/object_v1d.cpp @@ -334,8 +334,16 @@ void ObjectHandler_v1d::moveObjects() { } // If maze mode is enabled, do special maze processing - if (_maze.enabledFl) - _vm->_scheduler->processMaze(); + if (_maze.enabledFl) { + seq_t *currImage = _vm->_hero->currImagePtr; // Get ptr to current image + // hero coordinates + int x1 = _vm->_hero->x + currImage->x1; // Left edge of object + int x2 = _vm->_hero->x + currImage->x2; // Right edge + int y1 = _vm->_hero->y + currImage->y1; // Top edge + int y2 = _vm->_hero->y + currImage->y2; // Bottom edge + + _vm->_scheduler->processMaze(x1, x2, y1, y2); + } } void ObjectHandler_v1d::swapImages(int objNumb1, int objNumb2) { diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp index 449c3e79ae..0b376889fc 100644 --- a/engines/hugo/object_v1w.cpp +++ b/engines/hugo/object_v1w.cpp @@ -342,8 +342,16 @@ void ObjectHandler_v1w::moveObjects() { } // If maze mode is enabled, do special maze processing - if (_maze.enabledFl) - _vm->_scheduler->processMaze(); + if (_maze.enabledFl) { + seq_t *currImage = _vm->_hero->currImagePtr; // Get ptr to current image + // hero coordinates + int x1 = _vm->_hero->x + currImage->x1; // Left edge of object + int x2 = _vm->_hero->x + currImage->x2; // Right edge + int y1 = _vm->_hero->y + currImage->y1; // Top edge + int y2 = _vm->_hero->y + currImage->y2; // Bottom edge + + _vm->_scheduler->processMaze(x1, x2, y1, y2); + } } void ObjectHandler_v1w::swapImages(int objNumb1, int objNumb2) { diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp index eb840c290b..2915eb6bf0 100644 --- a/engines/hugo/object_v2d.cpp +++ b/engines/hugo/object_v2d.cpp @@ -345,8 +345,16 @@ void ObjectHandler_v2d::moveObjects() { } // If maze mode is enabled, do special maze processing - if (_maze.enabledFl) - _vm->_scheduler->processMaze(); + if (_maze.enabledFl) { + seq_t *currImage = _vm->_hero->currImagePtr; // Get ptr to current image + // hero coordinates + int x1 = _vm->_hero->x + currImage->x1; // Left edge of object + int x2 = _vm->_hero->x + currImage->x2; // Right edge + int y1 = _vm->_hero->y + currImage->y1; // Top edge + int y2 = _vm->_hero->y + currImage->y2; // Bottom edge + + _vm->_scheduler->processMaze(x1, x2, y1, y2); + } } } // End of namespace Hugo diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp index adad3218ec..399a6414ef 100644 --- a/engines/hugo/object_v3d.cpp +++ b/engines/hugo/object_v3d.cpp @@ -228,8 +228,16 @@ void ObjectHandler_v3d::moveObjects() { } // If maze mode is enabled, do special maze processing - if (_maze.enabledFl) - _vm->_scheduler->processMaze(); + if (_maze.enabledFl) { + seq_t *currImage = _vm->_hero->currImagePtr;// Get ptr to current image + // hero coordinates + int x1 = _vm->_hero->x + currImage->x1; // Left edge of object + int x2 = _vm->_hero->x + currImage->x2; // Right edge + int y1 = _vm->_hero->y + currImage->y1; // Top edge + int y2 = _vm->_hero->y + currImage->y2; // Bottom edge + + _vm->_scheduler->processMaze(x1, x2, y1, y2); + } } void ObjectHandler_v3d::swapImages(int objNumb1, int objNumb2) { diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 02597b5656..8a1f74eeae 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -811,17 +811,10 @@ void Scheduler::freeActListArr() { // Maze mode is enabled. Check to see whether hero has crossed the maze // bounding box, if so, go to the next room */ -void Scheduler::processMaze() { +void Scheduler::processMaze(int x1, int x2, int y1, int y2) { debugC(1, kDebugSchedule, "processMaze"); status_t &gameStatus = _vm->getGameStatus(); - seq_t *currImage = _vm->_hero->currImagePtr; // Get ptr to current image - - // hero coordinates - int x1 = _vm->_hero->x + currImage->x1; // Left edge of object - int x2 = _vm->_hero->x + currImage->x2; // Right edge - int y1 = _vm->_hero->y + currImage->y1; // Top edge - int y2 = _vm->_hero->y + currImage->y2; // Bottom edge if (x1 < _maze.x1) { // Exit west diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h index af2a45da2f..1aaa6682a8 100644 --- a/engines/hugo/schedule.h +++ b/engines/hugo/schedule.h @@ -53,7 +53,6 @@ public: Scheduler(HugoEngine *vm); virtual ~Scheduler(); - virtual void insertAction(act *action) = 0; virtual void restoreEvents(Common::SeekableReadStream *f) = 0; virtual void runScheduler() = 0; virtual void saveEvents(Common::WriteStream *f) = 0; @@ -66,17 +65,10 @@ public: void loadAlNewscrIndex(Common::File &in); void newScreen(int screenIndex); void processBonus(int bonusIndex); - void processMaze(); + void processMaze(int x1, int x2, int y1, int y2); void restoreScreen(int screenIndex); void waitForRefresh(void); - uint32 getWinTicks(); - uint32 getDosTicks(bool updateFl); - - act **_actListArr; - uint16 _actListArrSize; - uint16 _alNewscrIndex; - protected: HugoEngine *_vm; @@ -85,16 +77,26 @@ protected: kSsBadSaveGame = 1 }; + uint16 _actListArrSize; + uint16 _alNewscrIndex; + event_t *_freeEvent; // Free list of event structures event_t *_headEvent; // Head of list (earliest time) event_t *_tailEvent; // Tail of list (latest time) event_t _events[kMaxEvents]; // Statically declare event structures + act **_actListArr; + virtual const char *getCypher() = 0; - virtual void delQueue(event_t *curEvent) = 0; virtual event_t *doAction(event_t *curEvent) = 0; + virtual void delQueue(event_t *curEvent) = 0; + virtual void insertAction(act *action) = 0; event_t *getQueue(); + + uint32 getDosTicks(bool updateFl); + uint32 getWinTicks(); + }; class Scheduler_v1d : public Scheduler { |