[Scummvm-cvs-logs] SF.net SVN: scummvm: [25886] scummvm/trunk/engines/queen

cyx at users.sourceforge.net cyx at users.sourceforge.net
Mon Feb 26 21:50:33 CET 2007


Revision: 25886
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25886&view=rev
Author:   cyx
Date:     2007-02-26 12:50:33 -0800 (Mon, 26 Feb 2007)

Log Message:
-----------
some fixes for FOTAQ Amiga versions, cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/queen/credits.cpp
    scummvm/trunk/engines/queen/cutaway.cpp
    scummvm/trunk/engines/queen/display.cpp
    scummvm/trunk/engines/queen/logic.cpp
    scummvm/trunk/engines/queen/logic.h
    scummvm/trunk/engines/queen/sound.cpp
    scummvm/trunk/engines/queen/talk.cpp

Modified: scummvm/trunk/engines/queen/credits.cpp
===================================================================
--- scummvm/trunk/engines/queen/credits.cpp	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/credits.cpp	2007-02-26 20:50:33 UTC (rev 25886)
@@ -133,6 +133,7 @@
 			_count++;
 		}
 	}
+	_running = false;
 }
 
 

Modified: scummvm/trunk/engines/queen/cutaway.cpp
===================================================================
--- scummvm/trunk/engines/queen/cutaway.cpp	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/cutaway.cpp	2007-02-26 20:50:33 UTC (rev 25886)
@@ -463,9 +463,8 @@
 
 const byte *Cutaway::getCutawayAnim(const byte *ptr, int header, CutawayAnim &anim) {
 	// lines 1531-1607 in cutaway.c
+	debug(6, "[Cutaway::getCutawayAnim] header=%i", header);
 
-	//debug(6, "[Cutaway::getCutawayAnim] header=%i", header);
-
 	anim.currentFrame = 0;
 	anim.originalFrame = 0;
 

Modified: scummvm/trunk/engines/queen/display.cpp
===================================================================
--- scummvm/trunk/engines/queen/display.cpp	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/display.cpp	2007-02-26 20:50:33 UTC (rev 25886)
@@ -367,6 +367,8 @@
 			hiPal = 31;
 			break;
 		}
+		_pal.dirtyMin = MIN(_pal.dirtyMin, loPal);
+		_pal.dirtyMax = MAX(_pal.dirtyMax, hiPal);
 		return;
 	}
 
@@ -729,16 +731,19 @@
 
 	if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
 		decodeLBM(data, dataSize, _backdropBuf, BACKDROP_W, &_bdWidth, &_bdHeight, _pal.room, 0, 32);
+		if (_bdHeight < BACKDROP_H) {
+			memset(_backdropBuf + _bdHeight * BACKDROP_W, 0, (BACKDROP_H - _bdHeight) * BACKDROP_W);
+		}
 	} else {
 		int n = getNumColorsForRoom(room);
 		if (n != 256) {
 			n = 144;
 		}
 		decodePCX(data, dataSize, _backdropBuf, BACKDROP_W, &_bdWidth, &_bdHeight, _pal.room, 0, n);
-		palCustomColors(room);
 	}
 
 	delete[] data;
+	palCustomColors(room);
 	forceFullRefresh();
 }
 
