[Scummvm-cvs-logs] CVS: scummvm/queen cutaway.cpp,1.87,1.88 cutaway.h,1.28,1.29 logic.cpp,1.123,1.124 logic.h,1.80,1.81 queen.cpp,1.48,1.49 queen.h,1.16,1.17 xref.txt,1.44,1.45

Gregory Montoir cyx at users.sourceforge.net
Wed Dec 10 07:37:02 CET 2003


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

Modified Files:
	cutaway.cpp cutaway.h logic.cpp logic.h queen.cpp queen.h 
	xref.txt 
Log Message:
- moved QueenEngine::roomChanged to Logic and enabled call from Cutaway code (this fixes the 2 irons bars being displayed at the end of c39a.cut)
- moved my 'panel being hidden after the head room display' fix
- fix problem in joeCutFacing / joeFacing in cutaway code


Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- cutaway.cpp	10 Dec 2003 14:19:04 -0000	1.87
+++ cutaway.cpp	10 Dec 2003 15:36:44 -0000	1.88
@@ -150,6 +150,9 @@
 	_nextSentence = Talk::getString(_nextSentence, entryString, MAX_STRING_LENGTH);
 	debug(0, "Entry string = '%s'", entryString);
 
+	_logic->joeCutFacing(_logic->joeFacing());
+	_logic->joeFace();
+
 	if (entryString[0] == '*' &&
 			entryString[1] == 'F' &&
 			entryString[3] == '\0') {
@@ -403,6 +406,12 @@
 		comPanel = 1;
 	}
 
+	// FIXME: in the original engine, panel is hidden after displaying head. We do
+	// it before.
+	if(object.room == FAYE_HEAD || object.room == AZURA_HEAD || object.room == FRANK_HEAD) {
+		comPanel = 2;
+	}
+
 	RoomDisplayMode mode;
 
 	if (!_logic->joeX() && !_logic->joeY()) {
@@ -865,18 +874,8 @@
 
 	_input->cutawayRunning(true);
 
-	_logic->joeCutFacing(_logic->joeFacing());
-	_logic->joeFace();
-
 	_initialRoom = _temporaryRoom = _logic->currentRoom();
 
-	// FIXME: hack to hide the panel *before* displaying a talking head.
-	// This was not handled in the original game, but I think it is 
-	// better like that.
-	if (_talkTo != 0) {
-		_comPanel = 2;
-	}
-
 	_logic->display()->screenMode(_comPanel, true);
 
 	if (_comPanel == 0 || _comPanel == 2) {
@@ -1012,17 +1011,14 @@
 			}
 
 			if (_logic->currentRoom() != _initialRoom) {
-				// XXX should call SETUP_ROOM here but that would introduce a
-				// circual dependency, so we try to set newRoom to the room
-				// instead
-				debug(0, "[Cutaway::run] Not calling SETUP_ROOM here, just setting newRoom to %i", _initialRoom);
-				_logic->newRoom(_initialRoom);
-				_logic->display()->fullscreen(true);
-			}
-			else {
-				_logic->joeX(0);
-				_logic->joeY(0);
+				_logic->currentRoom(_initialRoom);
+				_logic->changeRoom();
+				if (_logic->currentRoom() == _logic->newRoom()) {
+					_logic->newRoom(0);
+				}
 			}
+			_logic->joeX(0);
+			_logic->joeY(0);
 		}
 
 		_logic->joeCutFacing(0);

Index: cutaway.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- cutaway.h	10 Dec 2003 14:19:04 -0000	1.28
+++ cutaway.h	10 Dec 2003 15:36:44 -0000	1.29
@@ -290,7 +290,6 @@
 		//! Dump CutawayAnum data with debug()
 		static void dumpCutawayAnim(CutawayAnim &anim);
 
-
 };
 
 } // End of namespace Queen

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- logic.cpp	10 Dec 2003 14:19:04 -0000	1.123
+++ logic.cpp	10 Dec 2003 15:36:44 -0000	1.124
@@ -400,6 +400,10 @@
 
 
 ObjectData* Logic::objectData(int index) const {
+
+	if (index < 0) {
+		warning("Logic::objectData() called with negative object index: %i", index);
+	}
 	index = ABS(index); // cyx: is that really necessary ?
 	if (index <= _numObjects)
 		return &_objectData[index];
@@ -2568,6 +2572,63 @@
 	_display->palSetAllDirty();
 	_display->showMouseCursor(true);
 	zoneSetupPanel();
+}
+
+
+void Logic::changeRoom() {
+
+	if (currentRoom() == ROOM_JUNGLE_PINNACLE) {
+		handlePinnacleRoom();
+	}
+	else if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) {
+		// FIXME: this should be rewritten in a more elegant way
+		bool pcGamesDemo = _resource->isDemo() && !_resource->exists("pclogo.cut");
+
+		if (pcGamesDemo) {
+			currentRoom(79);
+		}
+		roomDisplay(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
+
+		if (_resource->isDemo()) {
+			if (pcGamesDemo) {
+				playCutaway("clogo.cut");
+			}
+			else {
+				playCutaway("pclogo.cut");
+			}
+		}
+		else {
+			playCutaway("copy.cut");
+			playCutaway("clogo.cut");
+
+			// TODO enable talking for talkie version
+
+			playCutaway("cdint.cut");
+
+			// restore palette colors ranging from 144 to 256
+			_graphics->loadPanel();
+			
+			playCutaway("cred.cut");
+		}
+
+		// Ugly fix from original code
+		sceneReset();
+
+		currentRoom(ROOM_HOTEL_LOBBY);
+		entryObj(584);
+
+		roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 2, true);
+		playCutaway("c70d.cut");
+
+		gameState(VAR_INTRO_PLAYED, 1);
+
+		inventorySetup();
+		inventoryRefresh();
+	}
+	else {
+		roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 1, false);
+	}
+	_display->showMouseCursor(true); // _drawMouseFlag = 1;
 }
 
 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- logic.h	10 Dec 2003 14:19:04 -0000	1.80
