[Scummvm-cvs-logs] SF.net SVN: scummvm:[41254] scummvm/trunk/engines/agi

sev at users.sourceforge.net sev at users.sourceforge.net
Sat Jun 6 19:45:52 CEST 2009


Revision: 41254
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41254&view=rev
Author:   sev
Date:     2009-06-06 17:45:52 +0000 (Sat, 06 Jun 2009)

Log Message:
-----------
Cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/checks.cpp
    scummvm/trunk/engines/agi/console.cpp
    scummvm/trunk/engines/agi/cycle.cpp
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agi/graphics.cpp
    scummvm/trunk/engines/agi/graphics.h
    scummvm/trunk/engines/agi/id.cpp
    scummvm/trunk/engines/agi/keyboard.cpp
    scummvm/trunk/engines/agi/loader_v2.cpp
    scummvm/trunk/engines/agi/loader_v3.cpp
    scummvm/trunk/engines/agi/op_cmd.cpp
    scummvm/trunk/engines/agi/preagi.cpp
    scummvm/trunk/engines/agi/preagi.h
    scummvm/trunk/engines/agi/predictive.cpp
    scummvm/trunk/engines/agi/saveload.cpp
    scummvm/trunk/engines/agi/text.cpp
    scummvm/trunk/engines/agi/view.cpp

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/agi.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -265,12 +265,7 @@
 	}
 }
 
-int AgiEngine::agiIsKeypressLow() {
-	processEvents();
-	return _keyQueueStart != _keyQueueEnd;
-}
-
-void AgiEngine::agiTimerLow() {
+void AgiEngine::pollTimer(void) {
 	static uint32 m = 0;
 	uint32 dm;
 
@@ -287,16 +282,28 @@
 	m = g_tickTimer;
 }
 
-int AgiEngine::agiGetKeypressLow() {
+bool AgiEngine::isKeypress(void) {
+	processEvents();
+	return _keyQueueStart != _keyQueueEnd;
+}
+
+int AgiEngine::getKeypress(void) {
 	int k;
 
 	while (_keyQueueStart == _keyQueueEnd)	// block
-		agiTimerLow();
+		pollTimer();
+
 	keyDequeue(k);
 
 	return k;
 }
 
+void AgiEngine::clearKeyQueue(void) {
+	while (isKeypress()) {
+		getKeypress();
+	}
+}
+
 void AgiEngine::agiTimerFunctionLow(void *refCon) {
 	g_tickTimer++;
 }
@@ -368,7 +375,7 @@
 	int ec, i;
 
 	debug(2, "initializing");
-	debug(2, "game.ver = 0x%x", _game.ver);
+	debug(2, "game version = 0x%x", getVersion());
 
 	// initialize with adj.ego.move.to.x.y(0, 0) so to speak
 	_game.adjMouseX = _game.adjMouseY = 0;
@@ -408,16 +415,16 @@
 
 	// setup emulation
 
-	switch (_loader->getIntVersion() >> 12) {
+	switch (getVersion() >> 12) {
 	case 2:
 		report("Emulating Sierra AGI v%x.%03x\n",
-				(int)(agiGetRelease() >> 12) & 0xF,
-				(int)(agiGetRelease()) & 0xFFF);
+				(int)(getVersion() >> 12) & 0xF,
+				(int)(getVersion()) & 0xFFF);
 		break;
 	case 3:
 		report("Emulating Sierra AGI v%x.002.%03x\n",
-				(int)(agiGetRelease() >> 12) & 0xF,
-				(int)(agiGetRelease()) & 0xFFF);
+				(int)(getVersion() >> 12) & 0xF,
+				(int)(getVersion()) & 0xFFF);
 		break;
 	}
 
@@ -510,18 +517,6 @@
 	return ec;
 }
 
-int AgiEngine::agiVersion() {
-	return _loader->version();
-}
-
-int AgiEngine::agiGetRelease() {
-	return _loader->getIntVersion();
-}
-
-void AgiEngine::agiSetRelease(int n) {
-	_loader->setIntVersion(n);
-}
-
 int AgiEngine::agiLoadResource(int r, int n) {
 	int i;
 
@@ -629,6 +624,7 @@
 	_noSaveLoadAllowed = false;
 
 	initFeatures();
+	initVersion();
 }
 
 AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
