aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/martian/martian_game.cpp85
-rw-r--r--engines/access/martian/martian_game.h6
-rw-r--r--engines/access/martian/martian_resources.cpp21
-rw-r--r--engines/access/martian/martian_resources.h1
4 files changed, 91 insertions, 22 deletions
diff --git a/engines/access/martian/martian_game.cpp b/engines/access/martian/martian_game.cpp
index 6722120211..3371610418 100644
--- a/engines/access/martian/martian_game.cpp
+++ b/engines/access/martian/martian_game.cpp
@@ -110,33 +110,78 @@ void MartianEngine::playGame() {
} while (_restartFl);
}
+bool MartianEngine::showCredits() {
+ _events->hideCursor();
+ _screen->clearBuffer();
+ _destIn = _screen;
+
+ int val1 = _demoStream->readSint16LE();
+ int val2 = 0;
+ int val3 = 0;
+
+ while(val1 != -1) {
+ val2 = _demoStream->readSint16LE();
+ val3 = _demoStream->readSint16LE();
+ _screen->plotImage(_introObjects, val3, Common::Point(val1, val2));
+
+ val1 = _demoStream->readSint16LE();
+ }
+
+ val2 = _demoStream->readSint16LE();
+ if (val2 == -1) {
+ _events->showCursor();
+ _screen->forceFadeOut();
+ return true;
+ }
+
+ _screen->forceFadeIn();
+ _timers[6]._timer = val2;
+ _timers[6]._initTm = val2;
+
+ while (!shouldQuit() && !_events->isKeyMousePressed() && _timers[6]._timer) {
+ _events->pollEventsAndWait();
+ }
+
+ _events->showCursor();
+ _screen->forceFadeOut();
+
+ if (_events->_rightButton)
+ return true;
+ else
+ return false;
+}
+
void MartianEngine::doIntroduction() {
- _screen->setInitialPalettte();
- _events->setCursor(CURSOR_ARROW);
+ _midi->loadMusic(47, 3);
+ _midi->midiPlay();
+ _screen->setDisplayScan();
+ _events->hideCursor();
+ _screen->forceFadeOut();
+ Resource *data = _files->loadFile(41, 1);
+ _introObjects = new SpriteResource(this, data);
+ delete data;
+
+ _files->loadScreen(41, 0);
+ _buffer2.copyFrom(*_screen);
+ _buffer1.copyFrom(*_screen);
_events->showCursor();
- _screen->setPanel(0);
+ _demoStream = new Common::MemoryReadStream(DEMO_DATA, 180);
- // TODO: Worry about implementing full intro sequence later
- return;
+ if (!showCredits()) {
+ _screen->copyFrom(_buffer2);
+ _screen->forceFadeIn();
- doTitle();
- if (shouldQuit())
- return;
+ _events->_vbCount = 550;
+ while (!shouldQuit() && !_events->isKeyMousePressed() && _events->_vbCount > 0)
+ _events->pollEventsAndWait();
- if (!_skipStart) {
- _screen->setPanel(3);
- doOpening();
- if (shouldQuit())
- return;
+ _screen->forceFadeOut();
+ while (!shouldQuit() && !_events->isKeyMousePressed()&& !showCredits())
+ _events->pollEventsAndWait();
- if (!_skipStart) {
- //doTent();
- if (shouldQuit())
- return;
- }
+ warning("TODO: Free word_21E2B");
+ _midi->freeMusic();
}
-
- doTitle();
}
void MartianEngine::doTitle() {
diff --git a/engines/access/martian/martian_game.h b/engines/access/martian/martian_game.h
index 812aa37ed1..e1606d7558 100644
--- a/engines/access/martian/martian_game.h
+++ b/engines/access/martian/martian_game.h
@@ -32,12 +32,15 @@ namespace Martian {
class MartianEngine : public AccessEngine {
private:
bool _skipStart;
-
+ SpriteResource *_introObjects;
+ Common::MemoryReadStream *_demoStream;
/**
* Do the game introduction
*/
void doIntroduction();
+ bool showCredits();
+
/**
* Do title sequence
*/
@@ -56,7 +59,6 @@ private:
void initObjects();
void configSelect();
void initVariables();
-
protected:
/**
* Play the game
diff --git a/engines/access/martian/martian_resources.cpp b/engines/access/martian/martian_resources.cpp
index 78d14b7c86..22a0cf1135 100644
--- a/engines/access/martian/martian_resources.cpp
+++ b/engines/access/martian/martian_resources.cpp
@@ -724,6 +724,27 @@ const int SIDEOFFL[] = { 11, 6, 1, 4, 10, 6, 1, 4, 0, 0, 0, 0 };
const int SIDEOFFU[] = { 1, 2, 0, 2, 2, 1, 1, 0, 0, 0, 0, 0 };
const int SIDEOFFD[] = { 2, 0, 1, 1, 0, 1, 1, 1, 2, 0, 0, 0 };
+const byte DEMO_DATA[] = {
+ 0x1F, 0x00, 0x49, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x49, 0x00,
+ 0x01, 0x00, 0x79, 0x00, 0x6F, 0x00, 0x02, 0x00, 0xFF, 0xFF,
+ 0xEA, 0x01, 0x75, 0x00, 0x46, 0x00, 0x03, 0x00, 0x46, 0x00,
+ 0x5E, 0x00, 0x04, 0x00, 0xFF, 0xFF, 0xEA, 0x01, 0x72, 0x00,
+ 0x3E, 0x00, 0x05, 0x00, 0x46, 0x00, 0x57, 0x00, 0x04, 0x00,
+ 0x5C, 0x00, 0x6E, 0x00, 0x06, 0x00, 0xFF, 0xFF, 0xEA, 0x01,
+ 0x63, 0x00, 0x48, 0x00, 0x07, 0x00, 0x2A, 0x00, 0x65, 0x00,
+ 0x08, 0x00, 0xFF, 0xFF, 0xEA, 0x01, 0x7E, 0x00, 0x39, 0x00,
+ 0x09, 0x00, 0x5C, 0x00, 0x57, 0x00, 0x06, 0x00, 0x45, 0x00,
+ 0x6B, 0x00, 0x04, 0x00, 0xFF, 0xFF, 0xEA, 0x01, 0x5F, 0x00,
+ 0x46, 0x00, 0x0A, 0x00, 0x67, 0x00, 0x62, 0x00, 0x0B, 0x00,
+ 0x47, 0x00, 0x76, 0x00, 0x0C, 0x00, 0xFF, 0xFF, 0xEA, 0x01,
+ 0x62, 0x00, 0x38, 0x00, 0x0D, 0x00, 0x47, 0x00, 0x55, 0x00,
+ 0x0E, 0x00, 0x49, 0x00, 0x6A, 0x00, 0x0F, 0x00, 0xFF, 0xFF,
+ 0xEA, 0x01, 0x18, 0x00, 0x22, 0x00, 0x10, 0x00, 0x17, 0x00,
+ 0x3E, 0x00, 0x11, 0x00, 0x16, 0x00, 0x52, 0x00, 0x12, 0x00,
+ 0xEE, 0x00, 0x7B, 0x00, 0x13, 0x00, 0xB5, 0x00, 0x93, 0x00,
+ 0x0B, 0x00, 0xFF, 0xFF, 0xF4, 0x01, 0xFF, 0xFF, 0xFF, 0xFF
+};
+
} // End of namespace Martian
} // End of namespace Access
diff --git a/engines/access/martian/martian_resources.h b/engines/access/martian/martian_resources.h
index 36b4ce3d37..67f8cb44a3 100644
--- a/engines/access/martian/martian_resources.h
+++ b/engines/access/martian/martian_resources.h
@@ -50,6 +50,7 @@ extern const int SIDEOFFL[];
extern const int SIDEOFFU[];
extern const int SIDEOFFD[];
+extern const byte DEMO_DATA[];
} // End of namespace Martian
} // End of namespace Access