diff options
| author | Eugene Sandulenko | 2009-06-06 17:45:52 +0000 | 
|---|---|---|
| committer | Eugene Sandulenko | 2009-06-06 17:45:52 +0000 | 
| commit | 1a321a206471bd3e18cd5c2d5d1cc452c051a235 (patch) | |
| tree | dad892a2f900784d0e9f77b9d0bed15a39161c52 /engines | |
| parent | 2113060c43c4975f0c2960d32b3e580ae86bb7ec (diff) | |
| download | scummvm-rg350-1a321a206471bd3e18cd5c2d5d1cc452c051a235.tar.gz scummvm-rg350-1a321a206471bd3e18cd5c2d5d1cc452c051a235.tar.bz2 scummvm-rg350-1a321a206471bd3e18cd5c2d5d1cc452c051a235.zip  | |
Cleanup
svn-id: r41254
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/agi/agi.cpp | 52 | ||||
| -rw-r--r-- | engines/agi/agi.h | 46 | ||||
| -rw-r--r-- | engines/agi/checks.cpp | 4 | ||||
| -rw-r--r-- | engines/agi/console.cpp | 2 | ||||
| -rw-r--r-- | engines/agi/cycle.cpp | 11 | ||||
| -rw-r--r-- | engines/agi/detection.cpp | 10 | ||||
| -rw-r--r-- | engines/agi/graphics.cpp | 12 | ||||
| -rw-r--r-- | engines/agi/graphics.h | 3 | ||||
| -rw-r--r-- | engines/agi/id.cpp | 38 | ||||
| -rw-r--r-- | engines/agi/keyboard.cpp | 22 | ||||
| -rw-r--r-- | engines/agi/loader_v2.cpp | 15 | ||||
| -rw-r--r-- | engines/agi/loader_v3.cpp | 16 | ||||
| -rw-r--r-- | engines/agi/op_cmd.cpp | 10 | ||||
| -rw-r--r-- | engines/agi/preagi.cpp | 2 | ||||
| -rw-r--r-- | engines/agi/preagi.h | 7 | ||||
| -rw-r--r-- | engines/agi/predictive.cpp | 6 | ||||
| -rw-r--r-- | engines/agi/saveload.cpp | 2 | ||||
| -rw-r--r-- | engines/agi/text.cpp | 7 | ||||
| -rw-r--r-- | engines/agi/view.cpp | 4 | 
19 files changed, 82 insertions, 187 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 26e51f334f..7a4c489554 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -265,12 +265,7 @@ void AgiEngine::checkQuickLoad() {  	}  } -int AgiEngine::agiIsKeypressLow() { -	processEvents(); -	return _keyQueueStart != _keyQueueEnd; -} - -void AgiEngine::agiTimerLow() { +void AgiEngine::pollTimer(void) {  	static uint32 m = 0;  	uint32 dm; @@ -287,16 +282,28 @@ void AgiEngine::agiTimerLow() {  	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 AgiEngine::agiInit() {  	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 @@ int AgiEngine::agiInit() {  	// 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 @@ int AgiEngine::agiDetectGame() {  	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 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys  	_noSaveLoadAllowed = false;  	initFeatures(); +	initVersion();  }  AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { @@ -761,8 +757,6 @@ void AgiEngine::initialize() {  	_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 @@ Common::Error AgiEngine::go() {  		do {  			mainCycle();  		} while (_game.state < STATE_RUNNING); -		if (_game.ver < 0) -			_game.ver = 0;	// Enable conf file warning  	}  	runGame(); diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 962c75431e..6b52151a56 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -609,14 +609,10 @@ public:  	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 @@ public:  	AgiLoader_v2(AgiEngine *vm) {  		_vm = vm; -		_intVersion = 0;  	}  	virtual int init(); @@ -636,14 +631,10 @@ public:  	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 @@ public:  	AgiLoader_v3(AgiEngine *vm) {  		_vm = vm; -		_intVersion = 0;  	}  	virtual int init(); @@ -663,9 +653,6 @@ public:  	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 @@ public:  	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 @@ public:  	const AGIGameDescription *_gameDescription;  	uint32 _gameFeatures; +	uint16 _gameVersion;  	uint32 getGameID() const;  	uint32 getFeatures() const; @@ -762,6 +751,8 @@ public:  	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 @@ public:  	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 @@ public:  	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(); diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp index 481ce8d18d..afede0b836 100644 --- a/engines/agi/checks.cpp +++ b/engines/agi/checks.cpp @@ -41,7 +41,7 @@ int AgiEngine::checkPosition(VtEntry *v) {  	}  	// MH1 needs this, but it breaks LSL1 -	if (agiGetRelease() >= 0x3000) { +	if (getVersion() >= 0x3000) {  		if (v->yPos < v->ySize)  			return 0;  	} @@ -212,7 +212,7 @@ void AgiEngine::updatePosition() {  		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) { diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp index 37e9258136..d14a4a13bf 100644 --- a/engines/agi/console.cpp +++ b/engines/agi/console.cpp @@ -135,7 +135,7 @@ bool Console::Cmd_Crc(int argc, const char **argv) {  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; diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index b105082951..6f48f739ec 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -191,14 +191,9 @@ int AgiEngine::mainCycle() {  	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 AgiEngine::playGame() {  	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 @@ int AgiEngine::runGame() {  	// 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; diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index b730b825f6..f53e42017e 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -63,7 +63,7 @@ Common::Language AgiBase::getLanguage() const {  }  uint16 AgiBase::getVersion() const { -	return _gameDescription->version; +	return _gameVersion;  }  uint16 AgiBase::getGameType() const { @@ -82,6 +82,14 @@ void AgiBase::setFeature(uint32 feature) {  	_gameFeatures |= feature;  } +void AgiBase::setVersion(uint16 version) { +	_gameVersion = version; +} + +void AgiBase::initVersion(void) { +	_gameVersion = _gameDescription->version; +} +  }  static const PlainGameDescriptor agiGames[] = { diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index d3f381a397..ad2c264184 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -790,18 +790,6 @@ void GfxMgr::putScreen() {  	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   */ diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h index ac59137c07..05e59c8851 100644 --- a/engines/agi/graphics.h +++ b/engines/agi/graphics.h @@ -95,10 +95,7 @@ public:  	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();  }; diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 0f53fd44db..a3ab335441 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -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 @@ int AgiEngine::v2IdGame() {  // 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::setupV2Game(int ver, uint32 crc) {  /**   *   */ -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. diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index bc30224918..d1370f3c02 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -94,8 +94,8 @@ int AgiEngine::doPollKeyboard() {  	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 @@ int AgiEngine::handleController(int key) {  	// 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 @@ void AgiEngine::handleKeys(int key) {  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::waitKey() {  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; diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index fd875b7fbc..4ad1c6bf93 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -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 @@ int AgiLoader_v2::detectGame() {  			!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) { diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp index 81e81bed24..9f38a05775 100644 --- a/engines/agi/loader_v3.cpp +++ b/engines/agi/loader_v3.cpp @@ -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,8 +52,8 @@ int AgiLoader_v3::detectGame() {  			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;  		} diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index ed3d4dc07c..5c04eb3c84 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -844,7 +844,7 @@ cmd(draw) {  	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 @@ cmd(move_obj) {  		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 @@ cmd(move_obj_f) {  		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 @@ cmd(version) {  	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 @@ int AgiEngine::runLogic(int n) {  			// 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;  			} diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index f1bc27ac00..f012426727 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -134,8 +134,6 @@ void PreAgiEngine::initialize() {  	//_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 diff --git a/engines/agi/preagi.h b/engines/agi/preagi.h index d7a1101c68..a134955d86 100644 --- a/engines/agi/preagi.h +++ b/engines/agi/preagi.h @@ -41,9 +41,10 @@ protected:  	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(); diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index ae8bc98ac9..c2f031ea75 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -176,9 +176,7 @@ bool AgiEngine::predictiveDialog(void) {  		}  	} -	// clear key queue -	while (_gfx->keypress()) -		_gfx->getKey(); +	clearKeyQueue();  	prefix.clear();  	_currentCode.clear(); @@ -234,7 +232,7 @@ bool AgiEngine::predictiveDialog(void) {  			_gfx->doUpdate();  		} -		_gfx->pollTimer();	// msdos driver -> does nothing +		pollTimer();  		key = doPollKeyboard();  		processkey = false;  		switch (key) { diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 94680cf3b5..72addd15c9 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -639,7 +639,7 @@ int AgiEngine::selectSlot() {  			oldFirstSlot = _firstSlot;  		} -		_gfx->pollTimer();	// msdos driver -> does nothing +		pollTimer();  		key = doPollKeyboard();  		// It may happen that somebody will open GMM while diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index d8ac1f3374..04af531809 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -371,10 +371,7 @@ int AgiEngine::selectionBox(const char *m, const char **b) {  	_sprites->blitBoth(); -	// clear key queue -	while (_gfx->keypress()) { -		_gfx->getKey(); -	} +	clearKeyQueue();  	AllowSyntheticEvents on(this); @@ -383,7 +380,7 @@ int AgiEngine::selectionBox(const char *m, const char **b) {  		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: diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp index 69b8d82f58..fb417e86a9 100644 --- a/engines/agi/view.cpp +++ b/engines/agi/view.cpp @@ -393,7 +393,7 @@ void AgiEngine::updateViewtable() {  				break;  			default:  				// for KQ4 -				if (agiGetRelease() == 0x3086) +				if (getVersion() == 0x3086)  					loop = loopTable4[v->direction];  				break;  			} @@ -401,7 +401,7 @@ void AgiEngine::updateViewtable() {  		// 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);  			}  | 