@@ -932,7 +937,16 @@
 
 void Display::setDirtyBlock(uint16 x, uint16 y, uint16 w, uint16 h) {
 	if (_fullRefresh < 2) {
-		assert(x + w <= SCREEN_W && y + h <= SCREEN_H);
+		if (x >= SCREEN_W) {
+			return;
+		} else if (x + w > SCREEN_W) {
+			w = SCREEN_W - x;
+		}
+		if (y >= SCREEN_H) {
+			return;
+		} else if (y + h > SCREEN_H) {
+			h = SCREEN_H - y;
+		}
 		uint16 ex = (x + w - 1) / D_BLOCK_W;
 		uint16 ey = (y + h - 1) / D_BLOCK_H;
 		x /= D_BLOCK_W;

Modified: scummvm/trunk/engines/queen/logic.cpp
===================================================================
--- scummvm/trunk/engines/queen/logic.cpp	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/logic.cpp	2007-02-26 20:50:33 UTC (rev 25886)
@@ -56,8 +56,8 @@
 	_puzzleAttemptCount = 0;
 	_journal = new Journal(vm);
 	_scene = 0;
+	memset(_specialMoves, 0, sizeof(_specialMoves));
 	readQueenJas();
-	setupSpecialMoveTable();
 }
 
 Logic::~Logic() {
@@ -200,6 +200,7 @@
 }
 
 void Logic::start() {
+	setupSpecialMoveTable();
 	_vm->command()->clear(false);
 	_vm->display()->setupPanel();
 	_vm->graphics()->unpackControlBank();
@@ -419,17 +420,17 @@
 }
 
 const char *Logic::actorAnim(int num) const {
-	assert(num >= 1 && num < _numAAnim);
+	assert(num >= 1 && num <= _numAAnim);
 	return _jasStringList[_jasStringOffset[JSO_ACTOR_ANIM] + num - 1].c_str();
 }
 
 const char *Logic::actorName(int num) const {
-	assert(num >= 1 && num < _numAName);
+	assert(num >= 1 && num <= _numAName);
 	return _jasStringList[_jasStringOffset[JSO_ACTOR_NAME] + num - 1].c_str();
 }
 
 const char *Logic::actorFile(int num) const {
-	assert(num >= 1 && num < _numAFile);
+	assert(num >= 1 && num <= _numAFile);
 	return _jasStringList[_jasStringOffset[JSO_ACTOR_FILE] + num - 1].c_str();
 }
 
@@ -858,7 +859,7 @@
 }
 
 void Logic::inventorySetup() {
-	_vm->bankMan()->load("objects.BBK", 14);
+	_vm->bankMan()->load("OBJECTS.BBK", 14);
 	if (_vm->resource()->isInterview()) {
 		_inventoryItem[0] = 1;
 		_inventoryItem[1] = 2;
@@ -1346,15 +1347,15 @@
 	switch (gameState(VAR_JOE_DRESSING_MODE)) {
 	case 0:
 		_vm->display()->palSetJoeNormal();
-		loadJoeBanks("Joe_A.BBK", "Joe_B.BBK");
+		loadJoeBanks("JOE_A.BBK", "JOE_B.BBK");
 		break;
 	case 1:
 		_vm->display()->palSetJoeNormal();
-		loadJoeBanks("JoeU_A.BBK", "JoeU_B.BBK");
+		loadJoeBanks("JOEU_A.BBK", "JOEU_B.BBK");
 		break;
 	case 2:
 		_vm->display()->palSetJoeDress();
-		loadJoeBanks("JoeD_A.BBK", "JoeD_B.BBK");
+		loadJoeBanks("JOED_A.BBK", "JOED_B.BBK");
 		break;
 	}
 
@@ -1414,76 +1415,11 @@
 }
 
 void Logic::changeRoom() {
-	if (!preChangeRoom())
+	if (!changeToSpecialRoom())
 		displayRoom(currentRoom(), RDM_FADE_JOE, 100, 1, false);
 	_vm->display()->showMouseCursor(true);
 }
 
-void Logic::setupSpecialMoveTable() {
-	memset(_specialMoves, 0, sizeof(_specialMoves));
-	if (_vm->resource()->isDemo()) {
-		_specialMoves[4]  = &Logic::asmMakeJoeUseUnderwear;
-		_specialMoves[5]  = &Logic::asmSwitchToDressPalette;
-		_specialMoves[14] = &Logic::asmEndDemo;
-	} else if (_vm->resource()->isInterview()) {
-		_specialMoves[1]  = &Logic::asmInterviewIntro;
-		_specialMoves[2]  = &Logic::asmEndInterview;
-	} else {
-		_specialMoves[2]  = &Logic::asmMakeJoeUseDress;
-		_specialMoves[3]  = &Logic::asmMakeJoeUseNormalClothes;
-		_specialMoves[4]  = &Logic::asmMakeJoeUseUnderwear;
-		_specialMoves[5]  = &Logic::asmSwitchToDressPalette;
-		_specialMoves[6]  = &Logic::asmSwitchToNormalPalette;
-		_specialMoves[7]  = &Logic::asmStartCarAnimation;       // room 74
-		_specialMoves[8]  = &Logic::asmStopCarAnimation;        // room 74
-		_specialMoves[9]  = &Logic::asmStartFightAnimation;     // room 69
-		_specialMoves[10] = &Logic::asmWaitForFrankPosition;    // c69e.cut
-		_specialMoves[11] = &Logic::asmMakeFrankGrowing;        // c69z.cut
-		_specialMoves[12] = &Logic::asmMakeRobotGrowing;        // c69z.cut
-		_specialMoves[13] = &Logic::asmShrinkRobot;
-		_specialMoves[14] = &Logic::asmEndGame;
-		_specialMoves[15] = &Logic::asmPutCameraOnDino;
-		_specialMoves[16] = &Logic::asmPutCameraOnJoe;
-		_specialMoves[17] = &Logic::asmAltIntroPanRight;        // cintr.cut
-		_specialMoves[18] = &Logic::asmAltIntroPanLeft;         // cintr.cut
-		_specialMoves[19] = &Logic::asmSetAzuraInLove;
-		_specialMoves[20] = &Logic::asmPanRightFromJoe;
-		_specialMoves[21] = &Logic::asmSetLightsOff;
-		_specialMoves[22] = &Logic::asmSetLightsOn;
-		_specialMoves[23] = &Logic::asmSetManequinAreaOn;
-		_specialMoves[24] = &Logic::asmPanToJoe;
-		_specialMoves[25] = &Logic::asmTurnGuardOn;
-		_specialMoves[26] = &Logic::asmPanLeft320To144;
-		_specialMoves[27] = &Logic::asmSmooch;
-		_specialMoves[28] = &Logic::asmMakeLightningHitPlane;
-		_specialMoves[29] = &Logic::asmScaleBlimp;
-		_specialMoves[30] = &Logic::asmScaleEnding;
-		_specialMoves[31] = &Logic::asmWaitForCarPosition;
-		_specialMoves[32] = &Logic::asmShakeScreen;
-		_specialMoves[33] = &Logic::asmAttemptPuzzle;
-		_specialMoves[34] = &Logic::asmScaleTitle;
-		_specialMoves[36] = &Logic::asmPanRightToHugh;
-		_specialMoves[37] = &Logic::asmMakeWhiteFlash;
-		_specialMoves[38] = &Logic::asmPanRightToJoeAndRita;
-		_specialMoves[39] = &Logic::asmPanLeftToBomb;            // cdint.cut
-		if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
-			_specialMoves[5] = 0;
-			_specialMoves[6] = 0;
-			_specialMoves[13] = 0;
-			_specialMoves[17] = 0;
-			_specialMoves[18] = 0;
-			_specialMoves[27] = &Logic::asmSmoochNoScroll;
-			_specialMoves[32] = 0;
-			_specialMoves[34] = &Logic::asmScrollTitle;
-			_specialMoves[35] = 0;
-			_specialMoves[36] = 0;
-			_specialMoves[37] = 0;
-			_specialMoves[38] = 0;
-			_specialMoves[39] = 0;
-		}
-	}
-}
-
 void Logic::executeSpecialMove(uint16 sm) {
 	debug(6, "Special move: %d", sm);
 	if (sm < ARRAYSIZE(_specialMoves) && _specialMoves[sm] != 0) {
@@ -1605,7 +1541,7 @@
 	while (n--) {
 		_vm->update();
 	}
-	debug(0, "Game completed.");
+//	printf("Game completed.");
 	_vm->quitGame();
 }
 
@@ -2059,7 +1995,7 @@
 }
 
 void Logic::asmEndDemo() {
-	debug(0, "Flight of the Amazon Queen, released January 95.");
+//	printf("Flight of the Amazon Queen, released January 95.");
 	_vm->quitGame();
 }
 
