ACCESS: MM - Start implementing intro

This commit is contained in:
Strangerke 2014-12-31 10:11:15 +01:00
parent f96dbd52c7
commit 3ac8a26cb9
4 changed files with 93 additions and 24 deletions

View File

@ -110,33 +110,78 @@ void MartianEngine::playGame() {
} while (_restartFl);
}
void MartianEngine::doIntroduction() {
_screen->setInitialPalettte();
_events->setCursor(CURSOR_ARROW);
_events->showCursor();
_screen->setPanel(0);
bool MartianEngine::showCredits() {
_events->hideCursor();
_screen->clearBuffer();
_destIn = _screen;
// TODO: Worry about implementing full intro sequence later
return;
int val1 = _demoStream->readSint16LE();
int val2 = 0;
int val3 = 0;
doTitle();
if (shouldQuit())
return;
while(val1 != -1) {
val2 = _demoStream->readSint16LE();
val3 = _demoStream->readSint16LE();
_screen->plotImage(_introObjects, val3, Common::Point(val1, val2));
if (!_skipStart) {
_screen->setPanel(3);
doOpening();
if (shouldQuit())
return;
if (!_skipStart) {
//doTent();
if (shouldQuit())
return;
}
val1 = _demoStream->readSint16LE();
}
doTitle();
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() {
_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();
_demoStream = new Common::MemoryReadStream(DEMO_DATA, 180);
if (!showCredits()) {
_screen->copyFrom(_buffer2);
_screen->forceFadeIn();
_events->_vbCount = 550;
while (!shouldQuit() && !_events->isKeyMousePressed() && _events->_vbCount > 0)
_events->pollEventsAndWait();
_screen->forceFadeOut();
while (!shouldQuit() && !_events->isKeyMousePressed()&& !showCredits())
_events->pollEventsAndWait();
warning("TODO: Free word_21E2B");
_midi->freeMusic();
}
}
void MartianEngine::doTitle() {

View File

@ -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

View File

@ -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

View File

@ -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