[Scummvm-cvs-logs] CVS: scummvm/queen logic.h,1.66,1.67 logic.cpp,1.95,1.96 cutaway.cpp,1.65,1.66 talk.cpp,1.41,1.42 display.h,1.19,1.20 display.cpp,1.26,1.27

Gregory Montoir cyx at users.sourceforge.net
Fri Nov 14 06:37:25 CET 2003


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

Modified Files:
	logic.h logic.cpp cutaway.cpp talk.cpp display.h display.cpp 
Log Message:
rewitten fullscreen/panel switching code

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- logic.h	10 Nov 2003 12:32:46 -0000	1.66
+++ logic.h	14 Nov 2003 14:35:51 -0000	1.67
@@ -288,10 +288,10 @@
 	void sceneReset() { _scene = 0; }
 
 	//! Make a scene
-	void sceneStart(bool showMouseCursor);
+	void sceneStart();
 
 	//! Stop making a scene
-	void sceneStop(bool showMouseCursor);
+	void sceneStop();
 
 	//! Copy data from dummy object to object
 	void objectCopy(int dummyObjectIndex, int objectIndex);

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- logic.cpp	13 Nov 2003 12:39:37 -0000	1.95
+++ logic.cpp	14 Nov 2003 14:35:51 -0000	1.96
@@ -1835,7 +1835,9 @@
 	if (cutaway == NULL) {
 		cutaway = cutawayFile;
 	}
+	_display->fullscreen(true);
 	Talk::talk(dlgFile, personInRoom, cutaway, _graphics, _input, this, _resource, _sound);
+	_display->fullscreen(false);
 }
 
 
@@ -2507,21 +2509,20 @@
 	return true;
 }
 