@@ -2104,7 +2040,7 @@
 }
 
 void Logic::asmEndInterview() {
-	debug(0, "Interactive Interview copyright (c) 1995, IBI.");
+//	printf("Interactive Interview copyright (c) 1995, IBI.");
 	_vm->quitGame();
 }
 
@@ -2125,7 +2061,7 @@
 	makePersonSpeak("This is a demo, so I can't load or save games*14", NULL, "");
 }
 
-bool LogicDemo::preChangeRoom() {
+bool LogicDemo::changeToSpecialRoom() {
 	if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) {
 		currentRoom(79);
 		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
@@ -2142,11 +2078,19 @@
 	return false;
 }
 
+void LogicDemo::setupSpecialMoveTable() {
+	_specialMoves[4] = &LogicDemo::asmMakeJoeUseUnderwear;
+	_specialMoves[14] = &LogicDemo::asmEndDemo;
+	if (_vm->resource()->getPlatform() == Common::kPlatformPC) {
+		_specialMoves[5]  = &LogicDemo::asmSwitchToDressPalette;
+	}
+}
+
 void LogicInterview::useJournal() {
 	// no-op
 }
 
-bool LogicInterview::preChangeRoom() {
+bool LogicInterview::changeToSpecialRoom() {
 	if (currentRoom() == 2 && gameState(2) == 0) {
 		currentRoom(6);
 		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
@@ -2158,6 +2102,10 @@
 	return false;
 }
 
+void LogicInterview::setupSpecialMoveTable() {
+	_specialMoves[1] = &LogicInterview::asmInterviewIntro;
+	_specialMoves[2] = &LogicInterview::asmEndInterview;
+}
 
 void LogicGame::useJournal() {
 	_vm->command()->clear(false);
@@ -2165,7 +2113,7 @@
 	_vm->walk()->stopJoe();
 }
 
-bool LogicGame::preChangeRoom() {
+bool LogicGame::changeToSpecialRoom() {
 	if (currentRoom() == ROOM_JUNGLE_PINNACLE) {
 		handlePinnacleRoom();
 		return true;
@@ -2194,4 +2142,48 @@
 	return false;
 }
 
+void LogicGame::setupSpecialMoveTable() {
+	_specialMoves[2] = &LogicGame::asmMakeJoeUseDress;
+	_specialMoves[3] = &LogicGame::asmMakeJoeUseNormalClothes;
+	_specialMoves[4] = &LogicGame::asmMakeJoeUseUnderwear;
+	_specialMoves[7] = &LogicGame::asmStartCarAnimation;       // room 74
+	_specialMoves[8] = &LogicGame::asmStopCarAnimation;        // room 74
+	_specialMoves[9] = &LogicGame::asmStartFightAnimation;     // room 69
+	_specialMoves[10] = &LogicGame::asmWaitForFrankPosition;   // c69e.cut
+	_specialMoves[11] = &LogicGame::asmMakeFrankGrowing;       // c69z.cut
+	_specialMoves[12] = &LogicGame::asmMakeRobotGrowing;       // c69z.cut
+	_specialMoves[14] = &LogicGame::asmEndGame;
+	_specialMoves[15] = &LogicGame::asmPutCameraOnDino;
+	_specialMoves[16] = &LogicGame::asmPutCameraOnJoe;
+	_specialMoves[19] = &LogicGame::asmSetAzuraInLove;
+	_specialMoves[20] = &LogicGame::asmPanRightFromJoe;
+	_specialMoves[21] = &LogicGame::asmSetLightsOff;
+	_specialMoves[22] = &LogicGame::asmSetLightsOn;
+	_specialMoves[23] = &LogicGame::asmSetManequinAreaOn;
+	_specialMoves[24] = &LogicGame::asmPanToJoe;
+	_specialMoves[25] = &LogicGame::asmTurnGuardOn;
+	_specialMoves[26] = &LogicGame::asmPanLeft320To144;
+	_specialMoves[27] = &LogicGame::asmSmoochNoScroll;
+	_specialMoves[28] = &LogicGame::asmMakeLightningHitPlane;
+	_specialMoves[29] = &LogicGame::asmScaleBlimp;
+	_specialMoves[30] = &LogicGame::asmScaleEnding;
+	_specialMoves[31] = &LogicGame::asmWaitForCarPosition;
+	_specialMoves[32] = &LogicGame::asmShakeScreen;
+	_specialMoves[33] = &LogicGame::asmAttemptPuzzle;
+	_specialMoves[34] = &LogicGame::asmScrollTitle;
+	if (_vm->resource()->getPlatform() == Common::kPlatformPC) {
+		_specialMoves[5]  = &LogicGame::asmSwitchToDressPalette;
+		_specialMoves[6]  = &LogicGame::asmSwitchToNormalPalette;
+		_specialMoves[13] = &LogicGame::asmShrinkRobot;
+		_specialMoves[17] = &LogicGame::asmAltIntroPanRight;      // cintr.cut
+		_specialMoves[18] = &LogicGame::asmAltIntroPanLeft;       // cintr.cut
+		_specialMoves[27] = &LogicGame::asmSmooch;
+		_specialMoves[34] = &LogicGame::asmScaleTitle;
+		_specialMoves[36] = &LogicGame::asmPanRightToHugh;
+		_specialMoves[37] = &LogicGame::asmMakeWhiteFlash;
+		_specialMoves[38] = &LogicGame::asmPanRightToJoeAndRita;
+		_specialMoves[39] = &LogicGame::asmPanLeftToBomb;         // cdint.cut
+	}
+}
+
 } // End of namespace Queen

Modified: scummvm/trunk/engines/queen/logic.h
===================================================================
--- scummvm/trunk/engines/queen/logic.h	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/logic.h	2007-02-26 20:50:33 UTC (rev 25886)
@@ -60,8 +60,8 @@
 class QueenEngine;
 
 class Logic {
+public:
 
-public:
 	Logic(QueenEngine *vm);
 	virtual ~Logic();
 
@@ -221,8 +221,6 @@
 	//! enter the Journal (save/load, configuration)
 	virtual void useJournal() = 0;
 
-	void setupSpecialMoveTable();
-
 	//! execute a special move
 	void executeSpecialMove(uint16 sm);
 
@@ -287,7 +285,8 @@
 	void asmInterviewIntro();
 	void asmEndInterview();
 
-	virtual bool preChangeRoom() = 0;
+	virtual bool changeToSpecialRoom() = 0;
+	virtual void setupSpecialMoveTable() = 0;
 
 
 	uint16 _currentRoom;
@@ -380,7 +379,8 @@
 
 protected:
 
-	bool preChangeRoom();
+	bool changeToSpecialRoom();
+	void setupSpecialMoveTable();
 };
 
 class LogicInterview : public Logic {
@@ -391,7 +391,8 @@
 
 protected:
 
-	bool preChangeRoom();
+	bool changeToSpecialRoom();
+	void setupSpecialMoveTable();
 };
 
 class LogicGame : public Logic {
@@ -402,7 +403,8 @@
 
 protected:
 
-	bool preChangeRoom();
+	bool changeToSpecialRoom();
+	void setupSpecialMoveTable();
 };
 
 

Modified: scummvm/trunk/engines/queen/sound.cpp
===================================================================
--- scummvm/trunk/engines/queen/sound.cpp	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/sound.cpp	2007-02-26 20:50:33 UTC (rev 25886)
@@ -411,7 +411,7 @@
 	}
 
 	if (_lastOverride == song && _mixer->isSoundHandleActive(_modHandle)) {
-	  return;
+		return;
 	}
 	switch (song) {
 	// hotel
@@ -591,20 +591,7 @@
 }
 
 void AmigaSound::playRandomPatternJungle() {
-	static const uint16 patOffset[] = { 2, 1416, 2722, 2242, 11046, 11046 };
-	static const uint16 patSize[] = { 1056, 826, 8100, 8580, 15808, 15808 };
-	uint32 soundSize;
-	Common::File *f = _vm->resource()->findSound("JUNG.INS", &soundSize);
-	if (f) {
-		const int i = _rnd.getRandomNumber(5);
-		uint8 *soundData = (uint8 *)malloc(patSize[i]);
-		if (soundData) {
-			f->seek(patOffset[i], SEEK_CUR);
-			f->read(soundData, patSize[i]);
-			byte flags = Audio::Mixer::FLAG_AUTOFREE;
-			_mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, soundData, patSize[i], 9000, flags);
-		}
-	}
+	// XXX pickup a pattern (songData[4],songData[6]) between 5 and 11 from JUNG.SNG and play it
 }
 
 bool AmigaSound::playSpecialSfx(int16 sfx) {

Modified: scummvm/trunk/engines/queen/talk.cpp
===================================================================
--- scummvm/trunk/engines/queen/talk.cpp	2007-02-26 20:44:39 UTC (rev 25885)
+++ scummvm/trunk/engines/queen/talk.cpp	2007-02-26 20:50:33 UTC (rev 25886)
@@ -870,11 +870,11 @@
 	BobFrame *pbf = _vm->bankMan()->fetchFrame(bob->frameNum);
 
 	int height = (pbf->height * bob->scale) / 100;
-	
+
 	Common::Rect focus(textX - 96, textY - height - 64, textX + 96, textY + height + 64);
 	_vm->display()->setFocusRect(focus);
-	
 
+
 	//int SF = _vm->grid()->findScale(textX, textY);
 
 	const SpeechParameters *parameters = NULL;


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




More information about the Scummvm-git-logs mailing list