[Scummvm-cvs-logs] CVS: scummvm/queen command.cpp,1.37,1.38 command.h,1.10,1.11 cutaway.cpp,1.89,1.90 cutaway.h,1.29,1.30 debug.cpp,1.2,1.3 debug.h,1.2,1.3 display.cpp,1.33,1.34 display.h,1.26,1.27 graphics.cpp,1.55,1.56 graphics.h,1.46,1.47 journal.cpp,1.8,1.9 journal.h,1.3,1.4 logic.cpp,1.130,1.131 logic.h,1.86,1.87 queen.cpp,1.51,1.52 queen.h,1.17,1.18 sound.cpp,1.15,1.16 sound.h,1.7,1.8 talk.cpp,1.58,1.59 talk.h,1.23,1.24 walk.cpp,1.30,1.31 walk.h,1.15,1.16

Gregory Montoir cyx at users.sourceforge.net
Thu Dec 11 15:37:36 CET 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv14445/queen

Modified Files:
	command.cpp command.h cutaway.cpp cutaway.h debug.cpp debug.h 
	display.cpp display.h graphics.cpp graphics.h journal.cpp 
	journal.h logic.cpp logic.h queen.cpp queen.h sound.cpp 
	sound.h talk.cpp talk.h walk.cpp walk.h 
Log Message:
constructors cleanup

Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- command.cpp	11 Dec 2003 21:04:02 -0000	1.37
+++ command.cpp	11 Dec 2003 22:16:34 -0000	1.38
@@ -21,10 +21,12 @@
 
 #include "stdafx.h"
 #include "queen/command.h"
+
 #include "queen/display.h"
 #include "queen/input.h"
 #include "queen/graphics.h"
 #include "queen/logic.h"
+#include "queen/queen.h"
 #include "queen/sound.h"
 #include "queen/state.h"