@@ -761,8 +757,6 @@
 
 	_timer->installTimerProc(agiTimerFunctionLow, 10 * 1000, NULL);
 
-	_game.ver = -1;		// Don't display the conf file warning
-
 	debugC(2, kDebugLevelMain, "Detect game");
 
 
@@ -821,8 +815,6 @@
 		do {
 			mainCycle();
 		} while (_game.state < STATE_RUNNING);
-		if (_game.ver < 0)
-			_game.ver = 0;	// Enable conf file warning
 	}
 
 	runGame();

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/agi.h	2009-06-06 17:45:52 UTC (rev 41254)
@@ -609,14 +609,10 @@
 	virtual int unloadResource(int, int) = 0;
 	virtual int loadObjects(const char *) = 0;
 	virtual int loadWords(const char *) = 0;
-	virtual int version() = 0;
-	virtual void setIntVersion(int) = 0;
-	virtual int getIntVersion() = 0;
 };
 
 class AgiLoader_v2 : public AgiLoader {
 private:
-	int _intVersion;
 	AgiEngine *_vm;
 
 	int loadDir(AgiDir *agid, const char *fname);
@@ -626,7 +622,6 @@
 
 	AgiLoader_v2(AgiEngine *vm) {
 		_vm = vm;
-		_intVersion = 0;
 	}
 
 	virtual int init();
@@ -636,14 +631,10 @@
 	virtual int unloadResource(int, int);
 	virtual int loadObjects(const char *);
 	virtual int loadWords(const char *);
-	virtual int version();
-	virtual void setIntVersion(int);
-	virtual int getIntVersion();
 };
 
 class AgiLoader_v3 : public AgiLoader {
 private:
-	int _intVersion;
 	AgiEngine *_vm;
 
 	int loadDir(AgiDir *agid, Common::File *fp, uint32 offs, uint32 len);
@@ -653,7 +644,6 @@
 
 	AgiLoader_v3(AgiEngine *vm) {
 		_vm = vm;
-		_intVersion = 0;
 	}
 
 	virtual int init();
@@ -663,9 +653,6 @@
 	virtual int unloadResource(int, int);
 	virtual int loadObjects(const char *);
 	virtual int loadWords(const char *);
-	virtual int version();
-	virtual void setIntVersion(int);
-	virtual int getIntVersion();
 };
 
 class GfxMgr;
@@ -728,9 +715,10 @@
 
 	bool _noSaveLoadAllowed;
 
-	virtual void agiTimerLow() = 0;
-	virtual int agiGetKeypressLow() = 0;
-	virtual int agiIsKeypressLow() = 0;
+	virtual void pollTimer(void) = 0;
+	virtual int getKeypress(void) = 0;
+	virtual bool isKeypress(void) = 0;
+	virtual void clearKeyQueue(void) = 0;
 
 	AgiBase(OSystem *syst, const AGIGameDescription *gameDesc);
 
@@ -752,6 +740,7 @@
 	const AGIGameDescription *_gameDescription;
 
 	uint32 _gameFeatures;
+	uint16 _gameVersion;
 
 	uint32 getGameID() const;
 	uint32 getFeatures() const;
@@ -762,6 +751,8 @@
 	const char *getGameMD5() const;
 	void initFeatures(void);
 	void setFeature(uint32 feature);
+	void initVersion(void);
+	void setVersion(uint16 version);
 
 	Common::Error loadGameState(int slot);
 	Common::Error saveGameState(int slot, const char *desc);
@@ -849,17 +840,16 @@
 
 	int agiInit();
 	int agiDeinit();
-	int agiVersion();
-	int agiGetRelease();
-	void agiSetRelease(int);
 	int agiDetectGame();
 	int agiLoadResource(int, int);
 	int agiUnloadResource(int, int);
 	void agiUnloadResources();
 
-	virtual void agiTimerLow();
-	virtual int agiGetKeypressLow();
-	virtual int agiIsKeypressLow();
+	virtual void pollTimer(void);
+	virtual int getKeypress(void);
+	virtual bool isKeypress(void);
+	virtual void clearKeyQueue(void);
+
 	static void agiTimerFunctionLow(void *refCon);
 	void initPriTable();
 
@@ -868,23 +858,17 @@
 
 	int getvar(int);
 	void setvar(int, int);
