[Scummvm-cvs-logs] SF.net SVN: scummvm:[53999] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Mon Nov 1 16:29:06 CET 2010


Revision: 53999
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53999&view=rev
Author:   strangerke
Date:     2010-11-01 15:29:06 +0000 (Mon, 01 Nov 2010)

Log Message:
-----------
HUGO: Make some scheduler functions and variables protected

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/object_v1d.cpp
    scummvm/trunk/engines/hugo/object_v1w.cpp
    scummvm/trunk/engines/hugo/object_v2d.cpp
    scummvm/trunk/engines/hugo/object_v3d.cpp
    scummvm/trunk/engines/hugo/schedule.cpp
    scummvm/trunk/engines/hugo/schedule.h

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-11-01 15:29:06 UTC (rev 53999)
@@ -637,8 +637,8 @@
 		}
 	}
 
-// 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 @@
 	}
 
 	_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();

Modified: scummvm/trunk/engines/hugo/object_v1d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v1d.cpp	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/object_v1d.cpp	2010-11-01 15:29:06 UTC (rev 53999)
@@ -334,8 +334,16 @@
 	}
 
 	// 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) {

Modified: scummvm/trunk/engines/hugo/object_v1w.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v1w.cpp	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/object_v1w.cpp	2010-11-01 15:29:06 UTC (rev 53999)
@@ -342,8 +342,16 @@
 	}
 
 	// 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) {

Modified: scummvm/trunk/engines/hugo/object_v2d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v2d.cpp	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/object_v2d.cpp	2010-11-01 15:29:06 UTC (rev 53999)
@@ -345,8 +345,16 @@
 	}
 
 	// 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

Modified: scummvm/trunk/engines/hugo/object_v3d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v3d.cpp	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/object_v3d.cpp	2010-11-01 15:29:06 UTC (rev 53999)
@@ -228,8 +228,16 @@
 	}
 
 	// 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) {

Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/schedule.cpp	2010-11-01 15:29:06 UTC (rev 53999)
@@ -811,18 +811,11 @@
 
 // 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
 		_actListArr[_alNewscrIndex][3].a8.screenIndex = *_vm->_screen_p - 1;

Modified: scummvm/trunk/engines/hugo/schedule.h
===================================================================
--- scummvm/trunk/engines/hugo/schedule.h	2010-11-01 11:29:57 UTC (rev 53998)
+++ scummvm/trunk/engines/hugo/schedule.h	2010-11-01 15:29:06 UTC (rev 53999)
@@ -53,7 +53,6 @@
 	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 @@
 	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 @@
 		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 event_t *doAction(event_t *curEvent) = 0;
 	virtual void delQueue(event_t *curEvent) = 0;
-	virtual event_t *doAction(event_t *curEvent) = 0;
+	virtual void insertAction(act *action) = 0;
 
 	event_t *getQueue();
+
+	uint32 getDosTicks(bool updateFl);
+	uint32 getWinTicks();
+
 };
 
 class Scheduler_v1d : public Scheduler {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list