[...1069 lines suppressed...]
 	}
 	if (!_selCmd.defaultVerb.isNone()) {
 		_cmdText.displayTemp(INK_CMD_LOCK, true, _selCmd.defaultVerb, objName);
@@ -1533,13 +1534,13 @@
 
 void Command::lookCurrentIcon() {
 
-	_curCmd.verb = _logic->findVerbUnderCursor(_input->mousePosX(), _input->mousePosY());
-	if (_curCmd.verb != _curCmd.oldVerb && _logic->joeWalk() != JWM_MOVE) {
+	_curCmd.verb = _vm->logic()->findVerbUnderCursor(_vm->input()->mousePosX(), _vm->input()->mousePosY());
+	if (_curCmd.verb != _curCmd.oldVerb && _vm->logic()->joeWalk() != JWM_MOVE) {
 
 		if (_curCmd.action.isNone()) {
 			_cmdText.clear();
 		}
-		_graphics->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+		_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 		lookCurrentItem();
 
 		// ensure that registers when move to top screen

Index: command.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- command.h	2 Dec 2003 19:58:30 -0000	1.10
+++ command.h	11 Dec 2003 22:16:34 -0000	1.11
@@ -28,11 +28,7 @@
 
 namespace Queen {
 
-class Logic;
-class Graphics;
-class Input;
-class Walk;
-class Sound;
+class QueenEngine;
 
 struct CmdText {
 
@@ -51,8 +47,7 @@
 	};
 
 	char _command[MAX_COMMAND_LEN];
-	Graphics *_graphics;
-	Logic *_logic;
+	QueenEngine *_vm;
 };
 
 
@@ -81,11 +76,10 @@
 	int16 noun;
 };
 
-
 class Command {
 public:
 	
-	Command(Logic *, Graphics *, Input *, Walk *, Sound *);
+	Command(QueenEngine *vm);
 	
 	//! initialise command construction
 	void clear(bool clearTexts);
@@ -186,12 +180,7 @@
 	//! last user selection
 	int _mouseKey, _selPosX, _selPosY;
 
-	Logic *_logic;
-	Graphics *_graphics;
-	Input *_input;
-	Sound *_sound;
-	Walk *_walk;
-
+	QueenEngine *_vm;
 };
 
 } // End of namespace Queen

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- cutaway.cpp	10 Dec 2003 20:13:25 -0000	1.89
+++ cutaway.cpp	11 Dec 2003 22:16:34 -0000	1.90
@@ -21,10 +21,12 @@
 
 #include "stdafx.h"
 #include "queen/cutaway.h"
+
 #include "queen/display.h"
 #include "queen/graphics.h"
 #include "queen/input.h"
 #include "queen/logic.h"
+#include "queen/queen.h"
 #include "queen/resource.h"
 #include "queen/sound.h"
 #include "queen/talk.h"
@@ -48,27 +50,18 @@
 void Cutaway::run(
 		const char *filename, 
 		char *nextFilename,
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound) {
-	Cutaway *cutaway = new Cutaway(filename, graphics, input, logic, resource, sound);
+		QueenEngine *vm) {
+	Cutaway *cutaway = new Cutaway(filename, vm);
 	cutaway->run(nextFilename);
 	delete cutaway;
 }
 
 Cutaway::Cutaway(
 		const char *filename, 
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound) 
-: _graphics(graphics), _input(input), _logic(logic), _resource(resource), _sound(sound), _walk(logic->walk()),
-	_personDataCount(0), _personFaceCount(0), _lastSong(0), _songBeforeComic(0) {
+		QueenEngine *vm)
+	: _vm(vm), _personDataCount(0), _personFaceCount(0), _lastSong(0), _songBeforeComic(0) {
 	memset(&_bankNames, 0, sizeof(_bankNames));
-	_input->cutawayQuitReset();
+	_vm->input()->cutawayQuitReset();
 	load(filename); 
 }
 
@@ -81,7 +74,7 @@
 
 	debug(0, "----- Cutaway::load(\"%s\") -----", filename);
 
-	ptr = _fileData = _resource->loadFile(filename, 20);
+	ptr = _fileData = _vm->resource()->loadFile(filename, 20);
 	if (!_fileData) {
 		error("Failed to load resource data file '%s'", filename);
 	}
@@ -102,17 +95,17 @@
 
 	if (_cutawayObjectCount < 0) {
 		_cutawayObjectCount = -_cutawayObjectCount;
-		_input->canQuit(false);
+		_vm->input()->canQuit(false);
 	}
 	else
-		_input->canQuit(true);
+		_vm->input()->canQuit(true);
 
 	int16 flags1 = (int16)READ_BE_UINT16(ptr);
 	ptr += 2;
 	debug(0, "flags1 = %i", flags1);
 
 	if (flags1 < 0) {
-		_logic->entryObj(0);
+		_vm->logic()->entryObj(0);
 		_finalRoom = -flags1;
 	}
 	else
@@ -143,31 +136,31 @@
 
 	if (_bankNames[0][0]) {
 		debug(0, "Loading bank '%s'", _bankNames[0]);
-		_graphics->bankLoad(_bankNames[0], CUTAWAY_BANK);
+		_vm->graphics()->bankLoad(_bankNames[0], CUTAWAY_BANK);
 	}
 
 	char entryString[MAX_STRING_SIZE];
 	_nextSentence = Talk::getString(_nextSentence, entryString, MAX_STRING_LENGTH);
 	debug(0, "Entry string = '%s'", entryString);
 
-	_logic->joeCutFacing(_logic->joeFacing());
-	_logic->joeFace();
+	_vm->logic()->joeCutFacing(_vm->logic()->joeFacing());
+	_vm->logic()->joeFace();
 
 	if (entryString[0] == '*' &&
 			entryString[1] == 'F' &&
 			entryString[3] == '\0') {
 		switch (entryString[2]) {
 			case 'L':
-				_logic->joeCutFacing(DIR_LEFT);
+				_vm->logic()->joeCutFacing(DIR_LEFT);
 				break;
 			case 'R':
-				_logic->joeCutFacing(DIR_RIGHT);
+				_vm->logic()->joeCutFacing(DIR_RIGHT);
 				break;
 			case 'F':
-				_logic->joeCutFacing(DIR_FRONT);
+				_vm->logic()->joeCutFacing(DIR_FRONT);
 				break;
 			case 'B':
-				_logic->joeCutFacing(DIR_BACK);
+				_vm->logic()->joeCutFacing(DIR_BACK);
 				break;
 		}
 	}
@@ -254,7 +247,7 @@
 			objectNumberStr = "Joe";      break;
 		default:
 			if (object.objectNumber > 0)
-				objectNumberStr = _logic->objectName(ABS(_logic->objectData(object.objectNumber)->name));
+				objectNumberStr = _vm->logic()->objectName(ABS(_vm->logic()->objectData(object.objectNumber)->name));
 			else
 				objectNumberStr = "Unknown!";
 		  break;
@@ -308,7 +301,7 @@
 		}	
 
 		BobSlot *bob = 
-			_graphics->bob( _logic->findBob(object.objectNumber) );
+			_vm->graphics()->bob( _vm->logic()->findBob(object.objectNumber) );
 
 		if (!bob) {
 			warning("Failed to find bob");
@@ -325,7 +318,7 @@
 void Cutaway::restorePersonData() {
 	for (int i = 0; i < _personDataCount; i++) {
 		int index           = _personData[i].index;
-		ObjectData *objectData  = _logic->objectData(index);
+		ObjectData *objectData  = _vm->logic()->objectData(index);
 		objectData->name        = _personData[i].name;
 		objectData->image       = _personData[i].image;
 	}
@@ -342,11 +335,11 @@
 	_personDataCount = 0;
 
 	if (_finalRoom != object.room) {
-		int firstObjectInRoom = _logic->roomData(object.room) + 1;
-		int lastObjectInRoom  = _logic->roomData(object.room) + _logic->objMax(object.room);
+		int firstObjectInRoom = _vm->logic()->roomData(object.room) + 1;
+		int lastObjectInRoom  = _vm->logic()->roomData(object.room) + _vm->logic()->objMax(object.room);
 
 		for (int i = firstObjectInRoom; i <= lastObjectInRoom; i++) {
-			ObjectData *objectData  = _logic->objectData(i);
+			ObjectData *objectData  = _vm->logic()->objectData(i);
 			
 			if (objectData->image == -3 || objectData->image == -4) {
 
@@ -366,7 +359,7 @@
 				}
 
 				/*debug(0, "Person '%s' (%i) is %s", 
-						_logic->objectName(objectData->name),
+						_vm->logic()->objectName(objectData->name),
 						objectData->name,
 						on ? "on" : "off");*/
 
@@ -385,17 +378,17 @@
 
 	// set coordinates for Joe if he is on screen
 
-	_logic->joeX(0);
-	_logic->joeY(0);
+	_vm->logic()->joeX(0);
+	_vm->logic()->joeY(0);
 
 	for (int i = 0; i < object.personCount; i++) {
 		if (PERSON_JOE == object.person[i]) {
-			_logic->joeX(object.bobStartX);
-			_logic->joeY(object.bobStartY);
+			_vm->logic()->joeX(object.bobStartX);
+			_vm->logic()->joeY(object.bobStartY);
 		}
 	}
 
-	_logic->oldRoom(_initialRoom);
+	_vm->logic()->oldRoom(_initialRoom);
 
 	// FIXME: this cutaway is played at the end of the command 0x178. This command
 	// setups some persons and associates bob slots to them. They should be hidden
@@ -414,7 +407,7 @@
 
 	RoomDisplayMode mode;
 
-	if (!_logic->joeX() && !_logic->joeY()) {
+	if (!_vm->logic()->joeX() && !_vm->logic()->joeY()) {
 		mode = RDM_FADE_NOJOE;
 	}
 	else {
@@ -425,11 +418,11 @@
 			mode = RDM_FADE_JOE_XY;
 	}
 
-	_logic->roomDisplay(_logic->currentRoom(), mode, object.scale, comPanel, true);
+	_vm->logic()->roomDisplay(_vm->logic()->currentRoom(), mode, object.scale, comPanel, true);
 
-	_currentImage = _logic->numFrames();
+	_currentImage = _vm->logic()->numFrames();
 
-	_temporaryRoom = _logic->currentRoom();
+	_temporaryRoom = _vm->logic()->currentRoom();
 
 	restorePersonData();
 }
@@ -442,7 +435,7 @@
 	if (object.objectNumber > 0) {
 		if (!object.animList) {
 			// No anim frames, so treat as a PERSON, ie. allow to speak/walk
-			ObjectData *objectData = _logic->objectData(object.objectNumber);
+			ObjectData *objectData = _vm->logic()->objectData(object.objectNumber);
 			if (objectData->image == -3 || objectData->image == -4)
 				objectType = OBJECT_TYPE_PERSON;
 		}
@@ -459,15 +452,15 @@
 		/* Copy FROM_OBJECT into OBJECT */
 
 		if(object.objectNumber != object.fromObject) {
-			_logic->objectCopy(object.fromObject, object.objectNumber);
+			_vm->logic()->objectCopy(object.fromObject, object.objectNumber);
 		}
 		else {
 			// Same object, so just turn it on!
-			ObjectData *objectData = _logic->objectData(object.objectNumber);
+			ObjectData *objectData = _vm->logic()->objectData(object.objectNumber);
 			objectData->name = ABS(objectData->name);
 		}
 
-		_logic->roomRefreshObject(object.objectNumber);
+		_vm->logic()->roomRefreshObject(object.objectNumber);
 
 		// Skip doing any anim stuff
 		objectType = OBJECT_TYPE_NO_ANIMATION;
@@ -512,20 +505,20 @@
 		anim.originalFrame = 29 + FRAMES_JOE_XTRA;
 		
 		// 21/9/94, Make sure that bobs are clipped on 150 screens
-		if (_logic->display()->fullscreen())
-			_graphics->bob(0)->box.y2 = 199;
+		if (_vm->display()->fullscreen())
+			_vm->graphics()->bob(0)->box.y2 = 199;
 	}
 	else {
 		//warning("Stuff not yet implemented in Cutaway::getCutawayAnim()");
 		
-		anim.object = _logic->findBob(header);
+		anim.object = _vm->logic()->findBob(header);
 
 		// If fullscreen cutaway then clip to 199 down
 
 		// 21/9/94, Make sure that bobs are clipped on 150 screens
 		// XXX if(COMPANEL==2 && OBJ_CUT[6]<=0 && BDyres==200) bobs[Param].y2=199;
 
-		anim.originalFrame = _logic->findFrame(header);
+		anim.originalFrame = _vm->logic()->findFrame(header);
 	}
 
 	anim.unpackFrame = (int16)READ_BE_UINT16(ptr);
@@ -544,7 +537,7 @@
 		if (anim.bank != 13) {
 			/* XXX if (OLDBANK != T) */ {
 				//debug(0, "Loading bank '%s'", _bankNames[anim.bank-1]);
-				_graphics->bankLoad(_bankNames[anim.bank-1], CUTAWAY_BANK);
+				_vm->graphics()->bankLoad(_bankNames[anim.bank-1], CUTAWAY_BANK);
 				// XXX OLDBANK=T;
 			}
 
@@ -571,7 +564,7 @@
 	anim.scale = (int16)READ_BE_UINT16(ptr);
 	ptr += 2;
 
-	if (_resource->isDemo()) {
+	if (_vm->resource()->isDemo()) {
 		anim.song = 0;
 	}
 	else {
@@ -633,7 +626,7 @@
 
 		frameCount++;
 
-		if (_input->cutawayQuit())
+		if (_vm->input()->cutawayQuit())
 			return NULL;
 	}
 
@@ -642,17 +635,17 @@
 		
 		debug(0, "----- Complex cutaway animation (animType = %i) -----", object.animType);
 
-		if ((_logic->currentRoom() == 47 || _logic->currentRoom() == 63) &&
+		if ((_vm->logic()->currentRoom() == 47 || _vm->logic()->currentRoom() == 63) &&
 			objAnim[0].object == 1) {
 			//CR 2 - 3/3/95, Special harcoded section to make Oracle work...
-			makeComplexAnimation(_logic->personFrames(1) - 1,  objAnim, frameCount);
+			makeComplexAnimation(_vm->logic()->personFrames(1) - 1,  objAnim, frameCount);
 		}
 		else {
 			_currentImage = makeComplexAnimation(_currentImage, objAnim, frameCount);
 		}
 
 		if (object.bobStartX || object.bobStartY) {
-			BobSlot *bob = _graphics->bob(objAnim[0].object);
+			BobSlot *bob = _vm->graphics()->bob(objAnim[0].object);
 			bob->x = object.bobStartX;
 			bob->y = object.bobStartY;
 		}
@@ -662,12 +655,12 @@
 
 	for (i = 0; i < frameCount; i++) {
 		if (objAnim[i].mx || objAnim[i].my) {
-			BobSlot *bob = _graphics->bob(objAnim[i].object);
+			BobSlot *bob = _vm->graphics()->bob(objAnim[i].object);
 			bob->frameNum = objAnim[i].originalFrame;
 			bob->move(objAnim[i].mx, objAnim[i].my,	(object.specialMove > 0) ? object.specialMove : 4);
 			// Boat room hard coded
-			if (_logic->currentRoom() == ROOM_TEMPLE_OUTSIDE) {
-				BobSlot *bobJoe = _graphics->bob(0);
+			if (_vm->logic()->currentRoom() == ROOM_TEMPLE_OUTSIDE) {
+				BobSlot *bobJoe = _vm->graphics()->bob(0);
 				if (bobJoe->x < 320) {
 					bobJoe->move(bobJoe->x + 346, bobJoe->y,	4);
 				}
@@ -686,7 +679,7 @@
 			//debug(0, "===== Animating frame %i =====", i);
 			//dumpCutawayAnim(objAnim[i]);
 
-			BobSlot *bob = _graphics->bob(objAnim[i].object);
+			BobSlot *bob = _vm->graphics()->bob(objAnim[i].object);
 			bob->active = true;
 			if (bob->animating) {
 				bob->animating = false;
@@ -709,7 +702,7 @@
 								objAnim[i].unpackFrame, 
 								objAnim[i].originalFrame,
 								objAnim[i].bank);*/
-						_graphics->bankUnpack(
+						_vm->graphics()->bankUnpack(
 								objAnim[i].unpackFrame, 
 								objAnim[i].originalFrame,
 								objAnim[i].bank);
@@ -738,14 +731,14 @@
 
 				int j;
 				for (j = 0; j < objAnim[i].speed; j++)
-					_logic->update();
+					_vm->logic()->update();
 			}
 
-			if (_input->cutawayQuit())
+			if (_vm->input()->cutawayQuit())
 				return NULL;
 
 			if (objAnim[i].song > 0)
-				_sound->playSong(objAnim[i].song);
+				_vm->sound()->playSong(objAnim[i].song);
 
 			// Load but don't play
 			if(objAnim[i].song < 0) {
@@ -761,17 +754,17 @@
 
 	while (moving) {
 		moving = false;
-		_logic->update();
+		_vm->logic()->update();
 		
 		for (i = 0; i < frameCount; i++) {
-			BobSlot *bob = _graphics->bob(objAnim[i].object);
+			BobSlot *bob = _vm->graphics()->bob(objAnim[i].object);
 			if (bob->moving) {
 				moving = true;
 				break;
 			}
 		}
 
-		if (_input->cutawayQuit())
+		if (_vm->input()->cutawayQuit())
 			return NULL;
 	}
 
@@ -800,31 +793,31 @@
 
 	if (object.objectNumber == OBJECT_JOE) {
 		if (object.moveToX || object.moveToY) {
-			_walk->moveJoe(0, object.moveToX, object.moveToY, true);
+			_vm->walk()->moveJoe(0, object.moveToX, object.moveToY, true);
 		} 
 	}
 	else {
-		_logic->personSetData(
-				object.objectNumber - _logic->roomData(_logic->currentRoom()), 
+		_vm->logic()->personSetData(
+				object.objectNumber - _vm->logic()->currentRoomData(), 
 				"", true, &p);
 
 		if (object.bobStartX || object.bobStartY) {
-			BobSlot *bob = _graphics->bob(p.actor->bobNum);
+			BobSlot *bob = _vm->graphics()->bob(p.actor->bobNum);
 			bob->scale = scale(object);
 			bob->x = object.bobStartX;
 			bob->y = object.bobStartY;
 		}
 
 		if (object.moveToX || object.moveToY)
-			_walk->movePerson(
+			_vm->walk()->movePerson(
 					&p, 
 					object.moveToX, object.moveToY,
 					_currentImage + 1, 		// XXX CI+1
-					_logic->objectData(object.objectNumber)->image
+					_vm->logic()->objectData(object.objectNumber)->image
 					);
 	}
 
-	if (_input->cutawayQuit())
+	if (_vm->input()->cutawayQuit())
 		return;
 
 	if (0 != strcmp(sentence, "*")) {
@@ -846,18 +839,18 @@
 				if (!foundPerson) {
 					_personFaceCount++;
 					_personFace[_personFaceCount].index = object.objectNumber;
-					_personFace[_personFaceCount].image = _logic->objectData(object.objectNumber)->image;
+					_personFace[_personFaceCount].image = _vm->logic()->objectData(object.objectNumber)->image;
 				}
 			}
 
 			char voiceFilePrefix[MAX_STRING_SIZE];
 			findCdCut(_basename, index, voiceFilePrefix);			
-			_logic->makePersonSpeak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix);
+			_vm->logic()->makePersonSpeak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix);
 		}
 
 	}
 
-	if (_input->cutawayQuit())
+	if (_vm->input()->cutawayQuit())
 		return;
 }
 
@@ -865,21 +858,21 @@
 	int i;
 	nextFilename[0] = '\0';
 
-	_currentImage = _logic->numFrames();
+	_currentImage = _vm->logic()->numFrames();
 
-	BobSlot *joeBob = _graphics->bob(0);
+	BobSlot *joeBob = _vm->graphics()->bob(0);
 	int initialJoeX = joeBob->x;
 	int initialJoeY = joeBob->y;
 	debug(0, "[Cutaway::run] Joe started at (%i, %i)", initialJoeX, initialJoeY);
 
-	_input->cutawayRunning(true);
+	_vm->input()->cutawayRunning(true);
 
-	_initialRoom = _temporaryRoom = _logic->currentRoom();
+	_initialRoom = _temporaryRoom = _vm->logic()->currentRoom();
 
-	_logic->display()->screenMode(_comPanel, true);
+	_vm->display()->screenMode(_comPanel, true);
 
 	if (_comPanel == 0 || _comPanel == 2) {
-		_logic->sceneStart();
+		_vm->logic()->sceneStart();
 	}
 
 	byte *ptr = _objectData;
@@ -893,17 +886,17 @@
 				!object.moveToY && 
 				object.specialMove && 
 				object.objectNumber >= 0) {
-			_logic->executeSpecialMove(object.specialMove);
+			_vm->logic()->executeSpecialMove(object.specialMove);
 			object.specialMove = 0;
 		}
 
 		if (CURRENT_ROOM == object.room) {
 			// Get current room
-			object.room = _logic->currentRoom();
+			object.room = _vm->logic()->currentRoom();
 		}
 		else {
 			// Change current room
-			_logic->currentRoom(object.room);
+			_vm->logic()->currentRoom(object.room);
 		}
 
 		ptr = turnOnPeople(ptr, object);
@@ -928,7 +921,7 @@
 		ObjectType objectType = getObjectType(object);
 
 		if (object.song)
-			_sound->playSong(object.song);
+			_vm->sound()->playSong(object.song);
 
 		switch (objectType) {
 			case OBJECT_TYPE_ANIMATION:
@@ -954,17 +947,17 @@
 				break;
 		}
 
-		if (_input->cutawayQuit())
+		if (_vm->input()->cutawayQuit())
 			break;
 
 		if (_roomFade) {
-			_logic->update();
+			_vm->logic()->update();
 			int end = 223;
-			if (IS_CD_INTRO_ROOM(_logic->currentRoom())) {
+			if (IS_CD_INTRO_ROOM(_vm->logic()->currentRoom())) {
 				end = 255;
 			}
-			BobSlot *j = _graphics->bob(0);
-			_logic->display()->palFadeIn(0, end, _logic->currentRoom(), j->active, j->x, j->y);
+			BobSlot *j = _vm->graphics()->bob(0);
+			_vm->display()->palFadeIn(0, end, _vm->logic()->currentRoom(), j->active, j->x, j->y);
 			_roomFade = false;
 		}
 
@@ -972,26 +965,26 @@
 
 	stop();
 
-	_input->cutawayQuitReset();
+	_vm->input()->cutawayQuitReset();
 
 	updateGameState();
 
-	_graphics->bankErase(CUTAWAY_BANK);
+	_vm->graphics()->bankErase(CUTAWAY_BANK);
 
 	talk(nextFilename);
 
 	if (_comPanel == 0 || (_comPanel == 2 && !_anotherCutaway)) {
-		_logic->sceneStop();
+		_vm->logic()->sceneStop();
 		_comPanel = 0;
 	}
 
 	if (nextFilename[0] == '\0' && !_anotherCutaway) {
-		_logic->display()->fullscreen(false);
+		_vm->display()->fullscreen(false);
 
 		// Lines 2138-2182 in cutaway.c
 		if (_finalRoom) {
-			_logic->newRoom(0);
-			_logic->entryObj(0);
+			_vm->logic()->newRoom(0);
+			_vm->logic()->entryObj(0);
 		}
 		else {
 			/// No need to stay in current room, so return to previous room
@@ -999,55 +992,55 @@
 
 			restorePersonData();
 
-			debug(0, "_logic->entryObj() = %i", _logic->entryObj());
-			if (_logic->entryObj() > 0) {
-				_initialRoom = _logic->objectData(_logic->entryObj())->room;
+			debug(0, "_vm->logic()->entryObj() = %i", _vm->logic()->entryObj());
+			if (_vm->logic()->entryObj() > 0) {
+				_initialRoom = _vm->logic()->objectData(_vm->logic()->entryObj())->room;
 			}
 			else {
 				// We're not returning to new room, so return to old Joe X,Y coords
 				debug(0, "[Cutaway::run] Moving joe to (%i, %i)", initialJoeX, initialJoeY);
-				_logic->joeX(initialJoeX);
-				_logic->joeY(initialJoeY);
+				_vm->logic()->joeX(initialJoeX);
+				_vm->logic()->joeY(initialJoeY);
 			}
 
-			if (_logic->currentRoom() != _initialRoom) {
-				_logic->currentRoom(_initialRoom);
-				_logic->changeRoom();
-				if (_logic->currentRoom() == _logic->newRoom()) {
-					_logic->newRoom(0);
+			if (_vm->logic()->currentRoom() != _initialRoom) {
+				_vm->logic()->currentRoom(_initialRoom);
+				_vm->logic()->changeRoom();
+				if (_vm->logic()->currentRoom() == _vm->logic()->newRoom()) {
+					_vm->logic()->newRoom(0);
 				}
 			}
-			_logic->joeX(0);
-			_logic->joeY(0);
+			_vm->logic()->joeX(0);
+			_vm->logic()->joeY(0);
 		}
 
-		_logic->joeCutFacing(0);
+		_vm->logic()->joeCutFacing(0);
 		_comPanel = 0;
 
 		int k = 0;
-		for (i = _logic->roomData(_logic->currentRoom());
-				i <= _logic->roomData(_logic->currentRoom() + 1); i++) {
+		for (i = _vm->logic()->roomData(_vm->logic()->currentRoom());
+				i <= _vm->logic()->roomData(_vm->logic()->currentRoom() + 1); i++) {
 
-			ObjectData *object = _logic->objectData(i);			
+			ObjectData *object = _vm->logic()->objectData(i);			
 			if (object->image == -3 || object->image == -4) {
 				k++;
 				if (object->name > 0) {
-					_logic->animReset(k);
+					_vm->logic()->animReset(k);
 				}
 			}
 		}
 
 		// function CUTAWAY_SPECIAL(), lines 885-896 in cutaway.c
-		if (_logic->currentRoom() == 1 && _logic->gameState(3) == 0) {
+		if (_vm->logic()->currentRoom() == 1 && _vm->logic()->gameState(3) == 0) {
 			// XXX hard-coded room and inventory items
-			_logic->inventoryDeleteItem(ITEM_CROWBAR, false);
-			_logic->inventoryDeleteItem(ITEM_DRESS, false);
-			_logic->inventoryDeleteItem(ITEM_CLOTHES, false);
-			_logic->inventoryDeleteItem(ITEM_HAY, false);
-			_logic->inventoryDeleteItem(ITEM_OIL, false);
-			_logic->inventoryDeleteItem(ITEM_CHICKEN, false);
-			_logic->gameState(3, 1);
-			_logic->inventoryRefresh();
+			_vm->logic()->inventoryDeleteItem(ITEM_CROWBAR, false);
+			_vm->logic()->inventoryDeleteItem(ITEM_DRESS, false);
+			_vm->logic()->inventoryDeleteItem(ITEM_CLOTHES, false);
+			_vm->logic()->inventoryDeleteItem(ITEM_HAY, false);
+			_vm->logic()->inventoryDeleteItem(ITEM_OIL, false);
+			_vm->logic()->inventoryDeleteItem(ITEM_CHICKEN, false);
+			_vm->logic()->gameState(3, 1);
+			_vm->logic()->inventoryRefresh();
 		}
 
 	}
@@ -1057,13 +1050,13 @@
 	// Make sure Joe is clipped!
 	joeBob->box.y2    = 149;
 
-	_input->cutawayRunning(false);
-	_input->cutawayQuitReset();
+	_vm->input()->cutawayRunning(false);
+	_vm->input()->cutawayQuitReset();
 
 	if (_songBeforeComic > 0)
-		_sound->playSong(_songBeforeComic);
+		_vm->sound()->playSong(_songBeforeComic);
 	else if (_lastSong > 0)
-		_sound->playSong(_lastSong);
+		_vm->sound()->playSong(_lastSong);
 }
 
 void Cutaway::stop() {
@@ -1084,34 +1077,34 @@
 	debug(0, "[Cutaway::stop] Final position is room %i and coordinates (%i, %i)", 
 			joeRoom, joeX, joeY);
 
-	if ((!_input->cutawayQuit() || (!_anotherCutaway && joeRoom == _finalRoom)) &&
+	if ((!_vm->input()->cutawayQuit() || (!_anotherCutaway && joeRoom == _finalRoom)) &&
 			joeRoom != _temporaryRoom &&
 			joeRoom != 0) {
 		
 		debug(0, "[Cutaway::stop] Changing rooms and moving Joe");
 
-		_logic->joeX(joeX);
-		_logic->joeY(joeY);
-		_logic->currentRoom(joeRoom);
-		_logic->oldRoom(_initialRoom);
-		_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE_XY, 0, _comPanel, true);
+		_vm->logic()->joeX(joeX);
+		_vm->logic()->joeY(joeY);
+		_vm->logic()->currentRoom(joeRoom);
+		_vm->logic()->oldRoom(_initialRoom);
+		_vm->logic()->roomDisplay(_vm->logic()->currentRoom(), RDM_FADE_JOE_XY, 0, _comPanel, true);
 	}
 
-	if (_input->cutawayQuit()) {
+	if (_vm->input()->cutawayQuit()) {
 		// Lines 1927-2032 in cutaway.c
 		int i;
 		
 		// Stop the credits from running
 		// XXX CFlag = 0;
 		
-		_graphics->bobStopAll();
+		_vm->graphics()->bobStopAll();
 
 		for (i = 1; i <= _personFaceCount; i++) {
 			int index =  _personFace[i].index;
 			if (index > 0) {
-				_logic->objectData(_personFace[i].index)->image = _personFace[i].image;
+				_vm->logic()->objectData(_personFace[i].index)->image = _personFace[i].image;
 				
-				_graphics->bob(_logic->findBob(index))->xflip = 
+				_vm->graphics()->bob(_vm->logic()->findBob(index))->xflip = 
 					(_personFace[i].image != -4);
 			}
 		}
@@ -1127,8 +1120,8 @@
 			int16 frame   = (int16)READ_BE_UINT16(ptr); ptr += 2;
 			int16 bank    = (int16)READ_BE_UINT16(ptr); ptr += 2;
 
-			int bobIndex = _logic->findBob(objectIndex);
-			ObjectData *object = _logic->objectData(objectIndex);
+			int bobIndex = _vm->logic()->findBob(objectIndex);
+			ObjectData *object = _vm->logic()->objectData(objectIndex);
 
 			if (fromIndex > 0) {
 				if (fromIndex == objectIndex) {
@@ -1136,25 +1129,25 @@
 					object->name = ABS(object->name);
 				}
 				else {
-					_logic->objectCopy(fromIndex, objectIndex);
+					_vm->logic()->objectCopy(fromIndex, objectIndex);
 
-					ObjectData *from = _logic->objectData(fromIndex);
-					if (object->image && !from->image && bobIndex && _logic->currentRoom() == object->room)
-						_graphics->bobClear(bobIndex);
+					ObjectData *from = _vm->logic()->objectData(fromIndex);
+					if (object->image && !from->image && bobIndex && _vm->logic()->currentRoom() == object->room)
+						_vm->graphics()->bobClear(bobIndex);
 				}
 
-				if (_logic->currentRoom() == room)
-					_logic->roomRefreshObject(objectIndex);
+				if (_vm->logic()->currentRoom() == room)
+					_vm->logic()->roomRefreshObject(objectIndex);
 			}
 
-			if (_logic->currentRoom() == object->room) {
-				BobSlot *pbs = _graphics->bob(bobIndex);
+			if (_vm->logic()->currentRoom() == object->room) {
+				BobSlot *pbs = _vm->graphics()->bob(bobIndex);
 
 				if (x || y) {
 					pbs->x = x;
 					pbs->y = y;
 					if (InRange(object->image, -4, -3))
-						pbs->scale = _logic->findScale(x, y);
+						pbs->scale = _vm->logic()->findScale(x, y);
 				}
 
 				if (frame) {
@@ -1162,19 +1155,19 @@
 						bank = 15;
 					else if (bank != 13) {
 						// XXX if(bank != oldBank) {
-						_graphics->bankLoad(_bankNames[bank-1], CUTAWAY_BANK);
+						_vm->graphics()->bankLoad(_bankNames[bank-1], CUTAWAY_BANK);
 						// XXX	oldBank = bank;
 						// XXX }
 						bank = 8;
 					}
 
-					int objectFrame = _logic->findFrame(objectIndex);
+					int objectFrame = _vm->logic()->findFrame(objectIndex);
 
 					if (objectFrame == 1000) {
-						_graphics->bobClear(bobIndex);
+						_vm->graphics()->bobClear(bobIndex);
 					}
 					else if (objectFrame) {
-						_graphics->bankUnpack(ABS(frame), objectFrame, bank);
+						_vm->graphics()->bankUnpack(ABS(frame), objectFrame, bank);
 						pbs->frameNum = objectFrame;
 						if (frame < 0)
 							pbs->xflip = true;
@@ -1185,7 +1178,7 @@
 		} // for()
 		
 		int16 specialMove = (int16)READ_BE_UINT16(ptr); ptr += 2;
-		_logic->executeSpecialMove(specialMove);
+		_vm->logic()->executeSpecialMove(specialMove);
 
 		_lastSong = (int16)READ_BE_UINT16(ptr); ptr += 2;
 	}
@@ -1195,14 +1188,14 @@
 			joeRoom != 105 &&   // XXX hard coded room number
 			joeRoom != 106 &&   // XXX hard coded room number
 			(joeX || joeY)) {
-		BobSlot *joeBob = _graphics->bob(0);
+		BobSlot *joeBob = _vm->graphics()->bob(0);
 		
 		debug(0, "[Cutaway::stop] Moving Joe");
 
 		joeBob->x = joeX;
 		joeBob->y = joeY;
-		_logic->joeScale(_logic->findScale(joeX, joeY));
-		_logic->joeFace();
+		_vm->logic()->joeScale(_vm->logic()->findScale(joeX, joeY));
+		_vm->logic()->joeFace();
 	}
 }
 
@@ -1223,11 +1216,11 @@
 		bool update = false;
 
 		if (stateIndex > 0) {
-			if(_logic->gameState(stateIndex) == stateValue) 
+			if(_vm->logic()->gameState(stateIndex) == stateValue) 
 				update = true;
 		}
 		else {
-			_logic->gameState(ABS(stateIndex), stateValue);
+			_vm->logic()->gameState(ABS(stateIndex), stateValue);
 			update = true;
 		}
 
@@ -1236,17 +1229,17 @@
 			// Show or hide an object
 
 			if (objectIndex > 0) {                    // Show the object
-				ObjectData *objectData  = _logic->objectData(objectIndex);
+				ObjectData *objectData  = _vm->logic()->objectData(objectIndex);
 				objectData->name        = ABS(objectData->name);
 				if (fromObject > 0)
-					_logic->objectCopy(fromObject, objectIndex);
-				_logic->roomRefreshObject(objectIndex);
+					_vm->logic()->objectCopy(fromObject, objectIndex);
+				_vm->logic()->roomRefreshObject(objectIndex);
 			}
 			else if (objectIndex < 0) {               // Hide the object
 				objectIndex             = -objectIndex;
-				ObjectData *objectData  = _logic->objectData(objectIndex);
+				ObjectData *objectData  = _vm->logic()->objectData(objectIndex);
 				objectData->name        = -ABS(objectData->name);
-				_logic->roomRefreshObject(objectIndex);
+				_vm->logic()->roomRefreshObject(objectIndex);
 			}
 
 			if (areaIndex > 0) {
@@ -1254,11 +1247,11 @@
 				// Turn area on or off
 
 				if (areaSubIndex > 0) {
-					Area *area = _logic->area(areaIndex, areaSubIndex);
+					Area *area = _vm->logic()->area(areaIndex, areaSubIndex);
 					area->mapNeighbours = ABS(area->mapNeighbours);
 				}
 				else {
-					Area *area = _logic->area(areaIndex, ABS(areaSubIndex));
+					Area *area = _vm->logic()->area(areaIndex, ABS(areaSubIndex));
 					area->mapNeighbours = -ABS(area->mapNeighbours);
 				}
 			}
@@ -1286,13 +1279,13 @@
 		int personInRoom;
 
 		if (_talkTo > 0)
-			personInRoom = _talkTo - _logic->roomData(_logic->currentRoom());
+			personInRoom = _talkTo - _vm->logic()->roomData(_vm->logic()->currentRoom());
 		else {
 			warning("_talkTo is 0!");
 			personInRoom = 0; 			// XXX is this correct?
 		}
 
-		Talk::talk(_talkFile, personInRoom, nextFilename, _graphics, _input, _logic, _resource, _sound);
+		Talk::talk(_talkFile, personInRoom, nextFilename, _vm);
 	}
 }
 
@@ -1305,7 +1298,7 @@
 	memset(frameIndex, 0, sizeof(frameIndex));
 	debug(0, "[Cutaway::makeComplexAnimation] currentImage = %i", currentImage);
 
-	BobSlot *bob = _graphics->bob(bobNum);
+	BobSlot *bob = _vm->graphics()->bob(bobNum);
 	bob->xflip = objAnim[0].flip;
 
 	for (i = 0; i < frameCount; i++) {
@@ -1332,7 +1325,7 @@
 		if (frameIndex[i]) {
 			currentImage++;
 			//debug(0, "bankUnpack(%i, %i, %i)", i, currentImage, objAnim[0].bank);
-			_graphics->bankUnpack(i, currentImage, objAnim[0].bank);
+			_vm->graphics()->bankUnpack(i, currentImage, objAnim[0].bank);
 		}
 	}
 
@@ -1356,7 +1349,7 @@
 	int flags;
 
 	if (OBJECT_TYPE_TEXT_DISPLAY == type) {
-		x = _graphics->textCenterX(sentence);
+		x = _vm->graphics()->textCenterX(sentence);
 		flags = 2;
 	}
 	else {
@@ -1365,36 +1358,36 @@
 	}
 
 	BobSlot *bob = 
-		_graphics->bob( _logic->findBob(ABS(object.objectNumber)) );
+		_vm->graphics()->bob( _vm->logic()->findBob(ABS(object.objectNumber)) );
 
-	_graphics->bobSetText(bob, sentence, x, object.bobStartY, object.specialMove, flags);
+	_vm->graphics()->bobSetText(bob, sentence, x, object.bobStartY, object.specialMove, flags);
 
 	if (OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) {
 		char voiceFileName[MAX_STRING_SIZE];
 		findCdCut(_basename, index, voiceFileName);
 		strcat(voiceFileName, "1");
-		_sound->sfxPlay(voiceFileName);
+		_vm->sound()->sfxPlay(voiceFileName);
 	}
 
 	int i;
 	for (i = 0; i < spaces; i++) {
-		_logic->update();
+		_vm->logic()->update();
 
 		if (OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) {
 			// XXX: see if speaking is finished
 		}
 
-		if (_input->cutawayQuit())
+		if (_vm->input()->cutawayQuit())
 			return;
 
-		if (_input->keyVerb().isSkipText()) {
-			_input->clearKeyVerb();
+		if (_vm->input()->keyVerb().isSkipText()) {
+			_vm->input()->clearKeyVerb();
 			break;
 		}
 	}
 
-	_graphics->textClear(0,198);
-	_logic->update();
+	_vm->graphics()->textClear(0,198);
+	_vm->logic()->update();
 }
 		
 int Cutaway::countSpaces(ObjectType type, const char *segment) {
@@ -1409,7 +1402,7 @@
 	if (OBJECT_TYPE_TEXT_DISPLAY == type)
 		tmp *= 3;
 
-	return (tmp * 2) / (_logic->talkSpeed() / 3);
+	return (tmp * 2) / (_vm->logic()->talkSpeed() / 3);
 
 }
 
@@ -1427,14 +1420,14 @@
 			y = object.bobStartY;
 		}
 		else {
-			BobSlot *bob = _graphics->bob(0);
+			BobSlot *bob = _vm->graphics()->bob(0);
 			x = bob->x;
 			y = bob->y;
 		}
 
-		int zone = _logic->zoneInArea(0, x, y);
+		int zone = _vm->logic()->zoneInArea(0, x, y);
 		if (zone > 0) {
-			Area *area = _logic->area(_logic->currentRoom(), zone);
+			Area *area = _vm->logic()->area(_vm->logic()->currentRoom(), zone);
 			scaling = area->calcScale(y);
 		}
 	}

Index: cutaway.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cutaway.h	10 Dec 2003 15:36:44 -0000	1.29
+++ cutaway.h	11 Dec 2003 22:16:34 -0000	1.30
@@ -27,13 +27,7 @@
 
 namespace Queen {
 
-class Graphics;
-class Input;
-class Logic;
-class Resource;
-class Sound;
-class Walk;
-
+class QueenEngine;
 
 class Cutaway {
 	public:
@@ -41,11 +35,7 @@
 		static void run(
 				const char *filename,
 				char *nextFilename,
-				Graphics *graphics,
-				Input *input,
-				Logic *logic,
-				Resource *resource,
-				Sound *sound);
+				QueenEngine *vm);
 
 	public:
 		//! Collection of constants used by QueenCutaway
@@ -137,12 +127,7 @@
 		  int16 image;
 		};
 
-		Graphics    *_graphics;
-		Input       *_input;
-		Logic       *_logic;
-		Resource    *_resource;
-		Sound       *_sound;
-		Walk        *_walk;
+		QueenEngine *_vm;
 
 		//! Raw .cut file data (without 20 byte header)
 		byte *_fileData;
@@ -211,13 +196,8 @@
 
 		AnimFrame _cutAnim[17][30];
 
-		Cutaway(
-				const char *filename, 
-				Graphics *graphics,
-				Input *input,
-				Logic *logic,
-				Resource *resource,
-				Sound *sound);
+		Cutaway(const char *filename, 
+				QueenEngine *vm);
 		~Cutaway();
 
 		//! Run this cutaway object 

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/debug.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- debug.cpp	1 Dec 2003 20:48:40 -0000	1.2
+++ debug.cpp	11 Dec 2003 22:16:34 -0000	1.3
@@ -21,17 +21,19 @@
 
 #include "stdafx.h"
 #include "queen/debug.h"
+
 #include "queen/defs.h"
 #include "queen/graphics.h"
 #include "queen/input.h"
 #include "queen/logic.h"
+#include "queen/queen.h"
 #include "queen/resource.h"
 #include "queen/structs.h"
 
 namespace Queen {
 
-Debug::Debug(Input *input, Logic *logic, Graphics *graphics)
-:	_passwordCharCount(0), _stubCount(0), _input(input), _logic(logic), _graphics(graphics) {
+Debug::Debug(QueenEngine *vm)
+	: _passwordCharCount(0), _stubCount(0), _vm(vm) {
 
 	memset(_password, 0, sizeof(_password));
 
@@ -82,18 +84,18 @@
 
 	debug(9, "Debug::jumpToRoom()");
 
-	_graphics->textCurrentColor(INK_JOE);
-	_graphics->textSet(0, 142, "Enter new room");
-	_logic->update();
+	_vm->graphics()->textCurrentColor(INK_JOE);
+	_vm->graphics()->textSet(0, 142, "Enter new room");
+	_vm->logic()->update();
 
 	int room;
 	_digitTextCount = 0;
-	if (_input->waitForNumber(room, digitKeyPressed, this)) {
-		_logic->joeX(0);
-		_logic->joeY(0);
-		_logic->newRoom(room);
-		_logic->entryObj(_logic->roomData(room) + 1);
-		_graphics->textClear(0, 199);
+	if (_vm->input()->waitForNumber(room, digitKeyPressed, this)) {
+		_vm->logic()->joeX(0);
+		_vm->logic()->joeY(0);
+		_vm->logic()->newRoom(room);
+		_vm->logic()->entryObj(_vm->logic()->roomData(room) + 1);
+		_vm->graphics()->textClear(0, 199);
 	}
 }
 
@@ -101,7 +103,7 @@
 void Debug::toggleFastMode() {
 
 	debug(9, "Debug::toggleFastMode()");
-	_input->fastMode(!_input->fastMode());
+	_vm->input()->fastMode(!_vm->input()->fastMode());
 }
 
 
@@ -109,24 +111,24 @@
 
 	debug(9, "Debug::printInfo()");
 
-	_graphics->textClear(0, 199);
-	_graphics->textCurrentColor(INK_JOE);
+	_vm->graphics()->textClear(0, 199);
+	_vm->graphics()->textCurrentColor(INK_JOE);
 
 	char buf[100];
 
-	snprintf(buf, sizeof(buf), "Version : %s", _logic->resource()->JASVersion());
-	_graphics->textSet(110, 20, buf);
+	snprintf(buf, sizeof(buf), "Version : %s", _vm->resource()->JASVersion());
+	_vm->graphics()->textSet(110, 20, buf);
 
-	snprintf(buf, sizeof(buf), "Room number : %d", _logic->currentRoom());
-	_graphics->textSet(110, 40, buf);
+	snprintf(buf, sizeof(buf), "Room number : %d", _vm->logic()->currentRoom());
+	_vm->graphics()->textSet(110, 40, buf);
 
-	snprintf(buf, sizeof(buf), "Room name : %s", _logic->roomName(_logic->currentRoom()));
-	_graphics->textSet(110, 60, buf);
+	snprintf(buf, sizeof(buf), "Room name : %s", _vm->logic()->roomName(_vm->logic()->currentRoom()));
+	_vm->graphics()->textSet(110, 60, buf);
 
-	_logic->update();
+	_vm->logic()->update();
 
 	char c;
-	if (_input->waitForCharacter(c)) {
+	if (_vm->input()->waitForCharacter(c)) {
 		switch (c) {
 		case 'a':
 			toggleAreasDrawing();
@@ -142,7 +144,7 @@
             break;
 		}
 	}
-	_graphics->textClear(0, 199);
+	_vm->graphics()->textClear(0, 199);
 }
 
 
@@ -156,17 +158,17 @@
 void Debug::changeGameState() {
 
 	debug(9, "Debug::changeGameState()");
-	_graphics->textSet(0, 142, "Set GAMESTATE");
-	_logic->update();
+	_vm->graphics()->textSet(0, 142, "Set GAMESTATE");
+	_vm->logic()->update();
 	int slot, value;
 	_digitTextCount = 0;
-	if (_input->waitForNumber(slot, digitKeyPressed, this)) {
-		_graphics->textClear(0, 199);
-		_graphics->textSet(0, 142, "to");
-		_logic->update();
+	if (_vm->input()->waitForNumber(slot, digitKeyPressed, this)) {
+		_vm->graphics()->textClear(0, 199);
+		_vm->graphics()->textSet(0, 142, "to");
+		_vm->logic()->update();
 		_digitTextCount = 0;
-		if (_input->waitForNumber(value, digitKeyPressed, this)) {
-			_logic->gameState(slot, value);
+		if (_vm->input()->waitForNumber(value, digitKeyPressed, this)) {
+			_vm->logic()->gameState(slot, value);
 		}
 	}
 }
@@ -175,18 +177,18 @@
 void Debug::printGameState() {
 
 	debug(9, "Debug::printGameState()");
-	_graphics->textSet(0, 142, "Show GAMESTATE");
-	_logic->update();
+	_vm->graphics()->textSet(0, 142, "Show GAMESTATE");
+	_vm->logic()->update();
 	int slot;
 	_digitTextCount = 0;
-	if (_input->waitForNumber(slot, digitKeyPressed, this)) {
-		_graphics->textClear(0, 199);
+	if (_vm->input()->waitForNumber(slot, digitKeyPressed, this)) {
+		_vm->graphics()->textClear(0, 199);
 		char buf[50];
-		snprintf(buf, sizeof(buf), "Currently - %d", _logic->gameState(slot));
-		_graphics->textSet(0, 142, buf);
-		_logic->update();
+		snprintf(buf, sizeof(buf), "Currently - %d", _vm->logic()->gameState(slot));
+		_vm->graphics()->textSet(0, 142, buf);
+		_vm->logic()->update();
 		char c;
-		_input->waitForCharacter(c);
+		_vm->input()->waitForCharacter(c);
 	}
 }
 
@@ -194,8 +196,8 @@
 void Debug::giveAllItems() {
 
 	debug(9, "Debug::giveAllItems()");
-	int n = _logic->itemDataCount();
-	ItemData *item = _logic->itemData(1);
+	int n = _vm->logic()->itemDataCount();
+	ItemData *item = _vm->logic()->itemData(1);
 	while (n--) {
 		item->name = ABS(item->name);
 		++item;
@@ -214,8 +216,8 @@
 		--debug->_digitTextCount;
 	}
 	debug->_digitText[debug->_digitTextCount] = '\0';
-	debug->_graphics->textSet(0, 151, debug->_digitText);
-	debug->_logic->update();
+	debug->_vm->graphics()->textSet(0, 151, debug->_digitText);
+	debug->_vm->logic()->update();
 }
 
 

Index: debug.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/debug.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- debug.h	1 Dec 2003 20:48:40 -0000	1.2
+++ debug.h	11 Dec 2003 22:16:34 -0000	1.3
@@ -26,15 +26,13 @@
 
 namespace Queen {
 
-class Input;
-class Logic;
-class Graphics;
+class QueenEngine;
 
 class Debug {
 public:
 	typedef void (Debug::*DebugFunc)();
 
-	Debug(Input *, Logic *, Graphics *);
+	Debug(QueenEngine *vm);
 
 	void registerStub(const char *password, DebugFunc debugFunc);
 
@@ -71,10 +69,7 @@
 	DebugStub _stub[MAX_STUB];
 	uint _stubCount;
 
-	Input *_input;
-	Logic *_logic;
-	Graphics *_graphics;
-
+	QueenEngine *_vm;
 };
 
 

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- display.cpp	5 Dec 2003 20:16:32 -0000	1.33
+++ display.cpp	11 Dec 2003 22:16:34 -0000	1.34
@@ -21,15 +21,14 @@
 
 #include "stdafx.h"
 #include "queen/display.h"
+
 #include "queen/input.h"
-#include "queen/logic.h" // For RandomSource
+#include "queen/queen.h"
 #include "queen/resource.h"
 
-
 namespace Queen {
 
 
-
 void TextRenderer::init() {
 
 	// calculate font justification sizes
@@ -100,8 +99,8 @@
 
 
 
-Display::Display(Language language, OSystem *system, Input *input)
-	: _system(system), _input(input) {
+Display::Display(QueenEngine *vm, Language language, OSystem *system)
+	: _system(system), _vm(vm) {
 
 	_dynalum.prevColMask = 0xFF;
 	_textRenderer._lang = language;
@@ -140,7 +139,7 @@
 }
 
 
-void Display::dynalumInit(Resource *resource, const char *roomName, uint16 roomNum) {
+void Display::dynalumInit(const char *roomName, uint16 roomNum) {
 
 	debug(9, "Display::dynalumInit(%s, %d)", roomName, roomNum);
 	memset(_dynalum.msk, 0, sizeof(_dynalum.msk));
@@ -151,14 +150,14 @@
 		char filename[20];
 
 		sprintf(filename, "%s.msk", roomName);
-		_dynalum.valid = resource->exists(filename);
+		_dynalum.valid = _vm->resource()->exists(filename);
 		if (_dynalum.valid)
-			resource->loadFile(filename, 0, (uint8*)_dynalum.msk);
+			_vm->resource()->loadFile(filename, 0, (uint8*)_dynalum.msk);
 
 		sprintf(filename, "%s.lum", roomName);
-		_dynalum.valid = resource->exists(filename);
+		_dynalum.valid = _vm->resource()->exists(filename);
 		if (_dynalum.valid)
-			resource->loadFile(filename, 0, (uint8*)_dynalum.lum);
+			_vm->resource()->loadFile(filename, 0, (uint8*)_dynalum.lum);
 	}
 }
 
@@ -419,7 +418,7 @@
 			j += jdir;
 			if(j <= 0 || j >= 14) {
 				jdir = -jdir;
-				if (Logic::randomizer.getRandomNumber(1)) {
+				if (_vm->randomizer.getRandomNumber(1)) {
 					if (ABS(jdir) == 1) {
 						jdir *= 2;
 					}
@@ -837,7 +836,7 @@
 
 	_gotTick = false;
 	while (!_gotTick) {
-		_input->delay(10);
+		_vm->input()->delay(10);
 	}
 }
 

Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- display.h	11 Dec 2003 10:24:27 -0000	1.26
+++ display.h	11 Dec 2003 22:16:34 -0000	1.27
@@ -58,16 +58,15 @@
 	static const uint8 _font[];
 };
 
-class Input;
-class Resource;
+class QueenEngine;
 
 class Display {
 public:
 
-	Display(Language language, OSystem *system, Input *input);
+	Display(QueenEngine *vm, Language language, OSystem *system);
 	~Display();
 
-	void dynalumInit(Resource *resource, const char *roomName, uint16 roomNum);
+	void dynalumInit(const char *roomName, uint16 roomNum);
 	void dynalumUpdate(int16 x, int16 y);
 
 	void palConvert(uint8 *outPal, const uint8 *inPal, int start, int end);
@@ -150,7 +149,7 @@
 
 	Dynalum _dynalum;
 	OSystem *_system;
-	Input *_input;
+	QueenEngine *_vm;
 
 	static const uint8 _palJoeClothes[];
 	static const uint8 _palJoeDress[];

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- graphics.cpp	3 Dec 2003 13:00:55 -0000	1.55
+++ graphics.cpp	11 Dec 2003 22:16:34 -0000	1.56
@@ -21,11 +21,12 @@
 
 #include "stdafx.h"
 #include "queen/graphics.h"
-#include "queen/logic.h"
+
 #include "queen/display.h"
+#include "queen/logic.h"
+#include "queen/queen.h"
 #include "queen/resource.h"
 
-
 namespace Queen {
 
 
@@ -200,8 +201,8 @@
 }
 
 
-Graphics::Graphics(Display *display, Input *input, Resource *resource)
-	: _cameraBob(0), _display(display), _input(input), _resource(resource) {
+Graphics::Graphics(QueenEngine *vm)
+	: _cameraBob(0), _vm(vm) {
 		
 	memset(_frames, 0, sizeof(_frames));
 	memset(_banks, 0, sizeof(_banks));
@@ -226,7 +227,7 @@
 void Graphics::bankLoad(const char *bankname, uint32 bankslot) {
 		
 	bankErase(bankslot);
-	_banks[bankslot].data = _resource->loadFile(bankname);
+	_banks[bankslot].data = _vm->resource()->loadFile(bankname);
 	if (!_banks[bankslot].data) {
 	  error("Unable to open bank '%s'", bankname);	
 	}
@@ -312,7 +313,7 @@
 	bankErase(17);
 
 	BobFrame *bf = &_frames[1];
-	_display->setMouseCursor(bf->data, bf->width, bf->height, bf->xhotspot, bf->yhotspot);
+	_vm->display()->setMouseCursor(bf->data, bf->width, bf->height, bf->xhotspot, bf->yhotspot);
 }
 
 
@@ -364,12 +365,12 @@
 		src += w * y_skip;
 		if (!bs->xflip) {
 			src += x_skip;
-			_display->blit(RB_SCREEN, x, y, src, w_new, h_new, w, bs->xflip, true);
+			_vm->display()->blit(RB_SCREEN, x, y, src, w_new, h_new, w, bs->xflip, true);
 		}
 		else {
 			src += w - w_new - x_skip;
 			x += w_new - 1;
-			_display->blit(RB_SCREEN, x, y, src, w_new, h_new, w, bs->xflip, true);
+			_vm->display()->blit(RB_SCREEN, x, y, src, w_new, h_new, w, bs->xflip, true);
 		}
 	}
 
@@ -380,11 +381,11 @@
 
 	if (bobnum == 0) {
 		// clear panel area
-		_display->fill(RB_PANEL, x, y, 32, 32, INK_BG_PANEL);
+		_vm->display()->fill(RB_PANEL, x, y, 32, 32, INK_BG_PANEL);
 	}
 	else {
 		BobFrame *pbf = &_frames[bobnum];
-		_display->blit(RB_PANEL, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, false);
+		_vm->display()->blit(RB_PANEL, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, false);
 	}
 }
 
@@ -392,7 +393,7 @@
 void Graphics::bobPaste(uint32 frameNum, int16 x, int16 y) {
 
 	BobFrame *pbf = &_frames[frameNum];
-	_display->blit(RB_BACKDROP, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, true);
+	_vm->display()->blit(RB_BACKDROP, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, true);
 	frameErase(frameNum);
 }
 
@@ -447,7 +448,7 @@
 
 	BobSlot *pbs = &_bobs[bobnum];
 	pbs->clear();
-	if (_display->fullscreen() || bobnum == 16) { // FIXME: does bob number 16 really used ?
+	if (_vm->display()->fullscreen() || bobnum == 16) { // FIXME: does bob number 16 really used ?
 		pbs->box.y2 = GAME_SCREEN_HEIGHT - 1;
 	}
 }
@@ -517,7 +518,7 @@
 			}
 
 			// adjusts position to hot-spot and screen scroll
-			x = pbs->x - xh - _display->horizontalScroll();
+			x = pbs->x - xh - _vm->display()->horizontalScroll();
 			y = pbs->y - yh;
 
 			bobDraw(pbs, x, y);
@@ -556,7 +557,7 @@
 void Graphics::bobCustomParallax(uint16 roomNum) {
 	
 	int i;
-	uint16 screenScroll = _display->horizontalScroll();
+	uint16 screenScroll = _vm->display()->horizontalScroll();
 	switch (roomNum) {
 	case ROOM_AMAZON_HIDEOUT:
 		_bobs[8].x = 250 - screenScroll / 2;
@@ -575,7 +576,7 @@
 		_bobs[5].x = 600 - screenScroll / 2;
 		break;
 	case ROOM_HOTEL_LOBBY:
-		if(_display->fullscreen()) {
+		if(_vm->display()->fullscreen()) {
 			for(i = 1; i <= 3; ++i) {
 				_bobs[i].box.y2 = 199;
 			}
@@ -606,7 +607,7 @@
 		_cameraBob = -1;
 		debug(9, "Graphics::bobCustomParallax() - %d", screenScroll);
 		if (screenScroll < 80) {
-			_display->horizontalScroll(screenScroll + 4);
+			_vm->display()->horizontalScroll(screenScroll + 4);
 			// Joe's body and head
 			_bobs[ 1].x += 4;
 			_bobs[20].x += 4;
@@ -657,7 +658,7 @@
 	for (y = GAME_SCREEN_HEIGHT - 1; y > 0; --y) {
 		const TextSlot *pts = &_texts[y];
 		if (!pts->text.isEmpty()) {
-			_display->textDraw(pts->x, y, pts->color, pts->text.c_str(), pts->outlined);
+			_vm->display()->textDraw(pts->x, y, pts->color, pts->text.c_str(), pts->outlined);
 		}
 	}
 }
@@ -674,7 +675,7 @@
 
 uint16 Graphics::textWidth(const char* text) const {
 
-	return _display->textWidth(text);
+	return _vm->display()->textWidth(text);
 }
 
 
@@ -706,14 +707,14 @@
 	char roomPrefix[20];
 	strcpy(roomPrefix, name);
 	roomPrefix[ strlen(roomPrefix) - 4 ] = '\0';
-	_display->dynalumInit(_resource, roomPrefix, room);
+	_vm->display()->dynalumInit(roomPrefix, room);
 
-	uint8 *pcxbuf = _resource->loadFile(name);
+	uint8 *pcxbuf = _vm->resource()->loadFile(name);
 	if (pcxbuf == NULL) {
 		error("Unable to load backdrop : '%s'", name);
 	}
-	uint32 size = _resource->fileSize(name);
-	_display->pcxReadBackdrop(pcxbuf, size, room > 114);
+	uint32 size = _vm->resource()->fileSize(name);
+	_vm->display()->pcxReadBackdrop(pcxbuf, size, room > 114);
 	delete[] pcxbuf;
 
 	if (room >= 90) {
@@ -724,12 +725,12 @@
 
 void Graphics::loadPanel() {
 
-	uint8 *pcxbuf = _resource->loadFile("panel.pcx");
+	uint8 *pcxbuf = _vm->resource()->loadFile("panel.pcx");
 	if (pcxbuf == NULL) {
 		error("Unable to open panel file");
 	}
-	uint32 size = _resource->fileSize("panel.pcx");
-	_display->pcxReadPanel(pcxbuf, size);
+	uint32 size = _vm->resource()->fileSize("panel.pcx");
+	_vm->display()->pcxReadPanel(pcxbuf, size);
 	delete[] pcxbuf;
 }
 
@@ -863,7 +864,7 @@
 				_bam._fight2Data,
 				_bam._fight3Data
 			};
-			_bam._fightData = data[Logic::randomizer.getRandomNumber(2)];
+			_bam._fightData = data[_vm->randomizer.getRandomNumber(2)];
 			if (_bam.flag == 2) {
 				_bam.flag = 0;
 			}
@@ -877,10 +878,10 @@
 
 	bobSortAll();
 	if (_cameraBob >= 0) {
-		_display->horizontalScrollUpdate(_bobs[_cameraBob].x);
+		_vm->display()->horizontalScrollUpdate(_bobs[_cameraBob].x);
 	}
 	bobCustomParallax(room);
-	_display->prepareUpdate();
+	_vm->display()->prepareUpdate();
 	bobDrawAll();
 	textDrawAll();
 }

Index: graphics.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- graphics.h	11 Dec 2003 21:04:02 -0000	1.46
+++ graphics.h	11 Dec 2003 22:16:35 -0000	1.47
@@ -130,14 +130,12 @@
 };
 
 
-class Display;
-class Input;
-class Resource;
+class QueenEngine;
 
 class Graphics {
 public:
 
-	Graphics(Display *display, Input *input, Resource *resource);
+	Graphics(QueenEngine *vm);
 	~Graphics();
 
 	void bankLoad(const char *bankname, uint32 bankslot); // loadbank()
@@ -237,10 +235,7 @@
 
 	BamData _bam;
 
-	Display *_display;
-	Input *_input;
-	Resource *_resource;
-
+	QueenEngine *_vm;
 };
 
 } // End of namespace Queen

Index: journal.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/journal.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- journal.cpp	10 Dec 2003 20:13:25 -0000	1.8
+++ journal.cpp	11 Dec 2003 22:16:35 -0000	1.9
@@ -20,20 +20,20 @@
  */
 
 #include "stdafx.h"
-#include "base/engine.h" // For g_engine
 #include "queen/journal.h"
+
 #include "queen/display.h"
 #include "queen/graphics.h"
 #include "queen/logic.h"
+#include "queen/queen.h"
 #include "queen/resource.h"
 #include "queen/sound.h"
 
 namespace Queen {
 
 
-Journal::Journal(Logic *l, Graphics *g, Display *d, Sound *s)
-	: _logic(l), _graphics(g), _display(d), _sound(s) {
-	_savePath = g_engine->getSavePath();
+Journal::Journal(QueenEngine *vm)
+	: _vm(vm) {
 	_currentSavePage = 0;
 	_currentSaveSlot = 0;
 }
@@ -41,7 +41,7 @@
 
 void Journal::use() {
 
-	BobSlot *joe = _graphics->bob(0);
+	BobSlot *joe = _vm->graphics()->bob(0);
 	_prevJoeX = joe->x;
 	_prevJoeY = joe->y;
 
@@ -51,11 +51,11 @@
 	findSaveDescriptions();
 
 	_panelTextCount = 0;
-	_display->palFadeOut(0, 255, JOURNAL_ROOM);
+	_vm->display()->palFadeOut(0, 255, JOURNAL_ROOM);
 	prepare();
 	redraw();
 	update();
-	_display->palFadeIn(0, 255, JOURNAL_ROOM);
+	_vm->display()->palFadeIn(0, 255, JOURNAL_ROOM);
 
 	_quitCleanly = true;
 	_quit = false;
@@ -80,10 +80,10 @@
 		g_system->delay_msecs(20);
 	}
 
-	_logic->writeOptionSettings();
+	_vm->logic()->writeOptionSettings();
 
-	_graphics->textClear(0, GAME_SCREEN_HEIGHT - 1);
-	_graphics->cameraBob(0);
+	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->graphics()->cameraBob(0);
 	if (_quitCleanly) {
 		restore();
 	}
@@ -92,60 +92,60 @@
 
 void Journal::prepare() {
 
-	_display->horizontalScroll(0);
-	_display->fullscreen(true);
+	_vm->display()->horizontalScroll(0);
+	_vm->display()->fullscreen(true);
 
-	_graphics->cameraBob(-1);
-	_graphics->bobClearAll();
-	_graphics->textClear(0, GAME_SCREEN_HEIGHT - 1);
-	_graphics->frameEraseAll(false);
+	_vm->graphics()->cameraBob(-1);
+	_vm->graphics()->bobClearAll();
+	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->graphics()->frameEraseAll(false);
 
 	int i;
-	_logic->zoneClearAll(ZONE_ROOM);
+	_vm->logic()->zoneClearAll(ZONE_ROOM);
 	for (i = 0; i < 4; ++i) { // left panel
-		_logic->zoneSet(ZONE_ROOM, i + 1, 32, 8 + i * 48, 96, 40 + i * 48);
+		_vm->logic()->zoneSet(ZONE_ROOM, i + 1, 32, 8 + i * 48, 96, 40 + i * 48);
 	}
-	_logic->zoneSet(ZONE_ROOM, ZN_TEXT_SPEED, 136, 169, 265, 176);
-    _logic->zoneSet(ZONE_ROOM, ZN_SFX_TOGGLE, 221 - 24, 155, 231, 164);
-    _logic->zoneSet(ZONE_ROOM, ZN_MUSIC_VOLUME, 136, 182, 265, 189);
+	_vm->logic()->zoneSet(ZONE_ROOM, ZN_TEXT_SPEED, 136, 169, 265, 176);
+    _vm->logic()->zoneSet(ZONE_ROOM, ZN_SFX_TOGGLE, 221 - 24, 155, 231, 164);
+    _vm->logic()->zoneSet(ZONE_ROOM, ZN_MUSIC_VOLUME, 136, 182, 265, 189);
 	for (i = 0; i < 10; ++i) { // right panel
-        _logic->zoneSet(ZONE_ROOM, ZN_DESC_FIRST + i, 131, 7 + i * 13, 290, 18 + i * 13);
-        _logic->zoneSet(ZONE_ROOM, ZN_PAGE_FIRST + i, 300, 4 + i * 15, 319, 17 + i * 15);
+        _vm->logic()->zoneSet(ZONE_ROOM, ZN_DESC_FIRST + i, 131, 7 + i * 13, 290, 18 + i * 13);
+        _vm->logic()->zoneSet(ZONE_ROOM, ZN_PAGE_FIRST + i, 300, 4 + i * 15, 319, 17 + i * 15);
 	}
-    _logic->zoneSet(ZONE_ROOM, ZN_INFO_BOX, 273, 146, 295, 189);
-    _logic->zoneSet(ZONE_ROOM, ZN_MUSIC_TOGGLE, 125 - 16, 181, 135, 190);
-    _logic->zoneSet(ZONE_ROOM, ZN_VOICE_TOGGLE, 158 - 24, 155, 168, 164);
-    _logic->zoneSet(ZONE_ROOM, ZN_TEXT_TOGGLE, 125 - 16, 168, 135, 177);
+    _vm->logic()->zoneSet(ZONE_ROOM, ZN_INFO_BOX, 273, 146, 295, 189);
+    _vm->logic()->zoneSet(ZONE_ROOM, ZN_MUSIC_TOGGLE, 125 - 16, 181, 135, 190);
+    _vm->logic()->zoneSet(ZONE_ROOM, ZN_VOICE_TOGGLE, 158 - 24, 155, 168, 164);
+    _vm->logic()->zoneSet(ZONE_ROOM, ZN_TEXT_TOGGLE, 125 - 16, 168, 135, 177);
 
-	_graphics->loadBackdrop("journal.PCX", JOURNAL_ROOM);
-	_graphics->bankLoad("journal.BBK", JOURNAL_BANK);
+	_vm->graphics()->loadBackdrop("journal.PCX", JOURNAL_ROOM);
+	_vm->graphics()->bankLoad("journal.BBK", JOURNAL_BANK);
 	for (i = 1; i <= 20; ++i) {
 		int frameNum = JOURNAL_FRAMES + i;
-		_graphics->bankUnpack(i, frameNum, JOURNAL_BANK);
-		BobFrame *bf = _graphics->frame(frameNum);
+		_vm->graphics()->bankUnpack(i, frameNum, JOURNAL_BANK);
+		BobFrame *bf = _vm->graphics()->frame(frameNum);
 		bf->xhotspot = 0;
 		bf->yhotspot = 0;
 		if (i == FRAME_INFO_BOX) { // adjust info box hot spot to put it on top always
 			bf->yhotspot = 200;
 		}
 	}
-	_graphics->bankErase(JOURNAL_BANK);
+	_vm->graphics()->bankErase(JOURNAL_BANK);
 
-	_graphics->textCurrentColor(INK_JOURNAL);
+	_vm->graphics()->textCurrentColor(INK_JOURNAL);
 }
 
 
 void Journal::restore() {
 
-	_display->fullscreen(false);
+	_vm->display()->fullscreen(false);
 
-	_logic->joeX(_prevJoeX);
-	_logic->joeY(_prevJoeY);
+	_vm->logic()->joeX(_prevJoeX);
+	_vm->logic()->joeY(_prevJoeY);
 	
-	_logic->joeCutFacing(_logic->joeFacing());
+	_vm->logic()->joeCutFacing(_vm->logic()->joeFacing());
 
-	_logic->oldRoom(_logic->currentRoom());
-	_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 0, 0, false);
+	_vm->logic()->oldRoom(_vm->logic()->currentRoom());
+	_vm->logic()->roomDisplay(_vm->logic()->currentRoom(), RDM_FADE_JOE, 0, 0, false);
 }
 
 
@@ -160,19 +160,19 @@
 
 void Journal::update() {
 
-	_graphics->update(JOURNAL_ROOM);
+	_vm->graphics()->update(JOURNAL_ROOM);
 	if (_edit.enable) {
 		int16 x = 136 + _edit.posCursor;
 		int16 y = 9 + _currentSaveSlot * 13 + 8;
-		_display->drawBox(x, y, x + 6, y, INK_JOURNAL);
+		_vm->display()->drawBox(x, y, x + 6, y, INK_JOURNAL);
 	}
-	_display->update();
+	_vm->display()->update();
 }
 
 
 void Journal::showBob(int bobNum, int16 x, int16 y, int frameNum) {
 
-	BobSlot *bob = _graphics->bob(bobNum);
+	BobSlot *bob = _vm->graphics()->bob(bobNum);
 	bob->curPos(x, y);
 	bob->frameNum = JOURNAL_FRAMES + frameNum;
 }
@@ -180,7 +180,7 @@
 
 void Journal::hideBob(int bobNum) {
 
-	_graphics->bob(bobNum)->active = false;
+	_vm->graphics()->bob(bobNum)->active = false;
 }
 
 
@@ -190,14 +190,14 @@
 	char filename[256];
 	makeSavegameName(filename);
 	bool marks[MAX_SAVE_DESC_NUM];
-	mgr->list_savefiles(filename, _savePath, marks, MAX_SAVE_DESC_NUM);
+	mgr->list_savefiles(filename, _vm->getSavePath(), marks, MAX_SAVE_DESC_NUM);
 
 	memset(_saveDescriptions, 0, sizeof(_saveDescriptions));
 	int i;
 	for (i = 0; i < MAX_SAVE_DESC_NUM; ++i) {
 		if (marks[i]) {
 			makeSavegameName(filename, i);
-			SaveFile *f = mgr->open_savefile(filename, _savePath, false);
+			SaveFile *f = mgr->open_savefile(filename, _vm->getSavePath(), false);
 			if (f) {
 				f->read(_saveDescriptions[i], MAX_SAVE_DESC_LEN);
 				delete f;
@@ -216,8 +216,8 @@
 		char nb[4];
 		sprintf(nb, "%d", n + 1);
 		int y = 9 + i * 13;
-		_graphics->textSet(136, y, _saveDescriptions[n], false);
-		_graphics->textSet(109, y + 1, nb, false);
+		_vm->graphics()->textSet(136, y, _saveDescriptions[n], false);
+		_vm->graphics()->textSet(109, y + 1, nb, false);
 	}
 	// hightlight current page
 	showBob(BOB_SAVE_PAGE, 300, 3 + _currentSavePage * 15, 6 + _currentSavePage);
@@ -264,11 +264,11 @@
 		enterYesNoMode(zoneNum, TXT_GIVE_UP);
 	}
 	if (zoneNum == ZN_TEXT_SPEED) {
-		_logic->talkSpeed((x - 136) * 100 / 130);
+		_vm->logic()->talkSpeed((x - 136) * 100 / 130);
 		drawConfigPanel();
 	}
 	else if (zoneNum == ZN_SFX_TOGGLE) {
-		_sound->toggleSfx();
+		_vm->sound()->toggleSfx();
 		drawConfigPanel();
 	}
 	else if (zoneNum == ZN_MUSIC_VOLUME) {
@@ -289,8 +289,8 @@
 		showInformationBox();
 	}
 	else if (zoneNum == ZN_MUSIC_TOGGLE) {
-		_sound->toggleMusic();
-		if (_sound->musicOn()) {
+		_vm->sound()->toggleMusic();
+		if (_vm->sound()->musicOn()) {
 			// XXX playsong(lastoverride);
 		}
 		else {
@@ -299,11 +299,11 @@
 		drawConfigPanel();
 	}
 	else if (zoneNum == ZN_VOICE_TOGGLE) {
-		_sound->toggleSpeech();
+		_vm->sound()->toggleSpeech();
 		drawConfigPanel();
 	}
 	else if (zoneNum == ZN_TEXT_TOGGLE) {
-		_logic->subtitles(!_logic->subtitles());
+		_vm->logic()->subtitles(!_vm->logic()->subtitles());
 		drawConfigPanel();
 	}
 }
@@ -324,9 +324,9 @@
 		switch (_prevZoneNum) {
 		case ZN_REVIEW_ENTRY:
 			if (_saveDescriptions[currentSlot][0]) {
-				_display->palFadeOut(0, 223, JOURNAL_ROOM);
+				_vm->display()->palFadeOut(0, 223, JOURNAL_ROOM);
 				loadState(currentSlot);
-				_graphics->textClear(0, GAME_SCREEN_HEIGHT - 1);
+				_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
 				// XXX panelflag=1;
 				// XXX walkgameload=1;
 				_quit = true;
@@ -358,7 +358,7 @@
 
 void Journal::handleMouseDown(int x, int y) {
 
-	int16 zone = _logic->zoneIn(ZONE_ROOM, x, y);
+	int16 zone = _vm->logic()->zoneIn(ZONE_ROOM, x, y);
 	if (_mode == M_INFO_BOX) {
 		handleInfoBoxMode(_mode);
 	}
@@ -392,7 +392,7 @@
 
 	int i;
 	for (i = 0; i < _panelTextCount; ++i) {
-		_graphics->textClear(_panelTextY[i], _panelTextY[i]);
+		_vm->graphics()->textClear(_panelTextY[i], _panelTextY[i]);
 	}
 }
 
@@ -403,8 +403,8 @@
 	strcpy(s, text);
 	char *p = strchr(s, ' ');
 	if (p == NULL) {
-		int x = (128 - _graphics->textWidth(s)) / 2;
-		_graphics->textSet(x, y, s, false);
+		int x = (128 - _vm->graphics()->textWidth(s)) / 2;
+		_vm->graphics()->textSet(x, y, s, false);
 		_panelTextY[_panelTextCount++] = y;
 	}
 	else {
@@ -440,7 +440,7 @@
 	int y = 8;
 	while (n--) {
 		showBob(bobNum++, 32, y, *frames++);
-		drawPanelText(y + 12, _logic->joeResponse(*titles++));
+		drawPanelText(y + 12, _vm->logic()->joeResponse(*titles++));
 		y += 48;
 	}
 }
@@ -472,65 +472,65 @@
 
 void Journal::drawConfigPanel() {
 
-	_logic->checkOptionSettings();
+	_vm->logic()->checkOptionSettings();
 
-	drawSlideBar(_logic->talkSpeed(), 130, 100, BOB_TALK_SPEED, 136 - 4, 164, FRAME_BLUE_PIN);
+	drawSlideBar(_vm->logic()->talkSpeed(), 130, 100, BOB_TALK_SPEED, 136 - 4, 164, FRAME_BLUE_PIN);
 	// XXX music_volume
 	drawSlideBar(100, 130, 100, BOB_MUSIC_VOLUME, 136 - 4, 177, FRAME_GREEN_PIN);
 
-	drawCheckBox(_sound->sfxOn(), BOB_SFX_TOGGLE, 221, 155, FRAME_CHECK_BOX);
-	drawCheckBox(_sound->speechOn(), BOB_SPEECH_TOGGLE, 158, 155, FRAME_CHECK_BOX);
-	drawCheckBox(_logic->subtitles(), BOB_TEXT_TOGGLE, 125, 167, FRAME_CHECK_BOX);
-	drawCheckBox(_sound->musicOn(), BOB_MUSIC_TOGGLE, 125, 181, FRAME_CHECK_BOX);
+	drawCheckBox(_vm->sound()->sfxOn(), BOB_SFX_TOGGLE, 221, 155, FRAME_CHECK_BOX);
+	drawCheckBox(_vm->sound()->speechOn(), BOB_SPEECH_TOGGLE, 158, 155, FRAME_CHECK_BOX);
+	drawCheckBox(_vm->logic()->subtitles(), BOB_TEXT_TOGGLE, 125, 167, FRAME_CHECK_BOX);
+	drawCheckBox(_vm->sound()->musicOn(), BOB_MUSIC_TOGGLE, 125, 181, FRAME_CHECK_BOX);
 }
 
 
 void Journal::showInformationBox() {
 
-	_graphics->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
 	showBob(BOB_INFO_BOX, 72, 221, FRAME_INFO_BOX);
 
-	const char *ver = _logic->resource()->JASVersion();
+	const char *ver = _vm->resource()->JASVersion();
 	switch (ver[0]) {
 	case 'P':
-		_graphics->textSetCentered(132, "PC Hard Drive", false);
+		_vm->graphics()->textSetCentered(132, "PC Hard Drive", false);
 		break;
 	case 'C':
-		_graphics->textSetCentered(132, "PC CD-ROM", false);
+		_vm->graphics()->textSetCentered(132, "PC CD-ROM", false);
 		break;
 	case 'a':
-		_graphics->textSetCentered(132, "Amiga A500/600", false);
+		_vm->graphics()->textSetCentered(132, "Amiga A500/600", false);
 		break;
 	case 'A':
-		_graphics->textSetCentered(132, "Amiga A1200", false);
+		_vm->graphics()->textSetCentered(132, "Amiga A1200", false);
 		break;
 	case 'c':
-		_graphics->textSetCentered(132, "Amiga CD-32", false);
+		_vm->graphics()->textSetCentered(132, "Amiga CD-32", false);
 		break;
 	}
 	switch (ver[1]) {
 	case 'E':
-		_graphics->textSetCentered(144, "English", false);
+		_vm->graphics()->textSetCentered(144, "English", false);
 		break;
 	case 'G':
-		_graphics->textSetCentered(144, "Deutsch", false);
+		_vm->graphics()->textSetCentered(144, "Deutsch", false);
 		break;
 	case 'I':
-		_graphics->textSetCentered(144, "Italiano", false);
+		_vm->graphics()->textSetCentered(144, "Italiano", false);
 		break;
 	case 'F' :
-		_graphics->textSetCentered(144, "Fran\x87""ais", false);
+		_vm->graphics()->textSetCentered(144, "Fran\x87""ais", false);
 		break;
 	}
 	char versionId[12];
 	sprintf(versionId, "Version %c.%c%c", ver[2], ver[3], ver[4]);
-	_graphics->textSetCentered(156, versionId, false);
+	_vm->graphics()->textSetCentered(156, versionId, false);
 }
 
 
 void Journal::hideInformationBox() {
 
-	_graphics->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
 	hideBob(BOB_INFO_BOX);
 	redraw();
 }
@@ -539,7 +539,7 @@
 void Journal::initEditBuffer(const char *desc) {
 
 	_edit.enable = true;
-	_edit.posCursor = _graphics->textWidth(desc);
+	_edit.posCursor = _vm->graphics()->textWidth(desc);
 	_edit.textCharsCount = strlen(desc);
 	memset(_edit.text, 0, sizeof(_edit.text));
 	strcpy(_edit.text, desc);
@@ -564,7 +564,7 @@
 	default:
 		if (isprint((char)ascii) && 
 			_edit.textCharsCount < (sizeof(_edit.text) - 1) && 
-			_graphics->textWidth(_edit.text) < 146) {
+			_vm->graphics()->textWidth(_edit.text) < 146) {
 			_edit.text[_edit.textCharsCount] = (char)ascii;
 			++_edit.textCharsCount;
 			dirty = true;
@@ -572,8 +572,8 @@
 		break;
 	}
 	if (dirty) {
-		_graphics->textSet(136, 9 + _currentSaveSlot * 13, _edit.text, false);
-		_edit.posCursor = _graphics->textWidth(_edit.text);
+		_vm->graphics()->textSet(136, 9 + _currentSaveSlot * 13, _edit.text, false);
+		_edit.posCursor = _vm->graphics()->textWidth(_edit.text);
 		update();
 	}
 }
@@ -593,14 +593,14 @@
 void Journal::saveState(int slot, const char *desc) {
 
 	warning("Journal::saveState(%d, %s)", slot, desc);
-	_logic->gameSave(slot, desc);
+	_vm->logic()->gameSave(slot, desc);
 }
 
 
 void Journal::loadState(int slot) {
 
 	warning("Journal::loadState(%d)", slot);
-	_logic->gameLoad(slot);
+	_vm->logic()->gameLoad(slot);
 }
 
 

Index: journal.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/journal.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- journal.h	10 Dec 2003 20:13:25 -0000	1.3
+++ journal.h	11 Dec 2003 22:16:35 -0000	1.4
@@ -26,16 +26,12 @@
 
 namespace Queen {
 
-class Logic;
-class Graphics;
-class Display;
-class Sound;
-struct GameConfig;
+class QueenEngine;
 
 class Journal {
 public:
 
-	Journal(Logic *, Graphics *, Display *, Sound *);
+	Journal(QueenEngine *vm);
 	void use();
   
 	enum {
@@ -180,11 +176,7 @@
 	bool _quit;
 	bool _quitCleanly;
 
-	Logic *_logic;
-	Graphics *_graphics;
-	Display *_display;
-	Sound *_sound;
-	const char *_savePath;
+	QueenEngine *_vm;
 };
 
 

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- logic.cpp	11 Dec 2003 21:04:02 -0000	1.130
+++ logic.cpp	11 Dec 2003 22:16:35 -0000	1.131
@@ -20,8 +20,9 @@
  */
 
 #include "stdafx.h"
-#include "common/config-manager.h"
 #include "queen/logic.h"
+
+#include "common/config-manager.h"
 #include "queen/command.h"
 #include "queen/cutaway.h"
 #include "queen/defs.h"
@@ -30,6 +31,7 @@
[...1438 lines suppressed...]
 		//debug(0, "horizontalScroll = %i", horizontalScroll);
-		_display->horizontalScroll(horizontalScroll);
+		_vm->display()->horizontalScroll(horizontalScroll);
 
 		if (horizontalScroll < 272 && bob21->x < 136)
 			bob21->x += (i/2);
@@ -3231,11 +3226,11 @@
 
 		update();
 
-		if (_input->cutawayQuit())
+		if (_vm->input()->cutawayQuit())
 			return;
 	}
 
-	_input->fastMode(false);
+	_vm->input()->fastMode(false);
 }
 
 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- logic.h	11 Dec 2003 21:04:02 -0000	1.86
+++ logic.h	11 Dec 2003 22:16:35 -0000	1.87
@@ -53,19 +53,13 @@
 	Box box;
 };
 
-class Command;
 class Debug;
-class Display;
-class Input;
-class Graphics;
-class Resource;
-class Sound;
-class Walk;
+class QueenEngine;
 
 class Logic {
 
 public:
-	Logic(Resource *resource, Graphics *graphics, Display *display, Input *input, Sound *sound);
+	Logic(QueenEngine *vm);
 	~Logic();
 
 	uint16 currentRoom() const { return _currentRoom; }
@@ -293,11 +287,6 @@
 	void asmPanRightToJoeAndRita();
 	void asmPanLeftToBomb();
 
-	Walk *walk() const { return _walk; }
-	Display *display() const { return _display; }
-	Command *command() const { return _cmd; }
-	Resource *resource() const { return _resource; }
-
 
 	typedef void (Logic::*SpecialMoveProc)();
 
@@ -310,8 +299,6 @@
 		TALK_SELECTED_COUNT = 86
 	};
 
-	static Common::RandomSource randomizer;
-
 protected:
 
 	void initialise();
@@ -436,14 +423,8 @@
 
 	bool _subtitles;
 
-	Resource *_resource;
-	Graphics *_graphics;
 	Debug *_dbg;
-	Display *_display;
-	Input *_input;
-	Sound *_sound;
-	Walk *_walk;
-	Command *_cmd;
+	QueenEngine *_vm;
 
 	//! Verbs (in order) available in panel
 	static const VerbEnum PANEL_VERBS[];

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- queen.cpp	10 Dec 2003 20:13:25 -0000	1.51
+++ queen.cpp	11 Dec 2003 22:16:35 -0000	1.52
@@ -112,10 +112,13 @@
 
 	_timer->removeTimerProc(&timerHandler);
 	delete _resource;
+	delete _command;
 	delete _display;
-	delete _logic;
 	delete _graphics;
 	delete _input;
+	delete _logic;
+	delete _sound;
+	delete _walk;	
 }
 
 void QueenEngine::errorString(const char *buf1, char *buf2) {
@@ -149,11 +152,11 @@
 		else {
 			if (_logic->joeWalk() == JWM_EXECUTE) {
 				_logic->joeWalk(JWM_NORMAL);
-				_logic->command()->executeCurrentAction(true);
+				_command->executeCurrentAction(true);
 			}
 			else {
-				if (_logic->command()->parse()) {
-					_logic->command()->clear(true);
+				if (_command->parse()) {
+					_command->clear(true);
 				}
 				_logic->joeWalk(JWM_NORMAL);
 				_logic->checkPlayer();
@@ -165,11 +168,13 @@
 void QueenEngine::initialise(void) {
 
 	_resource = new Resource(_gameDataPath, _detectname,  _system->get_savefile_manager(), getSavePath());
+	_command = new Command(this);
+	_display = new Display(this, _resource->getLanguage(), _system);
+	_graphics = new Graphics(this);
 	_input = new Input(_resource->getLanguage(), _system);
-	_display = new Display(_resource->getLanguage(), _system, _input);
-	_graphics = new Graphics(_display, _input, _resource);
-	_sound = Sound::giveSound(_mixer, _input, _resource, _resource->compression());
-	_logic = new Logic(_resource, _graphics, _display, _input, _sound);
+	_logic = new Logic(this);
+	_sound = Sound::giveSound(_mixer, this, _resource->compression());
+	_walk = new Walk(this);
 	_timer->installTimerProc(&timerHandler, 1000000 / 50, this); //call 50 times per second
 }
 

Index: queen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- queen.h	10 Dec 2003 15:36:44 -0000	1.17
+++ queen.h	11 Dec 2003 22:16:35 -0000	1.18
@@ -28,12 +28,14 @@
 
 namespace Queen {
 
+class Command;
+class Display;
 class Graphics;
 class Input;
-class Resource;
 class Logic;
-class Display;
+class Resource;
 class Sound;
+class Walk;
 
 class QueenEngine : public Engine {
 public:
@@ -41,6 +43,17 @@
 	QueenEngine(GameDetector *detector, OSystem *syst);
 	virtual ~QueenEngine();
 
+	Command *command() const { return _command; }
+	Display *display() const { return _display; }
+	Graphics *graphics() const { return _graphics; }
+	Input *input() const { return _input; }
+	Logic *logic() const { return _logic; }
+	Resource *resource() const { return _resource; }
+	Sound *sound() const { return _sound; }
+	Walk *walk() const { return _walk; }
+
+	Common::RandomSource randomizer;
+
 protected:
 
 	void errorString(const char *buf_input, char *buf_output);
@@ -52,12 +65,14 @@
 	static void timerHandler(void *ptr);
 	void gotTimerTick();
 
+	Command *_command;
+	Display *_display;
 	Graphics *_graphics;
 	Input *_input;
-	Resource *_resource;
 	Logic *_logic;
-	Display *_display;
+	Resource *_resource;
 	Sound *_sound;
+	Walk *_walk;
 	
 	const char *_detectname; // necessary for music
 };

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- sound.cpp	1 Dec 2003 20:48:40 -0000	1.15
+++ sound.cpp	11 Dec 2003 22:16:35 -0000	1.16
@@ -21,7 +21,9 @@
 
 #include "stdafx.h"
 #include "queen/sound.h"
+
 #include "queen/input.h"
+#include "queen/queen.h"
 #include "queen/resource.h"
 
 #define	SB_HEADER_SIZE	110
@@ -92,44 +94,44 @@
 };
 #endif
 
-Sound::Sound(SoundMixer *mixer, Input *input, Resource  *resource) : 
-	_mixer(mixer), _input(input), _resource(resource), _sfxToggle(true), _speechToggle(true), _musicToggle(true), _lastOverride(0), _currentSong(0), _sfxHandle(0) {
+Sound::Sound(SoundMixer *mixer, QueenEngine *vm) : 
+	_mixer(mixer), _vm(vm), _sfxToggle(true), _speechToggle(true), _musicToggle(true), _lastOverride(0), _currentSong(0), _sfxHandle(0) {
 }
 
 Sound::~Sound() {
 }
 
-Sound *Sound::giveSound(SoundMixer *mixer, Input *input, Resource *resource, uint8 compression) {
+Sound *Sound::giveSound(SoundMixer *mixer, QueenEngine *vm, uint8 compression) {
 	switch(compression) {
 		case COMPRESSION_NONE:
-				return new SBSound(mixer, input, resource);
+				return new SBSound(mixer, vm);
 				break;
 		case COMPRESSION_MP3:
 				#ifndef USE_MAD
 					warning("Using MP3 compressed datafile, but MP3 support not compiled in");
-					return new SilentSound(mixer, input, resource);
+					return new SilentSound(mixer, vm);
 				#else
-					return new MP3Sound(mixer, input, resource);
+					return new MP3Sound(mixer, vm);
 
 				#endif
 				break;
 		case COMPRESSION_OGG:
 				#ifndef USE_VORBIS
 					warning("Using OGG compressed datafile, but OGG support not compiled in");
-					return new SilentSound(mixer, input, resource);
+					return new SilentSound(mixer, vm);
 				#else
-					return new OGGSound(mixer, input, resource);
+					return new OGGSound(mixer, vm);
 				#endif
 				break;
 		default:
 				warning("Unknown compression type");
-				return new SilentSound(mixer, input, resource);
+				return new SilentSound(mixer, vm);
 	}
 }
 
 void Sound::waitSfxFinished() {
 	while(_sfxHandle != 0)
-		_input->delay(10);
+		_vm->input()->delay(10);
 }
 
 void Sound::playSong(int16 songNum) {
@@ -157,8 +159,8 @@
 
 	waitSfxFinished();
 	
-	if (_resource->exists(name)) 
-		playSound(_resource->loadFileMalloc(name, SB_HEADER_SIZE), _resource->fileSize(name) - SB_HEADER_SIZE);
+	if (_vm->resource()->exists(name)) 
+		playSound(_vm->resource()->loadFileMalloc(name, SB_HEADER_SIZE), _vm->resource()->fileSize(name) - SB_HEADER_SIZE);
 }
 
 #ifdef USE_MAD
@@ -174,8 +176,8 @@
 	
 	waitSfxFinished();
 
-	if (_resource->exists(name)) 
-		_mixer->playMP3(&_sfxHandle, _resource->giveCompressedSound(name), _resource->fileSize(name));
+	if (_vm->resource()->exists(name)) 
+		_mixer->playMP3(&_sfxHandle, _vm->resource()->giveCompressedSound(name), _vm->resource()->fileSize(name));
 }
 #endif
 
@@ -192,13 +194,13 @@
 
 	waitSfxFinished();
 	
-	if (_resource->exists(name)) {
+	if (_vm->resource()->exists(name)) {
 		OggVorbis_File *oggFile = new OggVorbis_File;
 		file_info *f = new file_info;
 
-		f->file = _resource->giveCompressedSound(name);
-		f->start = _resource->fileOffset(name);
-		f->len = _resource->fileSize(name);
+		f->file = _vm->resource()->giveCompressedSound(name);
+		f->start = _vm->resource()->fileOffset(name);
+		f->len = _vm->resource()->fileSize(name);
 		f->curr_pos = 0;
 
 		if (ov_open_callbacks((void *)f, oggFile, NULL, 0, g_File_wrap) < 0) {

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sound.h	1 Dec 2003 20:48:40 -0000	1.7
+++ sound.h	11 Dec 2003 22:16:35 -0000	1.8
@@ -47,12 +47,14 @@
 	int16 delay;
 };
 
+class QueenEngine;
+
 class Sound {
 public:
-	Sound(SoundMixer *mixer, Input *input, Resource *resource);
+	Sound(SoundMixer *mixer, QueenEngine *vm);
 	virtual ~Sound(); 
 	virtual void sfxPlay(const char *base) = 0;
-	static Sound *giveSound(SoundMixer *mixer, Input *input, Resource *resource, uint8 compression);
+	static Sound *giveSound(SoundMixer *mixer, QueenEngine *vm, uint8 compression);
 	void waitSfxFinished();
 	void playSong(int16 songNum);
 
@@ -70,8 +72,7 @@
 
 protected:
 	SoundMixer *_mixer;
-	Input *_input;
-	Resource *_resource;
+	QueenEngine *_vm;
 
 	static const songData _song[];
 	static const tuneData _tune[];
@@ -92,13 +93,13 @@
 
 class SilentSound : public Sound {
 public:
-	SilentSound(SoundMixer *mixer, Input *input, Resource *resource) : Sound(mixer, input, resource) {};
+	SilentSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {};
 	void sfxPlay(const char *base) { }
 };
 
 class SBSound : public Sound {
 public:
-	SBSound(SoundMixer *mixer, Input *input, Resource *resource) : Sound(mixer, input, resource) {};
+	SBSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {};
 	void sfxPlay(const char *base);
 protected:
 	int playSound(byte *sound, uint32 size);
@@ -107,7 +108,7 @@
 #ifdef USE_MAD
 class MP3Sound : public Sound {
 public:
-	MP3Sound(SoundMixer *mixer, Input *input, Resource *resource) : Sound(mixer, input, resource) {};
+	MP3Sound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {};
 	void sfxPlay(const char *base);
 };
 #endif
@@ -115,7 +116,7 @@
 #ifdef USE_VORBIS
 class OGGSound : public Sound {
 public:
-	OGGSound(SoundMixer *mixer, Input *input, Resource *resource) : Sound(mixer, input, resource) {};
+	OGGSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {};
 	void sfxPlay(const char *base);
 };
 #endif

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- talk.cpp	11 Dec 2003 13:26:13 -0000	1.58
+++ talk.cpp	11 Dec 2003 22:16:35 -0000	1.59
@@ -21,10 +21,12 @@
 
 #include "stdafx.h"
 #include "queen/talk.h"
+
 #include "queen/display.h"
 #include "queen/graphics.h"
 #include "queen/input.h"
 #include "queen/logic.h"
+#include "queen/queen.h"
 #include "queen/resource.h"
 #include "queen/sound.h"
 #include "queen/state.h"
@@ -42,12 +44,8 @@
 		const char *filename, 
 		int personInRoom,
 		char *cutawayFilename,
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound) {
-	Talk *talk = new Talk(graphics, input, logic, resource, sound);
+		QueenEngine *vm) {
+	Talk *talk = new Talk(vm);
 	talk->talk(filename, personInRoom, cutawayFilename);
 	delete talk;
 }
@@ -56,12 +54,8 @@
 		const char *sentence, 
 		Person *person,
 		const char *voiceFilePrefix,
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound) {
-	Talk *talk = new Talk(graphics, input, logic, resource, sound);
+		QueenEngine *vm) {
+	Talk *talk = new Talk(vm);
 	bool result;
 	if (sentence)
 		result = talk->speak(sentence, person, voiceFilePrefix);
@@ -71,16 +65,9 @@
 	return result;
 }
 
-Talk::Talk(
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound) : 
-	_graphics(graphics), _input(input), _logic(logic), _resource(resource), 
-	_sound(sound), _fileData(NULL) {
-
-	_input->talkQuitReset();
+Talk::Talk(QueenEngine *vm)
+	: _vm(vm), _fileData(NULL) {
+	_vm->input()->talkQuitReset();
 }
 
 Talk::~Talk() {
@@ -98,8 +85,8 @@
 
 	// XXX S=SUBJECT[1];
 
-	int roomStart = _logic->roomData(_logic->currentRoom());
-	ObjectData *data = _logic->objectData(roomStart + personInRoom);
+	int roomStart = _vm->logic()->currentRoomData();
+	ObjectData *data = _vm->logic()->objectData(roomStart + personInRoom);
 
 	if (data->name <= 0)	// disabled!
 		return;
@@ -109,7 +96,7 @@
 
 	if (State::findTalk(data->state) == STATE_TALK_MUTE) {
 		// 'I can't talk to that'
-		_logic->joeSpeak(24 + Logic::randomizer.getRandomNumber(2));
+		_vm->logic()->joeSpeak(24 + _vm->randomizer.getRandomNumber(2));
 		return;
 	}
 
@@ -117,7 +104,7 @@
 
 	Person person;
 	memset(&person, 0, sizeof(Person));
-	_logic->personSetData(personInRoom, "", false, &person);
+	_vm->logic()->personSetData(personInRoom, "", false, &person);
 
 	if (NULL == person.name) {
 		error("Invalid person object");
@@ -147,7 +134,7 @@
 	initialTalk();
 
 	// Lines 906-? in talk.c
-	_logic->display()->showMouseCursor(true);
+	_vm->display()->showMouseCursor(true);
 	
 	int16 level=1, retval=0;
 	int16 head = _dialogueTree[level][0].head;
@@ -182,7 +169,7 @@
 
 			int16 index = _dialogueTree[level][i].gameStateIndex;
 
-			if (index < 0 && _logic->gameState(ABS(index)) != _dialogueTree[level][i].gameStateValue)
+			if (index < 0 && _vm->logic()->gameState(ABS(index)) != _dialogueTree[level][i].gameStateValue)
 				_talkString[i][0] = '\0';
 
 			sprintf(_joeVoiceFilePrefix[i], "%2d%4xJ", _talkKey, _dialogueTree[level][i].head);
@@ -209,7 +196,7 @@
 			if (speak(_talkString[0], &person, otherVoiceFilePrefix))
 				personWalking = true;
 
-			if (_input->talkQuit())
+			if (_vm->input()->talkQuit())
 				break;
 
 			speak(_talkString[selectedSentence], NULL, _joeVoiceFilePrefix[selectedSentence]);
@@ -225,7 +212,7 @@
 			}
 		}
 
-		if (_input->talkQuit())
+		if (_vm->input()->talkQuit())
 			break;
 
 		retval   = _dialogueTree[level][selectedSentence].dialogueNodeValue1;
@@ -274,14 +261,14 @@
 		int16 index = _dialogueTree[level][0].gameStateIndex;
 
 		if (index > 0)
-			_logic->gameState(index, _dialogueTree[level][0].gameStateValue);
+			_vm->logic()->gameState(index, _dialogueTree[level][0].gameStateValue);
 
 		// if the selected dialogue line has a POSITIVE game state value
 		// then set gamestate to Value = TALK(OLDLEVEL,S,3)
 		
 		index = _dialogueTree[oldLevel][selectedSentence].gameStateIndex;
 		if (index > 0)
-			_logic->gameState(index, _dialogueTree[oldLevel][selectedSentence].gameStateValue);
+			_vm->logic()->gameState(index, _dialogueTree[oldLevel][selectedSentence].gameStateValue);
 
 
 		// if(RETVAL = -1, then before we exit, check to see if(person
@@ -303,55 +290,55 @@
 
 	for (i = 0; i < 2; i++) {
 		if (_gameState[i] > 0) {
-			if (_logic->gameState(_gameState[i]) == _testValue[i]) {
+			if (_vm->logic()->gameState(_gameState[i]) == _testValue[i]) {
 				if (_itemNumber[i] > 0)
-					_logic->inventoryInsertItem(_itemNumber[i]);
+					_vm->logic()->inventoryInsertItem(_itemNumber[i]);
 				else
-					_logic->inventoryDeleteItem(ABS(_itemNumber[i]));
+					_vm->logic()->inventoryDeleteItem(ABS(_itemNumber[i]));
 			}
 		}
 	}
 	
-	_logic->zoneSetupPanel();
+	_vm->logic()->zoneSetupPanel();
 
 	uint8 *ptr = _cutawayPtr;
 
 	int16 cutawayGameState = (int16)READ_BE_UINT16(ptr); ptr += 2;
 	int16 cutawayTestValue = (int16)READ_BE_UINT16(ptr); ptr += 2;
 
-	if (_logic->gameState(cutawayGameState) == cutawayTestValue) {
+	if (_vm->logic()->gameState(cutawayGameState) == cutawayTestValue) {
 		getString(ptr, cutawayFilename, 20);
 
 		//CR 2 - 7/3/95, If we're executing a cutaway scene, then make sure
 		// Joe can talk, so set TALKQUIT to 0 just in case we exit on the
 		// line that set's the cutaway game states.
-		_input->talkQuitReset();
+		_vm->input()->talkQuitReset();
 	}
 
-	if (_input->talkQuit()) {
+	if (_vm->input()->talkQuit()) {
 		if (_oldSelectedSentenceIndex > 0)
 			selectedValue(_oldSelectedSentenceIndex, _oldSelectedSentenceValue);
-		_input->talkQuitReset();
-		_graphics->textClear(0, 198);
+		_vm->input()->talkQuitReset();
+		_vm->graphics()->textClear(0, 198);
 		speak(_talkString[15], NULL, "JOE0015");
 	}
 	else {
 		setHasTalkedTo();
 	}
 
-	_logic->joeFace();
+	_vm->logic()->joeFace();
 
 	if (cutawayFilename[0] == '\0') {
-		BobSlot *pbs = _graphics->bob(person.actor->bobNum);
+		BobSlot *pbs = _vm->graphics()->bob(person.actor->bobNum);
 
 		pbs->x = person.actor->x;
 		pbs->y = person.actor->y;
 		
 		// Better kick start the persons anim sequence
-		_logic->animReset(person.actor->bobNum);
+		_vm->logic()->animReset(person.actor->bobNum);
 	}
 
-	_logic->joeWalk(JWM_NORMAL);
+	_vm->logic()->joeWalk(JWM_NORMAL);
 }
 		
 void Talk::disableSentence(int oldLevel, int selectedSentence) {
@@ -394,7 +381,7 @@
 void Talk::load(const char *filename) {
 	int i;
 	
-	byte *ptr = _fileData = _resource->loadFile(filename, 20);
+	byte *ptr = _fileData = _vm->resource()->loadFile(filename, 20);
 	if (!_fileData) {
 		error("Failed to load resource data file '%s'", filename);
 	}
@@ -540,10 +527,10 @@
 		case 'G':
 			switch (sentence[index + 1]) {
 				case 'D':
-					_logic->joeGrab(STATE_GRAB_DOWN);
+					_vm->logic()->joeGrab(STATE_GRAB_DOWN);
 					break;
 				case 'M':
-					_logic->joeGrab(STATE_GRAB_MID);
+					_vm->logic()->joeGrab(STATE_GRAB_MID);
 					break; 
 				default:
 					warning("Unknown command string: '%2s'", sentence + index);
@@ -599,7 +586,7 @@
 	Person joe_person;
 	ActorData joe_actor;
 
-	_logic->joeWalk(JWM_SPEAK);
+	_vm->logic()->joeWalk(JWM_SPEAK);
 
 	if (!person) {
 		// Fill in values for use by speakSegment() etc.
@@ -627,9 +614,9 @@
 		0 == strcmp(person->name, "FRANK-H") ||
 		0 == strcmp(person->name, "AZURA-H") ||
 		0 == strcmp(person->name, "X3_RITA") || 
-		(0 == strcmp(person->name, "JOE") && _logic->currentRoom() == FAYE_HEAD ) ||
-		(0 == strcmp(person->name, "JOE") && _logic->currentRoom() == AZURA_HEAD) ||
-		(0 == strcmp(person->name, "JOE") && _logic->currentRoom() == FRANK_HEAD))
+		(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FAYE_HEAD ) ||
+		(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == AZURA_HEAD) ||
+		(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FRANK_HEAD))
 		_talkHead = true;
 	else
 		_talkHead = false;
@@ -660,7 +647,7 @@
 		else
 			i++;
 
-		if (_input->cutawayQuit() || _input->talkQuit())
+		if (_vm->input()->cutawayQuit() || _vm->input()->talkQuit())
 			goto exit;
 	}
 
@@ -688,17 +675,17 @@
 	if (tmp < 10)
 		tmp = 10;
 
-	return (tmp * 2) / (_logic->talkSpeed() / 3);
+	return (tmp * 2) / (_vm->logic()->talkSpeed() / 3);
 }
 
 void Talk::headStringAnimation(const SpeechParameters *parameters, int bobNum, int bankNum) {
 	// talk.c lines 1612-1635
-	BobSlot *bob2 = _graphics->bob(2);
+	BobSlot *bob2 = _vm->graphics()->bob(2);
 	
 	if (parameters->animation[0] == 'E') {
 		int offset = 1;
 	
-		BobSlot *bob  = _graphics->bob(bobNum);
+		BobSlot *bob  = _vm->graphics()->bob(bobNum);
 
 		int16 x = bob->x;
 		int16 y = bob->y;
@@ -712,15 +699,15 @@
 
 			offset += 4;
 
-			_graphics->bankUnpack(frame, _logic->numFrames(), bankNum);
+			_vm->graphics()->bankUnpack(frame, _vm->logic()->numFrames(), bankNum);
 
-			bob2->frameNum = _logic->numFrames();
+			bob2->frameNum = _vm->logic()->numFrames();
 			bob2->scale = 100;
 			bob2->active = true;
 			bob2->x = x;
 			bob2->y = y;
 
-			_logic->update();
+			_vm->logic()->update();
 		}
 	}
 	else
@@ -736,7 +723,7 @@
 	if (parameters->animation[0] == 'T') {
 		// Torso animation
 		torso = true;
-		_graphics->bankOverpack(parameters->body, startFrame, bankNum);
+		_vm->graphics()->bankOverpack(parameters->body, startFrame, bankNum);
 		offset++;
 	}
 	else if (parameters->animation[0] == 'E') {
@@ -768,14 +755,14 @@
 		}
 
 		if (torso) {
-			_graphics->bankOverpack(frame, startFrame, bankNum);
+			_vm->graphics()->bankOverpack(frame, startFrame, bankNum);
 		}
 		else {
-			_graphics->bankUnpack(frame, startFrame, bankNum);
+			_vm->graphics()->bankUnpack(frame, startFrame, bankNum);
 			// XXX bobs[BNUM].scale=SF;
 		}
 
-		_logic->update();
+		_vm->logic()->update();
 	}
 
 	// XXX #ifdef __DOS__
@@ -841,7 +828,7 @@
 
 				int head;
 				if (parameters->rf > 0)
-					head = bf + Logic::randomizer.getRandomNumber(parameters->rf);
+					head = bf + _vm->randomizer.getRandomNumber(parameters->rf);
 				else
 					head = bf;
 
@@ -849,43 +836,43 @@
 					// Make the head move
 					qzx ^= 1;
 					if (parameters->af && qzx)
-						_graphics->bankOverpack(parameters->af + head, startFrame, bankNum);
+						_vm->graphics()->bankOverpack(parameters->af + head, startFrame, bankNum);
 					else {
-						_graphics->bankOverpack(head, startFrame, bankNum);
+						_vm->graphics()->bankOverpack(head, startFrame, bankNum);
 					}
 				}
 				else {
 					debug(0, "[Talk::defaultAnimation] Body action!");
 					// Just do a body action
-					_graphics->bankOverpack(parameters->body, startFrame, bankNum);
+					_vm->graphics()->bankOverpack(parameters->body, startFrame, bankNum);
 				}
 
 				if (!_talkHead)
-					_logic->update();
+					_vm->logic()->update();
 			}
 			else { // (_talkHead && isJoe)
-				_logic->update();
+				_vm->logic()->update();
 			}
 
-			if (_logic->joeWalk() == JWM_SPEAK) {
-				if (_input->talkQuit())
+			if (_vm->logic()->joeWalk() == JWM_SPEAK) {
+				if (_vm->input()->talkQuit())
 					break;
 
-				_logic->update();
+				_vm->logic()->update();
 			}
 			else {
-				if (_input->talkQuit())
+				if (_vm->input()->talkQuit())
 					break;
 
-				_logic->checkPlayer();
-				if (_logic->joeWalk() == JWM_EXECUTE)
+				_vm->logic()->checkPlayer();
+				if (_vm->logic()->joeWalk() == JWM_EXECUTE)
 					// Selected a command, so exit
 					break;
 			}
 
 			// Skip through text more quickly
-			if (_input->keyVerb().isSkipText()) {
-				_input->clearKeyVerb();
+			if (_vm->input()->keyVerb().isSkipText()) {
+				_vm->input()->clearKeyVerb();
 				break;
 			}
 		}
@@ -893,7 +880,7 @@
 
 	// Make sure that Person closes their mouths
 	if (!isJoe && parameters->ff > 0)
-		_graphics->bankOverpack(parameters->ff, startFrame, bankNum);
+		_vm->graphics()->bankOverpack(parameters->ff, startFrame, bankNum);
 }
 
 
@@ -918,7 +905,7 @@
 	// debug(0, "Sentence segment '%*s' is said by person '%s' and voice file '%s' is played",
 	//		length, segment, person->name, voiceFileName);
 
-	_sound->sfxPlay(voiceFileName);
+	_vm->sound()->sfxPlay(voiceFileName);
 	//debug(0, "Playing voice file '%s'", voiceFileName);
 
 	int faceDirectionCommand = 0;
@@ -926,9 +913,9 @@
 	switch (command) {
 		case SPEAK_PAUSE:
 			for (i = 0; i < 10; i++) {
-				if (_input->talkQuit())
+				if (_vm->input()->talkQuit())
 					break;
-				_logic->update();
+				_vm->logic()->update();
 			}
 			return;
 
@@ -947,7 +934,7 @@
 	uint16 color   = person->actor->color;
 	uint16 bankNum = person->actor->bankNum;
 
-	BobSlot *bob = _graphics->bob(bobNum);
+	BobSlot *bob = _vm->graphics()->bob(bobNum);
 
 	bool oracle = false;
 	int textX = 0;
@@ -959,9 +946,9 @@
 			// Dont turn AMAL animation off, and dont manually anim person
 			command = SPEAK_ORACLE;
 			oracle = true;
-			uint16 frameNum = _logic->personFrames(bobNum);
+			uint16 frameNum = _vm->logic()->personFrames(bobNum);
 			for (i = 5; i <= 8; ++i) {
-				_graphics->bankUnpack(i, frameNum, bankNum);
+				_vm->graphics()->bankUnpack(i, frameNum, bankNum);
 				++frameNum;
 			}
 		}
@@ -980,13 +967,13 @@
 		textY = bob->y;
 	}
 
-	//int SF = _logic->findScale(textX, textY);
+	//int SF = _vm->logic()->findScale(textX, textY);
 
 	const SpeechParameters *parameters = NULL;
 	int startFrame = 0;
 
 	if (_talkHead && isJoe) {
-		_graphics->bobSetText(bob, segment, textX, textY, color, true);
+		_vm->graphics()->bobSetText(bob, segment, textX, textY, color, true);
 		defaultAnimation(segment, isJoe, parameters, startFrame, bankNum);
 	}
 	else {
@@ -994,10 +981,10 @@
 			return;
 
 		if (isJoe) {
-			if (_logic->currentRoom() == 108)
+			if (_vm->logic()->currentRoom() == 108)
 				parameters = findSpeechParameters("JOE-E", command, 0);
 			else
-				parameters = findSpeechParameters("JOE", command, _logic->joeFacing());
+				parameters = findSpeechParameters("JOE", command, _vm->logic()->joeFacing());
 		}
 		else
 			parameters = findSpeechParameters(person->name, command, 0);
@@ -1005,10 +992,10 @@
 		startFrame = 29 + bobNum + FRAMES_JOE_XTRA;
 		int faceDirection = 0;
 
-		if (isJoe && _logic->joeFacing() == DIR_LEFT)
+		if (isJoe && _vm->logic()->joeFacing() == DIR_LEFT)
 			faceDirection = DIR_LEFT;
 		else if (!isJoe) {
-			ObjectData *data = _logic->objectData(_logic->objectForPerson(bobNum));
+			ObjectData *data = _vm->logic()->objectData(_vm->logic()->objectForPerson(bobNum));
 
 			if (data->image == -3)
 				faceDirection = DIR_LEFT;
@@ -1027,7 +1014,7 @@
 				case SPEAK_FACE_BACK:  faceDirection = DIR_BACK;  break;
 			}
 			if (isJoe)
-				_logic->joeFacing(faceDirection);
+				_vm->logic()->joeFacing(faceDirection);
 		}
 
 		if (!isJoe) {
@@ -1041,17 +1028,17 @@
 			headStringAnimation(parameters, bobNum, bankNum);
 		}
 
-		_graphics->bobSetText(bob, segment, textX, textY, color, _talkHead);
+		_vm->graphics()->bobSetText(bob, segment, textX, textY, color, _talkHead);
 
 		if (parameters->animation[0] != '\0' && parameters->animation[0] != 'E') {
 			stringAnimation(parameters, startFrame, bankNum);
 		}
 		else {
-			_graphics->bankUnpack(parameters->body, startFrame, bankNum);
+			_vm->graphics()->bankUnpack(parameters->body, startFrame, bankNum);
 
 			if (length == 0 && !isJoe && parameters->bf > 0) {
-				_graphics->bankOverpack(parameters->bf, startFrame, bankNum);
-				_logic->update();
+				_vm->graphics()->bankOverpack(parameters->bf, startFrame, bankNum);
+				_vm->logic()->update();
 			}
 
 			/* A12 = the frame pointer for the full body frame, well use this  */
@@ -1062,18 +1049,18 @@
 
 			if (-1 == parameters->rf) {
 				// Setup the Torso frames
-				_graphics->bankOverpack(parameters->bf, startFrame, bankNum);
+				_vm->graphics()->bankOverpack(parameters->bf, startFrame, bankNum);
 				if (isJoe)
-					parameters = findSpeechParameters(person->name, 0, _logic->joeFacing());
+					parameters = findSpeechParameters(person->name, 0, _vm->logic()->joeFacing());
 				else
 					parameters = findSpeechParameters(person->name, 0, 0);
 			}
 
 			if (-2 == parameters->rf) {
 				// Setup the Torso frames
-				_graphics->bankOverpack(parameters->bf, startFrame, bankNum);
+				_vm->graphics()->bankOverpack(parameters->bf, startFrame, bankNum);
 				if (isJoe)
-					parameters = findSpeechParameters(person->name, 14, _logic->joeFacing());
+					parameters = findSpeechParameters(person->name, 14, _vm->logic()->joeFacing());
 				else
 					parameters = findSpeechParameters(person->name, 14, 0);
 			}
@@ -1083,12 +1070,12 @@
 	}
 
 	// Moved here so that Text is cleared when a Torso command done!
-	_graphics->textClear(0,198);
+	_vm->graphics()->textClear(0,198);
 
 	if (oracle) {
-		uint16 frameNum = _logic->personFrames(bobNum);
+		uint16 frameNum = _vm->logic()->personFrames(bobNum);
 		for (i = 1; i <= 4; ++i) {
-			_graphics->bankUnpack(i, frameNum, bankNum);
+			_vm->graphics()->bankUnpack(i, frameNum, bankNum);
 			++frameNum;
 		}
 	}
@@ -1096,35 +1083,35 @@
 	// Ensure that the correct buffer frame is selected
 
 	if (isJoe && !_talkHead) {
-		if (_logic->joeFacing() == DIR_FRONT ||
-				_logic->joeFacing() == DIR_BACK) {
+		if (_vm->logic()->joeFacing() == DIR_FRONT ||
+				_vm->logic()->joeFacing() == DIR_BACK) {
 			// Joe is facing either Front or Back!
 			//  - Don't FACE_JOE in room 69, because Joe is probably
 			//       holding the Dino Ray gun.
-			if (_logic->currentRoom() != 69) 
-				_logic->joeFace();
+			if (_vm->logic()->currentRoom() != 69) 
+				_vm->logic()->joeFace();
 		}
 		else {
 			if (command == SPEAK_DEFAULT ||
 					command == 6 ||
 					command == 7) {
-				_logic->joeFace();
+				_vm->logic()->joeFace();
 			}
 			else if (command != 5) {
 				// 7/11/94, Ensure that correct mouth closed frame is used!
 				if (parameters->rf != -1)
 					// XXX should really be just "bf", but it is not always calculated... :-(
-					_graphics->bankOverpack(parameters->bf, startFrame, bankNum);
+					_vm->graphics()->bankOverpack(parameters->bf, startFrame, bankNum);
 				
 				if (parameters->ff == 0)
-					_graphics->bankOverpack(10, startFrame, bankNum);
+					_vm->graphics()->bankOverpack(10, startFrame, bankNum);
 				else
-					_graphics->bankOverpack(parameters->ff, startFrame, bankNum);
+					_vm->graphics()->bankOverpack(parameters->ff, startFrame, bankNum);
 			}
 		}
 	}
 
-	_logic->update();
+	_vm->logic()->update();
 }
 
 const Talk::SpeechParameters *Talk::findSpeechParameters(
@@ -1171,7 +1158,7 @@
 }
 
 TalkSelected *Talk::talkSelected() {
-	return _logic->talkSelected(_uniqueKey);
+	return _vm->logic()->talkSelected(_uniqueKey);
 }
 
 int Talk::splitOption(const char *str, char optionText[5][MAX_STRING_SIZE]) {
@@ -1180,7 +1167,7 @@
 
 	// Check to see if option fits on one line, and exit early
 
-	/* XXX if (_logic->language() == ENGLISH || textWidth(str) <= MAX_TEXT_WIDTH)*/ {
+	/* XXX if (_vm->logic()->language() == ENGLISH || textWidth(str) <= MAX_TEXT_WIDTH)*/ {
 		strcpy(optionText[0], str);
 		return 1;
 	}
@@ -1217,12 +1204,12 @@
 
 	// Change NORMAL_INK -> TALK_NORMAL_INK
 
-	_graphics->textCurrentColor(INK_TALK_NORMAL);
+	_vm->graphics()->textCurrentColor(INK_TALK_NORMAL);
 
 	// These bobs are up and down arrows
 
-	BobSlot *arrowBobUp 	= _graphics->bob(ARROW_BOB_UP);
-	BobSlot *arrowBobDown = _graphics->bob(ARROW_BOB_DOWN);
+	BobSlot *arrowBobUp 	= _vm->graphics()->bob(ARROW_BOB_UP);
+	BobSlot *arrowBobDown = _vm->graphics()->bob(ARROW_BOB_DOWN);
 
 	arrowBobUp->x         = 303 + 8 + scrollX;
 	arrowBobUp->y         = 150 + 1;
@@ -1243,14 +1230,14 @@
 
 		// Set zones for UP/DOWN text arrows when not English version
 
-		_logic->zoneClearAll(ZONE_PANEL);
+		_vm->logic()->zoneClearAll(ZONE_PANEL);
 
-		if (_logic->resource()->getLanguage() != ENGLISH) {
-			_logic->zoneSet(ZONE_PANEL, ARROW_ZONE_UP,   MAX_TEXT_WIDTH + 1, 0,  319, 24);
-			_logic->zoneSet(ZONE_PANEL, ARROW_ZONE_DOWN, MAX_TEXT_WIDTH + 1, 25, 319, 49);
+		if (_vm->resource()->getLanguage() != ENGLISH) {
+			_vm->logic()->zoneSet(ZONE_PANEL, ARROW_ZONE_UP,   MAX_TEXT_WIDTH + 1, 0,  319, 24);
+			_vm->logic()->zoneSet(ZONE_PANEL, ARROW_ZONE_DOWN, MAX_TEXT_WIDTH + 1, 25, 319, 49);
 		}
 
-		_graphics->textClear(151,199);
+		_vm->graphics()->textClear(151,199);
 
 		int sentenceCount = 0;
 		int yOffset = 1;
@@ -1266,12 +1253,12 @@
 				optionLines = splitOption(removeStar(temp), optionText);
 
 				if (yOffset < 5) {
-					_logic->zoneSet(
+					_vm->logic()->zoneSet(
 							ZONE_PANEL,
 							i,
 							0,
 							yOffset * LINE_HEIGHT - PUSHUP,
-							(_logic->resource()->getLanguage() == ENGLISH) ? 319 : MAX_TEXT_WIDTH,
+							(_vm->resource()->getLanguage() == ENGLISH) ? 319 : MAX_TEXT_WIDTH,
 							(yOffset + optionLines) * LINE_HEIGHT - PUSHUP);
 				}
 
@@ -1279,7 +1266,7 @@
 				for (j = 0; j < optionLines; j++) {
 					if (yOffset < 5) {
 						//debug(0, "Draw text '%s'", optionText[j]);
-						_graphics->textSet(
+						_vm->graphics()->textSet(
 								(j == 0) ? 0 : 24, 
 								150 - PUSHUP + yOffset * LINE_HEIGHT, 
 								optionText[j]);
@@ -1295,12 +1282,12 @@
 
 		// Up and down dialogue arrows
 
-		if (_logic->resource()->getLanguage() != ENGLISH) {
+		if (_vm->resource()->getLanguage() != ENGLISH) {
 			arrowBobUp->active    = (startOption > 1);
 			arrowBobDown->active  = (yOffset > 4);
 		}
 
-		_input->clearKeyVerb();
+		_vm->input()->clearKeyVerb();
 
 		if (sentenceCount > 0) {
 			int zone = 0;
@@ -1308,12 +1295,12 @@
 
 			while (0 == selectedSentence) {
 
-				if (_input->talkQuit())
+				if (_vm->input()->talkQuit())
 					break;
 
-				_logic->update();
+				_vm->logic()->update();
 
-				zone = _logic->zoneIn(ZONE_PANEL, _input->mousePosX(), _input->mousePosY());
+				zone = _vm->logic()->zoneIn(ZONE_PANEL, _vm->input()->mousePosX(), _vm->input()->mousePosY());
 
 				if (5 == zone || 6 == zone) {
 					// XXX Arrow zones
@@ -1328,13 +1315,13 @@
 								oldZone, zone);*/
 
 						if (zone > 0) {
-							for (y = _logic->zoneBox(ZONE_PANEL, zone).y1; y < _logic->zoneBox(ZONE_PANEL, zone).y2; y += 10)
-								_graphics->textColor(150 + y, INK_JOE);
+							for (y = _vm->logic()->zoneBox(ZONE_PANEL, zone).y1; y < _vm->logic()->zoneBox(ZONE_PANEL, zone).y2; y += 10)
+								_vm->graphics()->textColor(150 + y, INK_JOE);
 						}
 
 						if (oldZone > 0) {
-							for (y = _logic->zoneBox(ZONE_PANEL, oldZone).y1; y < _logic->zoneBox(ZONE_PANEL, oldZone).y2; y += 10)
-								_graphics->textColor(150 + y, INK_TALK_NORMAL);
+							for (y = _vm->logic()->zoneBox(ZONE_PANEL, oldZone).y1; y < _vm->logic()->zoneBox(ZONE_PANEL, oldZone).y2; y += 10)
+								_vm->graphics()->textColor(150 + y, INK_TALK_NORMAL);
 						}
 
 						oldZone = zone;
@@ -1342,20 +1329,20 @@
 
 				}
 
-				int mouseButton = _input->mouseButton();
-				_input->clearMouseButton();
+				int mouseButton = _vm->input()->mouseButton();
+				_vm->input()->clearMouseButton();
 
-				if (_input->keyVerb().isDigit()) {
+				if (_vm->input()->keyVerb().isDigit()) {
 					for (i = 1; i <= 4; i++)
 					{
-						if (talkZone[i] == _input->keyVerb().digit())
+						if (talkZone[i] == _vm->input()->keyVerb().digit())
 						{
 							selectedSentence = i;
 							break;
 						}
 					}
 
-					_input->clearKeyVerb();
+					_vm->input()->clearKeyVerb();
 				}
 				else if (mouseButton) {
 					selectedSentence = zone;
@@ -1385,12 +1372,12 @@
 	arrowBobDown->active  = false;
 
 	if (selectedSentence > 0) {
-		_graphics->textClear(0,198);
+		_vm->graphics()->textClear(0,198);
 
 		speak(_talkString[selectedSentence], NULL, _joeVoiceFilePrefix[selectedSentence]);
 	}
 	
-	_graphics->textClear(151,151);
+	_vm->graphics()->textClear(151,151);
 
 	return selectedSentence;
 }

Index: talk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- talk.h	1 Dec 2003 20:48:40 -0000	1.23
+++ talk.h	11 Dec 2003 22:16:35 -0000	1.24
@@ -27,12 +27,7 @@
 
 namespace Queen {
 
-class Graphics;
-class Input;
-class Logic;
-class Resource;
-class Sound;
-struct BobSlot;
+class QueenEngine;
 
 class Talk {
   public:
@@ -42,22 +37,14 @@
 		const char *filename,
 		int personInRoom,
 		char *cutawayFilename, 
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound);
+		QueenEngine *vm);
 
 	//! Public interface to speak a sentence
 	static bool speak(
 		const char *sentence, 
 		Person *person, 
 		const char *voiceFilePrefix,
-		Graphics *graphics,
-		Input *input,
-		Logic *logic,
-		Resource *resource,
-		Sound *sound);
+		QueenEngine *vm);
 
 	//! Read a string from ptr and return new ptr
 	static byte *getString(byte *ptr, char *str, int maxLength, int align = 2);
@@ -105,11 +92,7 @@
 		signed char ff;
 	};
 
-	Graphics  *_graphics;
-	Input     *_input;
-	Logic     *_logic;
-	Resource  *_resource;
-	Sound     *_sound;
+	QueenEngine *_vm;
 
 	bool _wasFullscren;
 
@@ -164,7 +147,7 @@
 
 	static const SpeechParameters _speechParameters[];
 
-	Talk(Graphics *graphics, Input *input, Logic *logic, Resource *resource, Sound *sound);
+	Talk(QueenEngine *vm);
 	~Talk();
 
 	//! Perform talk in file and return a cutaway filename

Index: walk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/walk.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- walk.cpp	6 Dec 2003 13:15:17 -0000	1.30
+++ walk.cpp	11 Dec 2003 22:16:35 -0000	1.31
@@ -21,9 +21,11 @@
 
 #include "stdafx.h"
 #include "queen/walk.h"
+
+#include "queen/defs.h"
 #include "queen/logic.h"
 #include "queen/graphics.h"
-#include "queen/defs.h"
+#include "queen/queen.h"
 
 namespace Queen {
 
@@ -54,8 +56,8 @@
 
 
 
-Walk::Walk(Logic *logic, Graphics *graphics)
-	: _logic(logic), _graphics(graphics) {
+Walk::Walk(QueenEngine *vm)
+	: _vm(vm) {
 }
 
 
@@ -105,10 +107,10 @@
 	// queen.c l.2789-2835
 	uint16 lastDirection = 0;
 	uint16 i;
-	BobSlot *pbs = _graphics->bob(0);
-	_logic->joeFacing(_walkData[1].anim.facing);
-	_logic->joeScale(_walkData[1].area->calcScale(pbs->y));
-	_logic->joeFace();
+	BobSlot *pbs = _vm->graphics()->bob(0);
+	_vm->logic()->joeFacing(_walkData[1].anim.facing);
+	_vm->logic()->joeScale(_walkData[1].area->calcScale(pbs->y));
+	_vm->logic()->joeFace();
 	for (i = 1; i <= _walkDataCount && !_joeInterrupted; ++i) {
 
 		WalkData *pwd = &_walkData[i];
@@ -116,7 +118,7 @@
 		// area has been turned off, see if we should execute a cutaway
 		if (pwd->area->mapNeighbours < 0) {
 			// queen.c l.2838-2911
-			_logic->customMoveJoe(pwd->anim.facing, pwd->areaNum, i);
+			_vm->logic()->customMoveJoe(pwd->anim.facing, pwd->areaNum, i);
 			_joeMoveBlock = true;
 			return;
 		}
@@ -124,13 +126,13 @@
 			pbs->animNormal(pwd->anim.firstFrame, pwd->anim.lastFrame, 1, false, false);
 		}
 
-		uint16 moveSpeed = _logic->findScale(pbs->x, pbs->y) * 6 / 100;
+		uint16 moveSpeed = _vm->logic()->findScale(pbs->x, pbs->y) * 6 / 100;
 		pbs->move(pbs->x + pwd->dx, pbs->y + pwd->dy, moveSpeed);
 		pbs->xflip = (pbs->xdir < 0);
 		while (pbs->moving) {
 			// adjust Joe's movespeed according to scale
 			pbs->scale = pwd->area->calcScale(pbs->y);
-			_logic->joeScale(pbs->scale);
+			_vm->logic()->joeScale(pbs->scale);
 			if (pbs->xmajor) {
 				pbs->speed = pbs->scale * 6 / 100;
 			}
@@ -140,10 +142,10 @@
 			if (pbs->speed == 0) {
 				pbs->speed = 1;
 			}
-			_logic->checkPlayer();
+			_vm->logic()->checkPlayer();
 			// FIXME it would nice to be able to get rid of these 3 lines
 			// as stopJoe() should be do the same...
-			if (_logic->joeWalk() == JWM_EXECUTE) { // XXX || cutQuit 
+			if (_vm->logic()->joeWalk() == JWM_EXECUTE) { // XXX || cutQuit 
 				// we are about to do something else, so stop walking
 				_joeInterrupted = true;
 				pbs->moving = false;
@@ -151,7 +153,7 @@
 		}
 		lastDirection = pwd->anim.facing;
 	}
-	_logic->joeFacing(lastDirection);
+	_vm->logic()->joeFacing(lastDirection);
 }
 
 
@@ -235,7 +237,7 @@
 void Walk::animatePerson(const MovePersonData *mpd, uint16 image, uint16 bobNum, uint16 bankNum, int direction) {
 	// queen.c l.2572-2651
 
-	BobSlot *pbs = _graphics->bob(bobNum);
+	BobSlot *pbs = _vm->graphics()->bob(bobNum);
 
 	// check to see which way person should be facing
 	if (mpd->walkLeft1 == mpd->walkRight1) {
@@ -254,7 +256,7 @@
 		uint16 dstFrame = image;
 		uint16 srcFrame = ABS(pwd->anim.firstFrame);
 		while (srcFrame <= ABS(pwd->anim.lastFrame)) {
-			_graphics->bankUnpack(srcFrame, dstFrame, bankNum);
+			_vm->graphics()->bankUnpack(srcFrame, dstFrame, bankNum);
 			++dstFrame;
 			++srcFrame;
 		}
@@ -267,7 +269,7 @@
 		}
 
 		// move other actors at correct speed relative to scale
-		uint16 moveSpeed = _logic->findScale(pbs->x, pbs->y) * mpd->moveSpeed / 100;
+		uint16 moveSpeed = _vm->logic()->findScale(pbs->x, pbs->y) * mpd->moveSpeed / 100;
 		pbs->move(pbs->x + pwd->dx, pbs->y + pwd->dy, moveSpeed);
 
 		// flip if one set of frames for actor
@@ -276,7 +278,7 @@
 		}
 
 		while (pbs->moving) {
-			_logic->update();
+			_vm->logic()->update();
 			uint16 scale = pwd->area->calcScale(pbs->y);
 			pbs->scale = scale;
 			if (pbs->xmajor) {
@@ -302,13 +304,13 @@
 
 	_joeInterrupted = false;
 
-	uint16 oldx = _graphics->bob(0)->x;
-	uint16 oldy = _graphics->bob(0)->y;
+	uint16 oldx = _vm->graphics()->bob(0)->x;
+	uint16 oldy = _vm->graphics()->bob(0)->y;
 
-	_logic->joeWalk(JWM_MOVE);
+	_vm->logic()->joeWalk(JWM_MOVE);
 
-	uint16 oldPos = _logic->zoneInArea(ZONE_ROOM, oldx, oldy);
-	uint16 newPos = _logic->zoneInArea(ZONE_ROOM, endx, endy);
+	uint16 oldPos = _vm->logic()->zoneInArea(ZONE_ROOM, oldx, oldy);
+	uint16 newPos = _vm->logic()->zoneInArea(ZONE_ROOM, endx, endy);
 
 	debug(9, "Walk::moveJoe(%d, %d, %d, %d, %d) - old = %d, new = %d", direction, oldx, oldy, endx, endy, oldPos, newPos);
 
@@ -328,12 +330,12 @@
 		}
 		else {
 			// path has been blocked, make Joe say so
-			_logic->joeSpeak(4);
+			_vm->logic()->joeSpeak(4);
 			can = -1;
 		}
 	}
 
-	_graphics->bob(0)->animating = false;
+	_vm->graphics()->bob(0)->animating = false;
 	// cyx: the NEW_ROOM = 0 is done in Command::grabCurrentSelection()
 	// XXX if ((CAN==-1) && (walkgameload==0)) NEW_ROOM=0;
 	// XXX walkgameload=0;
@@ -342,10 +344,10 @@
 		_joeMoveBlock = false;
 	}
 	else if (direction > 0) {
-		_logic->joeFacing(direction);
+		_vm->logic()->joeFacing(direction);
 	}
-	_logic->joePrevFacing(_logic->joeFacing());
-	_logic->joeFace();
+	_vm->logic()->joePrevFacing(_vm->logic()->joeFacing());
+	_vm->logic()->joeFace();
 	return can;
 }
 
@@ -363,11 +365,11 @@
 	uint16 bobNum = pp->actor->bobNum;
 	uint16 bankNum = pp->actor->bankNum;
 
-	uint16 oldx = _graphics->bob(bobNum)->x;
-	uint16 oldy = _graphics->bob(bobNum)->y;
+	uint16 oldx = _vm->graphics()->bob(bobNum)->x;
+	uint16 oldy = _vm->graphics()->bob(bobNum)->y;
 
-	uint16 oldPos = _logic->zoneInArea(ZONE_ROOM, oldx, oldy);
-	uint16 newPos = _logic->zoneInArea(ZONE_ROOM, endx, endy);
+	uint16 oldPos = _vm->logic()->zoneInArea(ZONE_ROOM, oldx, oldy);
+	uint16 newPos = _vm->logic()->zoneInArea(ZONE_ROOM, endx, endy);
 
 	debug(9, "Walk::movePerson(%d, %d, %d, %d, %d) - old = %d, new = %d", direction, oldx, oldy, endx, endy, oldPos, newPos);
 
@@ -393,24 +395,24 @@
 	uint16 standingFrame = 29 + FRAMES_JOE_XTRA + bobNum;
 
 	// make other person face the right direction
-	BobSlot *pbs = _graphics->bob(bobNum);
+	BobSlot *pbs = _vm->graphics()->bob(bobNum);
 	pbs->endx = endx;
 	pbs->endy = endy;
 	pbs->animating = false;
 	pbs->scale = _walkData[_walkDataCount].area->calcScale(endy);
 	if (_walkData[_walkDataCount].anim.facing == DIR_BACK) {
-		_graphics->bankUnpack(mpd->backStandingFrame, standingFrame, bankNum);
+		_vm->graphics()->bankUnpack(mpd->backStandingFrame, standingFrame, bankNum);
 	}
 	else {
-		_graphics->bankUnpack(mpd->frontStandingFrame, standingFrame, bankNum);
+		_vm->graphics()->bankUnpack(mpd->frontStandingFrame, standingFrame, bankNum);
 	}
-	uint16 obj = _logic->objectForPerson(bobNum);
+	uint16 obj = _vm->logic()->objectForPerson(bobNum);
 	if (_walkData[_walkDataCount].dx < 0) {
-		_logic->objectData(obj)->image = -3;
+		_vm->logic()->objectData(obj)->image = -3;
 		pbs->xflip = true;
 	}
 	else {
-		_logic->objectData(obj)->image = -4;
+		_vm->logic()->objectData(obj)->image = -4;
 		pbs->xflip = false;
 	}
 	pbs->frameNum = standingFrame;
@@ -420,7 +422,7 @@
 
 void Walk::stopJoe() {
 
-	_graphics->bob(0)->moving = false;
+	_vm->graphics()->bob(0)->moving = false;
 	_joeInterrupted = true;
 }
 
@@ -449,8 +451,8 @@
 		for (i = 2; i <= _areaListCount; ++i) {
 			uint16 a1 = _areaList[i - 1];
 			uint16 a2 = _areaList[i];
-			const Area *pa1 = _logic->currentRoomArea(a1);
-			const Area *pa2 = _logic->currentRoomArea(a2);
+			const Area *pa1 = _vm->logic()->currentRoomArea(a1);
+			const Area *pa2 = _vm->logic()->currentRoomArea(a2);
 			uint16 x1 = calcC(pa1->box.x1, pa1->box.x2, pa2->box.x1, pa2->box.x2, px);
 			uint16 y1 = calcC(pa1->box.y1, pa1->box.y2, pa2->box.y1, pa2->box.y2, py);
 			incWalkData(px, py, x1, y1, a1);
@@ -490,10 +492,10 @@
 	uint16 i;
 	uint16 pos = 1;
 	uint32 minDist = ~0;
-	const Box *b = &_logic->currentRoomArea(1)->box;
-	for (i = 1; i <= _logic->currentRoomAreaMax(); ++i) {
+	const Box *b = &_vm->logic()->currentRoomArea(1)->box;
+	for (i = 1; i <= _vm->logic()->currentRoomAreaMax(); ++i) {
 
-		b = &_logic->currentRoomArea(i)->box;
+		b = &_vm->logic()->currentRoomArea(i)->box;
 
 		uint16 dx1 = ABS(b->x1 - *x);
 		uint16 dx2 = ABS(b->x2 - *x);
@@ -524,7 +526,7 @@
  	// we now have the closest area near X,Y, so we can recalibrate
  	// the X,Y coord to be in this area
 	if (recalibrate) {
-		b = &_logic->currentRoomArea(pos)->box;
+		b = &_vm->logic()->currentRoomArea(pos)->box;
 		if(*x < b->x1) *x = b->x1;
 		if(*x > b->x2) *x = b->x2;
 		if(*y < b->y1) *y = b->y1;
@@ -538,9 +540,9 @@
 
 	uint16 testArea;
 	uint16 freeArea = 0;
-	uint16 map = ABS(_logic->currentRoomArea(area)->mapNeighbours);
-	for (testArea = 1; testArea <= _logic->currentRoomAreaMax(); ++testArea) {
-		int b = _logic->currentRoomAreaMax() - testArea;
+	uint16 map = ABS(_vm->logic()->currentRoomArea(area)->mapNeighbours);
+	for (testArea = 1; testArea <= _vm->logic()->currentRoomAreaMax(); ++testArea) {
+		int b = _vm->logic()->currentRoomAreaMax() - testArea;
 		if (map & (1 << b)) {
 			// connecting area, check if it's been struck off
 			if(!isAreaStruck(testArea)) {
@@ -615,7 +617,7 @@
 		WalkData *pwd = &_walkData[_walkDataCount];
 		pwd->dx = x - px;
 		pwd->dy = y - py;
-		pwd->area = _logic->currentRoomArea(areaNum);
+		pwd->area = _vm->logic()->currentRoomArea(areaNum);
 		pwd->areaNum = areaNum;
 //		pwd->sign = ((pwd->dx < 0) ? -1 : ((pwd->dx > 0) ? 1 : 0)) ;
 	}

Index: walk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/walk.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- walk.h	1 Dec 2003 20:48:41 -0000	1.15
+++ walk.h	11 Dec 2003 22:16:35 -0000	1.16
@@ -63,13 +63,12 @@
 };
 
 
-class Logic;
-class Graphics;
+class QueenEngine;
 
 class Walk {
 public:
 
-	Walk(Logic *logic, Graphics *graphics);
+	Walk(QueenEngine *vm);
 
 	int16 moveJoe(int direction, int16 endx, int16 endy, bool inCutaway);
 	int16 movePerson(const Person *pp, int16 endx, int16 endy, uint16 curImage, int direction);
@@ -128,9 +127,7 @@
 	//! set if customMoveJoe() is called in joeAnimate()
 	bool _joeMoveBlock;
 
-	Logic *_logic;
-	Graphics *_graphics;
-
+	QueenEngine *_vm;
 
 	static const MovePersonData _moveData[];
 };





More information about the Scummvm-git-logs mailing list