-	void decrypt(uint8 * mem, int len);
+	void decrypt(uint8 *mem, int len);
 	void releaseSprites();
 	int mainCycle();
 	int viewPictures();
-	int parseCli(int, char **);
 	int runGame();
 	void inventory();
-	void listGames();
-	uint32 matchCrc(uint32, char *, int);
-	int v2IdGame();
-	int v3IdGame();
-	int v4IdGame(uint32 ver);
 	void updateTimer();
 	int getAppDir(char *appDir, unsigned int size);
 
-	int setupV2Game(int ver, uint32 crc);
-	int setupV3Game(int ver, uint32 crc);
+	int setupV2Game(int ver);
+	int setupV3Game(int ver);
 
 	void newRoom(int n);
 	void resetControllers();

Modified: scummvm/trunk/engines/agi/checks.cpp
===================================================================
--- scummvm/trunk/engines/agi/checks.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/checks.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -41,7 +41,7 @@
 	}
 
 	// MH1 needs this, but it breaks LSL1
-	if (agiGetRelease() >= 0x3000) {
+	if (getVersion() >= 0x3000) {
 		if (v->yPos < v->ySize)
 			return 0;
 	}
@@ -212,7 +212,7 @@
 		if (x < 0) {
 			x = 0;
 			border = 4;
-		} else if (x <= 0 && agiGetRelease() == 0x3086) {	// KQ4
+		} else if (x <= 0 && getVersion() == 0x3086) {	// KQ4
 			x = 0;	// See Sarien bug #590462
 			border = 4;
 		} else if (v->entry == 0 && x == 0 && v->flags & ADJ_EGO_XY) {

Modified: scummvm/trunk/engines/agi/console.cpp
===================================================================
--- scummvm/trunk/engines/agi/console.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/console.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -135,7 +135,7 @@
 bool Console::Cmd_Agiver(int argc, const char **argv) {
 	int ver, maj, min;
 
-	ver = _vm->agiGetRelease();
+	ver = _vm->getVersion();
 	maj = (ver >> 12) & 0xf;
 	min = ver & 0xfff;
 

Modified: scummvm/trunk/engines/agi/cycle.cpp
===================================================================
--- scummvm/trunk/engines/agi/cycle.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/cycle.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -191,14 +191,9 @@
 	unsigned int key, kascii;
 	VtEntry *v = &_game.viewTable[0];
 
-	_gfx->pollTimer();		// msdos driver -> does nothing
+	pollTimer();
 	updateTimer();
 
-	if (_game.ver == 0) {
-		messageBox("Warning: game CRC not listed, assuming AGI version 2.917.");
-		_game.ver = -1;
-	}
-
 	key = doPollKeyboard();
 
 	// In AGI Mouse emulation mode we must update the mouse-related
@@ -300,7 +295,7 @@
 	int ec = errOK;
 
 	debugC(2, kDebugLevelMain, "initializing...");
-	debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver);
+	debugC(2, kDebugLevelMain, "game version = 0x%x", getVersion());
 
 	_sound->stopSound();
 	_gfx->clearScreen(0);
@@ -382,7 +377,7 @@
 	// Execute the game
 	do {
 		debugC(2, kDebugLevelMain, "game loop");
-		debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver);
+		debugC(2, kDebugLevelMain, "game version = 0x%x", getVersion());
 
 		if (agiInit() != errOK)
 			break;

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/detection.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -63,7 +63,7 @@
 }
 
 uint16 AgiBase::getVersion() const {
-	return _gameDescription->version;
+	return _gameVersion;
 }
 
 uint16 AgiBase::getGameType() const {
@@ -82,8 +82,16 @@
 	_gameFeatures |= feature;
 }
 
+void AgiBase::setVersion(uint16 version) {
+	_gameVersion = version;
 }
 
+void AgiBase::initVersion(void) {
+	_gameVersion = _gameDescription->version;
+}
+
+}
+
 static const PlainGameDescriptor agiGames[] = {
 	{"agi", "Sierra AGI game"},
 	{"agi-fanmade", "Fanmade AGI game"},

Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/graphics.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -790,18 +790,6 @@
 	putBlock(0, 0, GFX_WIDTH - 1, GFX_HEIGHT - 1);
 }
 