-void Logic::sceneStart(bool showMouseCursor) {
+void Logic::sceneStart() {
 	debug(0, "[Logic::sceneStart] _scene = %i", _scene);
 	_scene++;
 
-	_display->mouseCursorShow(showMouseCursor);
+	_display->mouseCursorShow(false);
 
-	if (1 == _scene && _input->cutawayRunning()) {
-		_display->panel(true);
+	if (1 == _scene) { // && _input->cutawayRunning()) { // sceneStart is always called when cutaway is running
 		_display->palFadePanel();
 	}
 
 	update();
 }
 
-void Logic::sceneStop(bool showMouseCursor) {
+void Logic::sceneStop() {
 	debug(0, "[Logic::sceneStop] _scene = %i", _scene);
 	_scene--;
 
@@ -2529,8 +2530,7 @@
 		return;
 
 	_display->palSetAllDirty();
-	_display->panel(true);
-	_display->mouseCursorShow(showMouseCursor);
+	_display->mouseCursorShow(true);
 	zoneSetupPanel();
 }
 

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- cutaway.cpp	13 Nov 2003 12:17:53 -0000	1.65
+++ cutaway.cpp	14 Nov 2003 14:35:51 -0000	1.66
@@ -1204,8 +1204,18 @@
 
 	_initialRoom = _temporaryRoom = _logic->currentRoom();
 
-	if (_comPanel == 0 || _comPanel == 2)
-		_logic->sceneStart(false);
+	// 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) {
+		_logic->sceneStart();
+	}
 
 	byte *ptr = _objectData;
 
@@ -1308,11 +1318,13 @@
 	talk(nextFilename);
 
 	if (_comPanel == 0 || (_comPanel == 2 && !_anotherCutaway)) {
-		_logic->sceneStop(true);
+		_logic->sceneStop();
 		_comPanel = 0;
 	}
 
 	if (nextFilename[0] == '\0' && !_anotherCutaway) {
+		_logic->display()->fullscreen(false);
+
 		// Lines 2138-2182 in cutaway.c
 		if (_finalRoom) {
 			_logic->newRoom(0);
@@ -1340,12 +1352,12 @@
 				// instead
 				debug(0, "[Cutaway::run] Not calling SETUP_ROOM here, just setting newRoom to %i", _initialRoom);
 				_logic->newRoom(_initialRoom);
+				_logic->display()->fullscreen(true);
 			}
 		}
 
 		// XXX CUTJOEF=0;
 		_comPanel = 0;
-		_logic->display()->fullscreen(false);
 
 		// XXX some string animations
 		int k = 0;

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- talk.cpp	13 Nov 2003 14:10:15 -0000	1.41
+++ talk.cpp	14 Nov 2003 14:35:51 -0000	1.42
@@ -116,10 +116,6 @@
 	// XXX 	SPEAK(JOE_RESPstr[k],"JOE",find_cd_desc(k));
 	// XXX 	return;
 	// XXX }
-	// XXX panelflag=0;
-
-	_wasFullscren = _logic->display()->fullscreen();
-	_logic->display()->fullscreen(true);
 
 	load(filename);
 
@@ -353,7 +349,6 @@
 		pbs->x = person.actor->x;
 		pbs->y = person.actor->y;
 		
-		_logic->display()->fullscreen(_wasFullscren);
 		// Better kick start the persons anim sequence
 		pbs->animating = true;
 		pbs->animReset();
@@ -623,8 +618,8 @@
 		person = &joe_person;
 	}
 	
-	debug(0, "Sentence '%s' is said by person '%s' and voice files with prefix '%s' played",
-			sentence, person->name, voiceFilePrefix);
+	//debug(0, "Sentence '%s' is said by person '%s' and voice files with prefix '%s' played",
+	//		sentence, person->name, voiceFilePrefix);
 
 	if (sentence[0] == '\0') {
 		goto exit;

Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- display.h	10 Nov 2003 15:45:53 -0000	1.19
+++ display.h	14 Nov 2003 14:35:51 -0000	1.20
@@ -101,11 +101,9 @@
 	void horizontalScroll(int16 scroll);
 	int16 horizontalScroll() const { return _horizontalScroll; }
 
-	void fullscreen(bool fs) { _fullscreen = fs; }
+	void fullscreen(bool fs) { debug(0, "Display::fullscreen(%d)", fs); _fullscreen = fs; }
 	bool fullscreen() const { return _fullscreen; }
 
-	void panel(bool on) { _panel = on; }
-
 	void handleTimer();
 	void waitForTimer();
 
@@ -140,7 +138,6 @@
 	uint16 _bufPitch[3];
 
 	bool _fullscreen;
-	bool _panel;
 
 	uint16 _horizontalScroll;
 	uint16 _bdWidth, _bdHeight;

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- display.cpp	13 Nov 2003 09:30:48 -0000	1.26
+++ display.cpp	14 Nov 2003 14:35:52 -0000	1.27
@@ -621,36 +621,28 @@
 
 void Display::screenMode(int comPanel, bool inCutaway) {
 
+	debug(0, "Display::screenMode(%d, %d)", comPanel, inCutaway);
+
+	// FIXME: this is temporary, just to see if my theory is right
+	if (comPanel == 2 && !inCutaway) {
+		warning("Display::screenMode() - (comPanel == 2 && !inCutaway)");
+	}
+
 	if (comPanel == 2 && inCutaway) {
-		if (_bdHeight == GAME_SCREEN_HEIGHT) {
-			_fullscreen = true;
-			_panel = false;
-		}
-		else {
-			_fullscreen = false;
-			_panel = true;
-		}
+		_fullscreen = (_bdHeight == GAME_SCREEN_HEIGHT);
 	}
-	else {
-		_fullscreen = 0;
-		if (comPanel == 1) {
-			_panel = true;
-		}
+	else if (comPanel == 1) {
+		_fullscreen = false;
 	}
 }
 
 
 void Display::prepareUpdate() {
 
-	if (_panel) {
+	if (!_fullscreen) {
 		// draw the panel
 		memcpy(_buffers[RB_SCREEN] + _bufPitch[RB_SCREEN] * ROOM_ZONE_HEIGHT, 
 			_buffers[RB_PANEL], PANEL_W * PANEL_H);
-	}
-	else if (!_fullscreen) {
-		// clear the panel
-		memset(_buffers[RB_SCREEN] + _bufPitch[RB_SCREEN] * ROOM_ZONE_HEIGHT, 
-			0, PANEL_W * PANEL_H);
 	}
 
 	// draw the backdrop bitmap





More information about the Scummvm-git-logs mailing list