+++ logic.h	10 Dec 2003 15:36:44 -0000	1.81
@@ -296,6 +296,8 @@
 	//! Stop making a scene
 	void sceneStop();
 
+	void changeRoom();
+
 	void useJournal();
 
 	void executeSpecialMove(uint16 sm);

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- queen.cpp	3 Dec 2003 10:33:01 -0000	1.48
+++ queen.cpp	10 Dec 2003 15:36:44 -0000	1.49
@@ -122,71 +122,18 @@
 	strcpy(buf2, buf1);
 }
 
-void QueenEngine::roomChanged() {
-	// queen.c function SETUP_ROOM, lines 398-428
-
-	// This function uses lots of variables in logic, but we can't move it to
-	// logic because that would cause a circular dependency between Cutaway and
-	// Logic... :-(
-
-	if (_logic->currentRoom() == ROOM_JUNGLE_PINNACLE) {
-		_logic->handlePinnacleRoom();
-	}
-	else if (_logic->currentRoom() == FOTAQ_LOGO && _logic->gameState(VAR_INTRO_PLAYED) == 0) {
-		bool pcGamesDemo = _resource->isDemo() && !_resource->exists("pclogo.cut");
-
-		if (pcGamesDemo) {
-			_logic->currentRoom(79);
-		}
-		_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
-
-		if (_resource->isDemo()) {
-			if (pcGamesDemo) {
-				_logic->playCutaway("clogo.cut");
-			}
-			else {
-				_logic->playCutaway("pclogo.cut");
-			}
-		}
-		else {
-			_logic->playCutaway("copy.cut");
-			_logic->playCutaway("clogo.cut");
-
-			// TODO enable talking for talkie version
-
-			_logic->playCutaway("cdint.cut");
-
-			// restore palette colors ranging from 144 to 256
-			_graphics->loadPanel();
-			
-			_logic->playCutaway("cred.cut");
-		}
-
-		// Ugly fix from original code
-		_logic->sceneReset();
-
-		_logic->currentRoom(ROOM_HOTEL_LOBBY);
-		_logic->entryObj(584);
-
-		_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 100, 2, true);
-		_logic->playCutaway("c70d.cut");
-
-		_logic->gameState(VAR_INTRO_PLAYED, 1);
-
-		_logic->inventorySetup();
-		_logic->inventoryRefresh();
-	}
-	else {
-		_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 100, 1, false);
-	}
-	_display->showMouseCursor(true); // _drawMouseFlag = 1;
-}
-
 
 void QueenEngine::go() {
 
 	initialise();
 
+_input->fastMode(true);
+
+//_logic->currentRoom(69);
+//_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 100, 2, true);
+//_graphics->initFightBamScene();
+//_logic->playCutaway("c69g.CUT");
+
 	_logic->oldRoom(0);
 	_logic->newRoom(_logic->currentRoom());
 
@@ -197,7 +144,7 @@
 			_logic->update();
 			_logic->oldRoom(_logic->currentRoom());
 			_logic->currentRoom(_logic->newRoom());
-			roomChanged();
+			_logic->changeRoom();
 			_display->fullscreen(false);
 			if (_logic->currentRoom() == _logic->newRoom()) {
 				_logic->newRoom(0);

Index: queen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- queen.h	3 Dec 2003 10:33:01 -0000	1.16
+++ queen.h	10 Dec 2003 15:36:44 -0000	1.17
@@ -45,9 +45,6 @@
 
 	void errorString(const char *buf_input, char *buf_output);
 
-	//! Called when we go from one room to another
-	void roomChanged(); // SETUP_ROOM
-
 	void go();
 
 	void initialise();
@@ -55,7 +52,6 @@
 	static void timerHandler(void *ptr);
 	void gotTimerTick();
 
-	
 	Graphics *_graphics;
 	Input *_input;
 	Resource *_resource;

Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/xref.txt,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- xref.txt	6 Dec 2003 13:15:17 -0000	1.44
+++ xref.txt	10 Dec 2003 15:36:44 -0000	1.45
@@ -220,7 +220,7 @@
 restart_game()
 SETUP_BOBS()				Graphics::bobSetupControl
 SETUP_FURNITURE()			Logic::roomSetupFurniture
-SETUP_ROOM()				QueenEngine::roomChanged
+SETUP_ROOM()				Logic::changeRoom
 SETUP_SCREENS()				*not needed* (only calls Graphics::loadPanel)
 SETUP_VARS()				*not needed* (equivalent to Command::clear(), SCENE=0, clear(gamestate))
 update() 					Logic::update





More information about the Scummvm-git-logs mailing list