aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress
diff options
context:
space:
mode:
authorMatthew Hoops2011-06-13 13:12:23 -0400
committerMatthew Hoops2011-06-13 13:12:23 -0400
commitd355475a0416897ed254fa85f4d63d0f75d9c7ea (patch)
tree184892480ebb704b28163c51999e50c414e85f8a /engines/lastexpress
parent224c71e483e09931ba386555ff3b436b9defe63d (diff)
parentbfa26ffc44f80e4eb3d8590f5f865cda6a5188b7 (diff)
downloadscummvm-rg350-d355475a0416897ed254fa85f4d63d0f75d9c7ea.tar.gz
scummvm-rg350-d355475a0416897ed254fa85f4d63d0f75d9c7ea.tar.bz2
scummvm-rg350-d355475a0416897ed254fa85f4d63d0f75d9c7ea.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/lastexpress')
-rw-r--r--engines/lastexpress/data/animation.cpp13
-rw-r--r--engines/lastexpress/debug.cpp2
-rw-r--r--engines/lastexpress/detection.cpp35
-rw-r--r--engines/lastexpress/game/sound.cpp2
-rw-r--r--engines/lastexpress/lastexpress.cpp2
-rw-r--r--engines/lastexpress/lastexpress.h5
6 files changed, 22 insertions, 37 deletions
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:
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 7c7c6b0a36..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 {
@@ -176,35 +177,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 targets
- lastExpressGames,
- // Structure for autoupgrading obsolete targets
- 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";
@@ -224,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/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) {
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; }