-void GfxMgr::pollTimer() {
-	_vm->agiTimerLow();
-}
-
-int GfxMgr::getKey() {
-	return _vm->agiGetKeypressLow();
-}
-
-int GfxMgr::keypress() {
-	return _vm->agiIsKeypressLow();
-}
-
 /*
  * Public functions
  */

Modified: scummvm/trunk/engines/agi/graphics.h
===================================================================
--- scummvm/trunk/engines/agi/graphics.h	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/graphics.h	2009-06-06 17:45:52 UTC (rev 41254)
@@ -95,10 +95,7 @@
 	void setCursor(bool amigaStyleCursor = false, bool busy = false);
 	void setCursorPalette(bool amigaStylePalette = false);
 
-	int keypress();
-	int getKey();
 	void printCharacter(int, int, char, int, int);
-	void pollTimer();
 	int initMachine();
 	int deinitMachine();
 };

Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/id.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -30,17 +30,6 @@
 
 namespace Agi {
 
-int AgiEngine::v2IdGame() {
-	int ver;
-
-	ver = getVersion();
-	_game.ver = ver;
-	debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver);
-	agiSetRelease(ver);
-
-	return setupV2Game(ver, 0);
-}
-
 //
 // Currently, there is no known difference between v3.002.098 -> v3.002.149
 // So version emulated;
@@ -49,32 +38,16 @@
 // 0x0149
 //
 
-int AgiEngine::v3IdGame() {
-	int ver;
-
-	ver = getVersion();
-	_game.ver = ver;
-	debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver);
-	agiSetRelease(ver);
-
-	return setupV3Game(ver, 0);
-}
-
 /**
  *
  */
