[Scummvm-cvs-logs] CVS: scummvm/queen defs.h,1.29,1.30 display.h,1.20,1.21 display.cpp,1.27,1.28 command.cpp,1.16,1.17 graphics.h,1.36,1.37 graphics.cpp,1.45,1.46 logic.h,1.67,1.68 logic.cpp,1.97,1.98 walk.cpp,1.22,1.23 talk.cpp,1.42,1.43

Gregory Montoir cyx at users.sourceforge.net
Sat Nov 15 07:45:09 CET 2003


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

Modified Files:
	defs.h display.h display.cpp command.cpp graphics.h 
	graphics.cpp logic.h logic.cpp walk.cpp talk.cpp 
Log Message:
fix some bugs :
- right-clicking on inventory item doesn't execute default action
- unapplied room light level when Joe enters a room
- updated comment in roomDisplay on palette fading problem
- during dialogue, invalid mouse-overs (added enum for joeWalk flag too)

preparing Journal stuff :
- add a (almost useless) useJournal method to Logic
- removed useless code in Graphics, as it should (and could) be easily re-written in a more OO way


Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- defs.h	13 Nov 2003 08:18:05 -0000	1.29
+++ defs.h	15 Nov 2003 15:44:50 -0000	1.30
@@ -283,6 +283,14 @@
 };
 
 
+enum JoeWalkMode {
+	JWM_NORMAL  = 0,
+	JWM_MOVE    = 1,
+	JWM_EXECUTE = 2,
+	JWM_SPEAK   = 3
+};
+
+
 } // End of namespace Queen
 
 #endif

Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- display.h	14 Nov 2003 14:35:51 -0000	1.20
+++ display.h	15 Nov 2003 15:44:50 -0000	1.21
@@ -73,7 +73,7 @@
 	void palConvert(uint8 *outPal, const uint8 *inPal, int start, int end);
 	void palSet(const uint8 *pal, int start, int end, bool updateScreen = false);
 	void palSetJoe(JoePalette pal); // changejoepal
-	void palFadeIn(int start, int end, uint16 roomNum);
+	void palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16 dynaX, int16 dynaY);
 	void palFadeOut(int start, int end, uint16 roomNum);
 	void palFadePanel();
 	void palScroll(int start, int end);

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- display.cpp	14 Nov 2003 14:35:52 -0000	1.27
+++ display.cpp	15 Nov 2003 15:44:50 -0000	1.28
@@ -256,12 +256,14 @@
 }
 
 
