From 5dc8bb627a2551b351429ff2f9d8de77cd655d4d Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Fri, 3 Jun 2011 07:53:18 +0200 Subject: LASTEXPRESS: Remove unused variables. --- engines/lastexpress/game/sound.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/lastexpress') diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 63efd182a8..3f98ac79ea 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -699,7 +699,6 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, FlagType flag } void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { - char filename[12]; int values[5]; if (getEntityData(entity)->car != getEntityData(kEntityPlayer)->car) @@ -842,7 +841,6 @@ void SoundManager::playSteam(CityIndex index) { void SoundManager::playFightSound(byte action, byte a4) { int _action = (int)action; - char filename[12]; int values[5]; switch (action) { -- cgit v1.2.3 From aec2ea966183950189d0f5db4c447aa332fc4ae3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 3 Jun 2011 18:21:58 +0200 Subject: ENGINES: Remove some uses of g_engine --- engines/lastexpress/data/animation.cpp | 13 +++++++------ engines/lastexpress/debug.cpp | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'engines/lastexpress') diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 8ce73993c3..1cbf7672d1 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -94,7 +94,7 @@ bool Animation::load(Common::SeekableReadStream *stream, int flag) { } _currentChunk = _chunks.begin(); _changed = false; - _startTime = g_engine->_system->getMillis(); + _startTime = g_system->getMillis(); return true; } @@ -110,7 +110,7 @@ bool Animation::process() { // - Re-implement to be closer to the original engine // - Add support for subtitles // - Use engine sound queue instead of our own appendable sound instance - int32 currentFrame = (g_engine->_system->getMillis() - _startTime) * 3 / 100; + int32 currentFrame = (g_system->getMillis() - _startTime) * 3 / 100; // Process all chunks until the current frame while (!_changed && _currentChunk != NULL && currentFrame > _currentChunk->frame && !hasEnded()) { @@ -180,7 +180,7 @@ bool Animation::process() { // Synchronize the audio by resetting the start time if (_currentChunk->frame == 0) - _startTime = g_engine->_system->getMillis(); + _startTime = g_system->getMillis(); break; case kChunkTypeAudioEnd: @@ -260,7 +260,8 @@ void Animation::processChunkAudio(Common::SeekableReadStream *in, const Chunk &c // TODO: this method will probably go away and be integrated in the main loop void Animation::play() { - while (!hasEnded() && !g_engine->getEventManager()->shouldQuit() && !g_engine->getEventManager()->shouldRTL()) { + Common::EventManager *eventMan = g_system->getEventManager(); + while (!hasEnded() && !Engine::shouldQuit()) { process(); if (_changed) { @@ -283,11 +284,11 @@ void Animation::play() { g_system->updateScreen(); //FIXME: implement subtitles - g_engine->_system->delayMillis(20); + g_system->delayMillis(20); // Handle right-click to interrupt animations Common::Event ev = Common::Event(); - while (g_engine->getEventManager()->pollEvent(ev)) { + while (eventMan->pollEvent(ev)) { if (ev.type == Common::EVENT_RBUTTONUP) { // Stop audio if (_audio) diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index e1bd9494a9..4b7c5f6a9a 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -865,7 +865,7 @@ bool Debugger::cmdBeetle(int argc, const char **argv) { askForRedraw(); redrawScreen(); - while (g_engine->getEventManager()->pollEvent(ev)) { + while (g_system->getEventManager()->pollEvent(ev)) { switch (ev.type) { default: -- cgit v1.2.3 From 4827cc914a128b956d88ea3eae66d8866d9cd40e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 00:30:48 +0200 Subject: ENGINES: Change incorrect use of 'target' to 'gameid' --- engines/lastexpress/detection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/lastexpress') diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index 7c7c6b0a36..e85ec41420 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -183,9 +183,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid lastExpressGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "lastexpress", -- cgit v1.2.3 From 2bbaf0339e0f9ac4f592b1f9c414516057859015 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:53 +0200 Subject: LASTEXPRESS: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/lastexpress/detection.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'engines/lastexpress') diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index e85ec41420..d8b98bbbf2 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -176,35 +176,13 @@ static const ADGameDescription gameDescriptions[] = { AD_TABLE_END_MARKER }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)gameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - lastExpressGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "lastexpress", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class LastExpressMetaEngine : public AdvancedMetaEngine { public: - LastExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {} + LastExpressMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), lastExpressGames) { + params.singleid = "lastexpress"; + params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + } const char *getName() const { return "Lastexpress"; -- cgit v1.2.3 From 8878be7b11e48541666a9a42a3d72122ad7c99f5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 20:19:18 +0200 Subject: LASTEXPRESS: Reduce header dependencies --- engines/lastexpress/detection.cpp | 5 +++++ engines/lastexpress/lastexpress.cpp | 2 ++ engines/lastexpress/lastexpress.h | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/lastexpress') diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index d8b98bbbf2..bf575b63f8 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -21,6 +21,7 @@ */ #include "lastexpress/lastexpress.h" +#include "engines/advancedDetector.h" namespace LastExpress { @@ -202,6 +203,10 @@ bool LastExpressMetaEngine::createInstance(OSystem *syst, Engine **engine, const return gd != 0; } +bool LastExpressEngine::isDemo() const { + return (bool)(_gameDescription->flags & ADGF_DEMO); +} + } // End of namespace LastExpress #if PLUGIN_ENABLED_DYNAMIC(LASTEXPRESS) diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 6fdd18413b..e162998719 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -37,6 +37,8 @@ #include "common/config-manager.h" #include "common/debug-channels.h" +#include "common/error.h" +#include "common/fs.h" #include "engines/util.h" diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h index d78bba36f0..f8f38788a0 100644 --- a/engines/lastexpress/lastexpress.h +++ b/engines/lastexpress/lastexpress.h @@ -29,11 +29,12 @@ #include "common/random.h" #include "common/timer.h" -#include "engines/advancedDetector.h" #include "engines/engine.h" #include "graphics/pixelformat.h" +struct ADGameDescription; + /** * This is the namespace of the LastExpress engine. * @@ -101,7 +102,7 @@ public: void restoreEventHandlers(); void setEventHandlers(EventHandler::EventFunction *eventMouse, EventHandler::EventFunction *eventTick); - bool isDemo() const { return (bool)(_gameDescription->flags & ADGF_DEMO); } + bool isDemo() const; // Frame Counter uint32 getFrameCounter() { return _frameCounter; } -- cgit v1.2.3