-int AgiEngine::setupV2Game(int ver, uint32 crc) {
+int AgiEngine::setupV2Game(int ver) {
 	int ec = errOK;
 
-	if (ver == 0) {
-		report("Unknown v2 Sierra game: %08x\n\n", crc);
-		agiSetRelease(ver = 0x2917);
-	}
-
 	// Should this go above the previous lines, so we can force emulation versions
 	// even for AGDS games? -- dsymonds
 	if (getFeatures() & GF_AGDS)
-		agiSetRelease(ver = 0x2440);	// ALL AGDS games built for 2.440
+		setVersion(ver = 0x2440);	// ALL AGDS games built for 2.440
 
 	report("Setting up for version 0x%04X\n", ver);
 
@@ -96,14 +69,9 @@
 /**
  *
  */
-int AgiEngine::setupV3Game(int ver, uint32 crc) {
+int AgiEngine::setupV3Game(int ver) {
 	int ec = errOK;
 
-	if (ver == 0) {
-		report("Unknown v3 Sierra game: %08x\n\n", crc);
-		agiSetRelease(ver = 0x3149);
-	}
-
 	report("Setting up for version 0x%04X\n", ver);
 
 	// 'unknown176' takes 1 arg for 3.002.086, not 0 args.

Modified: scummvm/trunk/engines/agi/keyboard.cpp
===================================================================
--- scummvm/trunk/engines/agi/keyboard.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/keyboard.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -94,8 +94,8 @@
 	int key = 0;
 
 	// If a key is ready, rip it
-	if (_gfx->keypress()) {
-		key = _gfx->getKey();
+	if (isKeypress()) {
+		key = getKeypress();
 
 		debugC(3, kDebugLevelInput, "key %02x pressed", key);
 	}
@@ -110,7 +110,7 @@
 	// AGI 3.149 games and The Black Cauldron need KEY_ESCAPE to use menus
 	// Games with the GF_ESCPAUSE flag need KEY_ESCAPE to pause the game
 	if (key == 0 ||
-		(key == KEY_ESCAPE && agiGetRelease() != 0x3149 && getGameID() != GID_BC && !(getFeatures() & GF_ESCPAUSE)) )
+		(key == KEY_ESCAPE && getVersion() != 0x3149 && getGameID() != GID_BC && !(getFeatures() & GF_ESCPAUSE)) )
 		return false;
 
 	if ((getGameID() == GID_MH1 || getGameID() == GID_MH2) && (key == KEY_ENTER) &&
@@ -379,19 +379,16 @@
 int AgiEngine::waitKey() {
 	int key = 0;
 
-	// clear key queue
-	while (_gfx->keypress()) {
-		_gfx->getKey();
-	}
+	clearKeyQueue();
 
 	debugC(3, kDebugLevelInput, "waiting...");
 	while (!(shouldQuit() || _restartGame || getflag(fRestoreJustRan))) {
-		_gfx->pollTimer();	// msdos driver -> does nothing
+		pollTimer();
 		key = doPollKeyboard();
 		if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT)
 			break;
 
-		_gfx->pollTimer();
+		pollTimer();
 		updateTimer();
 
 		_gfx->doUpdate();
@@ -402,14 +399,11 @@
 int AgiEngine::waitAnyKey() {
 	int key = 0;
 
-	// clear key queue
-	while (_gfx->keypress()) {
-		_gfx->getKey();
-	}
+	clearKeyQueue();
 
 	debugC(3, kDebugLevelInput, "waiting... (any key)");
 	while (!(shouldQuit() || _restartGame)) {
-		_gfx->pollTimer();	// msdos driver -> does nothing
+		pollTimer();
 		key = doPollKeyboard();
 		if (key)
 			break;

Modified: scummvm/trunk/engines/agi/loader_v2.cpp
===================================================================
--- scummvm/trunk/engines/agi/loader_v2.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/loader_v2.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -29,18 +29,6 @@
 
 namespace Agi {
 
-int AgiLoader_v2::version() {
-	return 2;
-}
-
-void AgiLoader_v2::setIntVersion(int ver) {
-	_intVersion = ver;
-}
-
-int AgiLoader_v2::getIntVersion() {
-	return _intVersion;
-}
-
 int AgiLoader_v2::detectGame() {
 	if (!Common::File::exists(LOGDIR) ||
 			!Common::File::exists(PICDIR) ||
@@ -48,8 +36,7 @@
 			!Common::File::exists(VIEWDIR))
 		return errInvalidAGIFile;
 
-	_intVersion = 0x2917;	// setup for 2.917
-	return _vm->v2IdGame();
+	return _vm->setupV2Game(_vm->getVersion());
 }
 
 int AgiLoader_v2::loadDir(AgiDir *agid, const char *fname) {

Modified: scummvm/trunk/engines/agi/loader_v3.cpp
===================================================================
--- scummvm/trunk/engines/agi/loader_v3.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/loader_v3.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -31,18 +31,6 @@
 
 namespace Agi {
 
-int AgiLoader_v3::version() {
-	return 3;
-}
-
-void AgiLoader_v3::setIntVersion(int ver) {
-	_intVersion = ver;
-}
-
-int AgiLoader_v3::getIntVersion() {
-	return _intVersion;
-}
-
 int AgiLoader_v3::detectGame() {
 	int ec = errUnk;
 	bool found = false;
@@ -64,9 +52,9 @@
 			memset(_vm->_game.name, 0, 8);
 			strncpy(_vm->_game.name, f.c_str(), MIN((uint)8, f.size() > 5 ? f.size() - 5 : f.size()));
 			debugC(3, kDebugLevelMain, "game.name = %s", _vm->_game.name);
-			_intVersion = 0x3149;	// setup for 3.002.149
-			ec = _vm->v3IdGame();
 
+			ec = _vm->setupV3Game(_vm->getVersion());
+
 			found = true;
 		}
 	}

Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/op_cmd.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -844,7 +844,7 @@
 	debugC(4, kDebugLevelScripts, "draw entry %d", vt.entry);
 
 	vt.flags |= UPDATE;
-	if (g_agi->agiGetRelease() >= 0x3000) {
+	if (g_agi->getVersion() >= 0x3000) {
 		g_agi->setLoop(&vt, vt.currentLoop);
 		g_agi->setCel(&vt, vt.currentCel);
 	}
@@ -1067,7 +1067,7 @@
 		game.playerControl = false;
 
 	// AGI 2.272 (ddp, xmas) doesn't call move_obj!
-	if (g_agi->agiGetRelease() > 0x2272)
+	if (g_agi->getVersion() > 0x2272)
 		g_agi->moveObj(&vt);
 }
 
@@ -1088,7 +1088,7 @@
 		game.playerControl = false;
 
 	// AGI 2.272 (ddp, xmas) doesn't call move_obj!
-	if (g_agi->agiGetRelease() > 0x2272)
+	if (g_agi->getVersion() > 0x2272)
 		g_agi->moveObj(&vt);
 }
 
@@ -1160,7 +1160,7 @@
 
 	sprintf(verMsg, TITLE " v%s", gScummVMVersion);
 
-	ver = g_agi->agiGetRelease();
+	ver = g_agi->getVersion();
 	maj = (ver >> 12) & 0xf;
 	min = ver & 0xfff;
 
@@ -1811,7 +1811,7 @@
 			// timer must keep running even in goto loops,
 			// but AGI engine can't do that :(
 			if (timerHack > 20) {
-				g_gfx->pollTimer();
+				pollTimer();
 				updateTimer();
 				timerHack = 0;
 			}

Modified: scummvm/trunk/engines/agi/preagi.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/preagi.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -134,8 +134,6 @@
 
 	//_timer->installTimerProc(agiTimerFunctionLow, 10 * 1000, NULL);
 
-	_game.ver = -1;		// Don't display the conf file warning
-
 	debugC(2, kDebugLevelMain, "Detect game");
 
 	// clear all resources and events

Modified: scummvm/trunk/engines/agi/preagi.h
===================================================================
--- scummvm/trunk/engines/agi/preagi.h	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/preagi.h	2009-06-06 17:45:52 UTC (rev 41254)
@@ -41,9 +41,10 @@
 	void initialize();
 
 public:
-	void agiTimerLow() {}
-	int agiGetKeypressLow() { return 0; }
-	int agiIsKeypressLow() { return 0; }
+	void pollTimer(void) {}
+	int getKeypress(void) { return 0; }
+	bool isKeypress(void) { return false; }
+	void clearKeyQueue(void) {}
 
 	PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
 	virtual ~PreAgiEngine();

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/predictive.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -176,9 +176,7 @@
 		}
 	}
 
-	// clear key queue
-	while (_gfx->keypress())
-		_gfx->getKey();
+	clearKeyQueue();
 
 	prefix.clear();
 	_currentCode.clear();
@@ -234,7 +232,7 @@
 			_gfx->doUpdate();
 		}
 
-		_gfx->pollTimer();	// msdos driver -> does nothing
+		pollTimer();
 		key = doPollKeyboard();
 		processkey = false;
 		switch (key) {

Modified: scummvm/trunk/engines/agi/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agi/saveload.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/saveload.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -639,7 +639,7 @@
 			oldFirstSlot = _firstSlot;
 		}
 
-		_gfx->pollTimer();	// msdos driver -> does nothing
+		pollTimer();
 		key = doPollKeyboard();
 
 		// It may happen that somebody will open GMM while

Modified: scummvm/trunk/engines/agi/text.cpp
===================================================================
--- scummvm/trunk/engines/agi/text.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/text.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -371,10 +371,7 @@
 
 	_sprites->blitBoth();
 
-	// clear key queue
-	while (_gfx->keypress()) {
-		_gfx->getKey();
-	}
+	clearKeyQueue();
 
 	AllowSyntheticEvents on(this);
 
@@ -383,7 +380,7 @@
 		for (i = 0; b[i]; i++)
 			_gfx->drawCurrentStyleButton(bx[i], by[i], b[i], i == active, false, i == 0);
 
-		_gfx->pollTimer();	// msdos driver -> does nothing
+		pollTimer();
 		key = doPollKeyboard();
 		switch (key) {
 		case KEY_ENTER:

Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp	2009-06-06 17:45:06 UTC (rev 41253)
+++ scummvm/trunk/engines/agi/view.cpp	2009-06-06 17:45:52 UTC (rev 41254)
@@ -393,7 +393,7 @@
 				break;
 			default:
 				// for KQ4
-				if (agiGetRelease() == 0x3086)
+				if (getVersion() == 0x3086)
 					loop = loopTable4[v->direction];
 				break;
 			}
@@ -401,7 +401,7 @@
 
 		// AGI 2.272 (ddp, xmas) doesn't test step_time_count!
 		if (loop != 4 && loop != v->currentLoop) {
-			if (agiGetRelease() <= 0x2272 ||
+			if (getVersion() <= 0x2272 ||
 			    v->stepTimeCount == 1) {
 				setLoop(v, loop);
 			}


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