-void Display::palFadeIn(int start, int end, uint16 roomNum) {
+void Display::palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16 dynaX, int16 dynaY) {
 
 	debug(9, "Display::palFadeIn(%d, %d)", start, end);
 	memcpy(_pals.screen, _pals.room, 256 * 3);
 	if (roomNum < 90 || (roomNum > 94 && roomNum < 114)) {
-		// XXX dynalum();
+		if (dynalum) {
+			dynalumUpdate(dynaX, dynaY);
+		}
 		int n = end - start + 1;
 		uint8 tempPal[256 * 3];
 		int i;

Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- command.cpp	13 Nov 2003 16:17:11 -0000	1.16
+++ command.cpp	15 Nov 2003 15:44:50 -0000	1.17
@@ -373,9 +373,7 @@
 	// l.419-452 execute.c
 	switch (com->specialSection) {
 	case 1:
-		// XXX l.428-438		
-		warning("Command::executeCurrentAction() - Journal unimplemented");
-		// XXX if(DEMO) SPEAK("This is a demo, so I can't load or save games*14", "JOE", "");
+		_logic->useJournal();
 		return;
 	case 2:
 		_logic->joeUseDress(true);
@@ -443,8 +441,7 @@
 	if (!_input->keyVerb().isNone()) {
 
 		if (_input->keyVerb().isJournal()) {
-			// XXX queen.c l.348-365
-			warning("Command::updatePlayer() - Journal not yet implemented");
+			_logic->useJournal();
 		}
 		else if (!_input->keyVerb().isSkipText()) {
 			_curCmd.verb = _input->keyVerb();
@@ -597,7 +594,7 @@
 		// select without a command, do a WALK
 		_logic->newRoom(0); // cancel makeJoeWalkTo, that should be equivalent to cr10 fix
 		clear(true);
-		_logic->joeWalk(2);
+		_logic->joeWalk(JWM_EXECUTE);
 	}
 }
 
@@ -639,7 +636,7 @@
 
 	if (_parse) {
 		_curCmd.verb = Verb(VERB_NONE);
-		_logic->joeWalk(2); // set JOEWALK flag to perform EXECUTE_ACTION procedure
+		_logic->joeWalk(JWM_EXECUTE);
 		_selCmd.action = _curCmd.action;
 		_curCmd.action = Verb(VERB_NONE);
 	}
@@ -686,10 +683,10 @@
 		_curCmd.verb = Verb(VERB_NONE);
 	}
 	else {
-		if (_logic->joeWalk() == 1) {
+		if (_logic->joeWalk() == JWM_MOVE) {
 			_cmdText.clear();
 			_curCmd.commandLevel = 1;
-			_logic->joeWalk(0);
+			_logic->joeWalk(JWM_NORMAL);
 			_curCmd.action = Verb(VERB_NONE);
 			lookCurrentIcon();
 		}
@@ -713,12 +710,15 @@
 			else {
 				_curCmd.verb = findDefault(item, true);
 			}
-			if (!_curCmd.verb.isNone()) {
+			if (_curCmd.verb.isNone()) {
 				// No match made, so command not yet completed. Redefine as LOOK AT
-				_curCmd.verb = Verb(VERB_LOOK_AT);
+				_curCmd.action = Verb(VERB_LOOK_AT);
 				_cmdText.setVerb(Verb(VERB_LOOK_AT));
 			}
-			_curCmd.action = _curCmd.verb;
+			else {
+				_curCmd.action = _curCmd.verb;
+			}
+			_curCmd.verb = Verb(VERB_NONE);
 		}
 	}
 
@@ -740,7 +740,7 @@
 		// selected a turned off object, so just walk
 		_curCmd.noun = 0;
 		clear(true);
-		_logic->joeWalk(2);
+		_logic->joeWalk(JWM_EXECUTE);
 		return;
 	}
 
@@ -787,8 +787,7 @@
 				else {
 					_curCmd.verb = findDefault(objNum, false);
 				}
-
-				if (_curCmd.verb.value() == VERB_NONE) {
+				if (_curCmd.verb.isNone()) {
 					_curCmd.action = Verb(VERB_WALK_TO);
 					_cmdText.setVerb(Verb(VERB_WALK_TO));
 				}
@@ -824,8 +823,8 @@
 		}
 		else {
 			_selCmd.defaultVerb = Verb(VERB_NONE);
-			if (_logic->joeWalk() == 1 && !_curCmd.verb.isNone()) {
-				_logic->joeWalk(0);
+			if (_logic->joeWalk() == JWM_MOVE && !_curCmd.verb.isNone()) {
+				_logic->joeWalk(JWM_NORMAL);
 			}
 			_curCmd.commandLevel = 1;
 			_curCmd.oldVerb = Verb(VERB_NONE);
@@ -1510,7 +1509,7 @@
 
 	_curCmd.noun = _logic->findObjectUnderCursor(_input->mousePosX(), _input->mousePosY());
 
-	if (_logic->joeWalk() == 1) {
+	if (_logic->joeWalk() == JWM_MOVE) {
 		return;
 	}
 
@@ -1589,7 +1588,7 @@
 void Command::lookCurrentIcon() {
 
 	_curCmd.verb = _logic->findVerbUnderCursor(_input->mousePosX(), _input->mousePosY());
-	if (_curCmd.verb != _curCmd.oldVerb && _logic->joeWalk() != 1) {
+	if (_curCmd.verb != _curCmd.oldVerb && _logic->joeWalk() != JWM_MOVE) {
 
 		if (_curCmd.action.isNone()) {
 			_cmdText.clear();

Index: graphics.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- graphics.h	7 Nov 2003 16:44:12 -0000	1.36
+++ graphics.h	15 Nov 2003 15:44:50 -0000	1.37
@@ -183,10 +183,6 @@
 	void loadBackdrop(const char *name, uint16 room);
 	void loadPanel();
 
-	void useJournal(GameConfig *cfg);
-	void journalBobSetup(uint32 bobnum, uint16 x, uint16 y, uint16 frame);
-	void journalBobPreDraw(GameConfig *cfg);
-
 	void cameraBob(int bobNum) { _cameraBob = bobNum; }
 	int cameraBob() const { return _cameraBob; }
 

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- graphics.cpp	12 Nov 2003 10:50:05 -0000	1.45
+++ graphics.cpp	15 Nov 2003 15:44:50 -0000	1.46
@@ -765,65 +765,6 @@
 }
 
 
-void Graphics::useJournal(GameConfig *cfg) {
-
-	bobClearAll();
-	loadBackdrop("journal.pcx", 160);
-	_display->palFadeOut(0, 255, 160);
-
-	// load and unpack journal frames
-	frameEraseAll(false);
-	bankLoad("journal.BBK", 8);
-	int i;
-	for(i = 1; i <= 20; ++i) {
-		bankUnpack(i, FRAMES_JOURNAL + i, 8);
-		// set hot spots to zero
-		_frames[FRAMES_JOURNAL + i].xhotspot = 0;
-		_frames[FRAMES_JOURNAL + i].yhotspot = 0;
-	}
-	// adjust info box hot spot to put it on top always
-	_frames[FRAMES_JOURNAL + 20].yhotspot = 200;
-	bankErase(8);
-
-	// XXX setup zones
-
-	journalBobPreDraw(cfg);
-	_display->palFadeIn(0, 255, 160);
-
-	// XXX l.1191-1509
-}
-
-
-void Graphics::journalBobSetup(uint32 bobnum, uint16 x, uint16 y, uint16 frameNum) 
-{
-	BobSlot *pbs = &_bobs[bobnum];
-	pbs->active = true;
-	pbs->x = x;
-	pbs->y = y;
-	pbs->frameNum = FRAMES_JOURNAL + frameNum;
-	pbs->box.y2 = GAME_SCREEN_HEIGHT - 1;
-}
-
-
-void Graphics::journalBobPreDraw(GameConfig *cfg) {
-
-	journalBobSetup(1, 32, 8, 1); // Review entry
-	journalBobSetup(2, 32, 56, 2); // Make entry
-	journalBobSetup(3, 32, 104, 1); // Close book
-	journalBobSetup(4, 32, 152, 3); // Give up
-	journalBobSetup(5, 136 + cfg->talkSpeed * 4 - 4, 164, 18); // Text speed
-	journalBobSetup(6, 221, 155, 16); // SFX on/off
-	_bobs[6].active = cfg->sfxToggle;
-	journalBobSetup(7, 136 + cfg->musicVolume * 130 / 100 - 4, 177, 19); // Music volume
-	journalBobSetup(10, 158, 155, 16); // Voice on/off
-	_bobs[10].active = cfg->speechToggle;
-	journalBobSetup(11, 125, 167, 16); // Text on/off
-	_bobs[11].active = cfg->textToggle;
-	journalBobSetup(12, 125, 181, 16); // Music on/off
-	_bobs[12].active = cfg->musicToggle;
-}
-
-
 void Graphics::initCarBamScene() {
 
 	bobClear(5);

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- logic.h	14 Nov 2003 14:35:51 -0000	1.67
+++ logic.h	15 Nov 2003 15:44:50 -0000	1.68
@@ -172,14 +172,14 @@
 	uint16 joeFacing()	{ return _joe.facing; }
 	uint16 joeX()		{ return _joe.x; }
 	uint16 joeY()		{ return _joe.y; }
-	uint16 joeWalk()	{ return _joe.walk; }
+	JoeWalkMode joeWalk()	{ return _joe.walk; }
 	uint16 joeScale()	{ return _joe.scale; }
 	uint16 joePrevFacing() { return _joe.prevFacing; }
 
 	void joeFacing(uint16 dir);
 	void joeX(uint16 x);
 	void joeY(uint16 y);
-	void joeWalk(uint16 walking);
+	void joeWalk(JoeWalkMode walking);
 	void joeScale(uint16 scale);
 	void joePrevFacing(uint16 dir);
 	
@@ -304,6 +304,8 @@
 
 	void update();
 
+	void useJournal();
+
 	bool gameSave(uint16 slot, const char *desc);
 	bool gameLoad(uint16 slot);
 
@@ -409,7 +411,7 @@
 	struct {
 		uint16	x, y;
 		uint16	facing, prevFacing;
-		uint16  walk;
+		JoeWalkMode walk;
 		uint16  scale;
 	} _joe;
 	

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- logic.cpp	14 Nov 2003 16:16:55 -0000	1.97
+++ logic.cpp	15 Nov 2003 15:44:50 -0000	1.98
@@ -663,7 +663,7 @@
 	_joe.y = y;
 }
 
-void Logic::joeWalk(uint16 walking) {
+void Logic::joeWalk(JoeWalkMode walking) {
 	_joe.walk = walking;
 }
 
@@ -1221,15 +1221,19 @@
 	if (mode != RDM_FADE_NOJOE) {
 		pod = joeSetupInRoom(mode != RDM_FADE_JOE_XY, scale);
 	}
-	// FIXME: commented for now, to avoid color glitches when
-	// switching rooms during cutaway
+	// FIXME: for now, always display room even if mode tells us
+	// to not do so. This is necessary as actual Cutaway code 
+	// doesn't do any of the needed palFadeIn() calls. The only
+	// noticeable problem is the initial display of the pinnacle 
+	// room which is faded 2 times.
 //	if (mode != RDM_NOFADE_JOE) {
 		update();
+		BobSlot *joe = _graphics->bob(0);
 		if (_currentRoom >= 114) {
-			_display->palFadeIn(0, 255, _currentRoom);
+			_display->palFadeIn(0, 255, _currentRoom, joe->active, joe->x, joe->y);
 		}
 		else {
-			_display->palFadeIn(0, 223, _currentRoom);
+			_display->palFadeIn(0, 223, _currentRoom, joe->active, joe->x, joe->y);
 		}
 //	}
 	if (pod != NULL) {
@@ -2261,7 +2265,7 @@
 	joe->animating = piton->animating = false;
 
 	update();
-	_display->palFadeIn(0, 223, ROOM_JUNGLE_PINNACLE);
+	_display->palFadeIn(0, 223, ROOM_JUNGLE_PINNACLE, joe->active, joe->x, joe->y);
 
 	_entryObj = 0;
 	uint16 prevObj = 0;
@@ -2536,6 +2540,24 @@
 	_display->mouseCursorShow(true);
 	zoneSetupPanel();
 }
+
+
+void Logic::useJournal() {
+
+	warning("Journal unimplemented");
+	if (_resource->isDemo()) {
+		Talk::speak("This is a demo, so I can't load or save games*14", NULL, "", _graphics, _input, this, _resource, _sound);
+	}
+	else {
+		// FIXME: add Journal code, suggestion :
+		// (execute.c l.428-437 & queen.c l.350-365)
+		// save some vars
+		// Journal j(this, _graphics...);
+		// j.run();
+		// restore vars
+	}
+}
+
 
 } // End of namespace Queen
 

Index: walk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/walk.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- walk.cpp	13 Nov 2003 09:30:49 -0000	1.22
+++ walk.cpp	15 Nov 2003 15:44:50 -0000	1.23
@@ -142,7 +142,7 @@
 				pbs->speed = 1;
 			}
 			_logic->checkPlayer();
-			if (_logic->joeWalk() == 2) { // XXX || cutQuit 
+			if (_logic->joeWalk() == JWM_EXECUTE) { // XXX || cutQuit 
 				// we are about to do something else, so stop walking
 				interrupted = true;
 				pbs->moving = false;
@@ -299,7 +299,7 @@
 	uint16 oldx = _graphics->bob(0)->x;
 	uint16 oldy = _graphics->bob(0)->y;
 
-	_logic->joeWalk(1);
+	_logic->joeWalk(JWM_MOVE);
 
 	uint16 oldPos = _logic->zoneInArea(ZONE_ROOM, oldx, oldy);
 	uint16 newPos = _logic->zoneInArea(ZONE_ROOM, endx, endy);

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- talk.cpp	14 Nov 2003 14:35:51 -0000	1.42
+++ talk.cpp	15 Nov 2003 15:44:50 -0000	1.43
@@ -355,7 +355,7 @@
 	}
 
 	_talkHead = false;
-	_logic->joeWalk(0);
+	_logic->joeWalk(JWM_NORMAL);
 }
 		
 void Talk::disableSentence(int oldLevel, int selectedSentence) {
@@ -603,6 +603,8 @@
 	Person joe_person;
 	ActorData joe_actor;
 
+	_logic->joeWalk(JWM_SPEAK);
+
 	if (!person) {
 		// Fill in values for use by speakSegment() etc.
 		memset(&joe_person, 0, sizeof(Person));
@@ -865,7 +867,7 @@
 			else
 				_logic->update();
 
-			if (_logic->joeWalk() == 3) {
+			if (_logic->joeWalk() == JWM_SPEAK) {
 				if (_input->talkQuit())
 					break;
 
@@ -876,8 +878,7 @@
 					break;
 
 				_logic->checkPlayer();
-
-				if (_logic->joeWalk() == 2)
+				if (_logic->joeWalk() == JWM_EXECUTE)
 					// Selected a command, so exit
 					break;
 			}





More information about the Scummvm-git-logs mailing list