VOYEUR: Add Interplay logo animation sequence (logo8.exe)

This commit is contained in:
Eric Fry 2024-02-22 09:45:00 +11:00 committed by Paul Gilbert
parent 87ec0e0b40
commit ffa4c70400
3 changed files with 70 additions and 0 deletions

View file

@ -26,9 +26,11 @@
#include "common/scummsys.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/events.h"
#include "graphics/palette.h"
#include "graphics/scaler.h"
#include "graphics/thumbnail.h"
#include "video/mve_decoder.h"
namespace Voyeur {
@ -158,6 +160,9 @@ bool VoyeurEngine::doHeadTitle() {
_eventsManager->startMainClockInt();
if (_loadGameSlot == -1) {
// show interplay logo animation
showLogo8Intro();
// Show starting screen
if (!getIsDemo() && _bVoy->getBoltGroup(0x500)) {
showConversionScreen();
@ -854,6 +859,68 @@ void VoyeurEngine::synchronize(Common::Serializer &s) {
_controlPtr->_state->synchronize(s);
}
void VoyeurEngine::showLogo8Intro() {
Common::File file;
if(!file.open("logo8.exe")) {
return;
}
file.seek(2);
int lastPageLength = file.readUint16LE();
int numPages = file.readUint16LE();
int exeLength = (numPages - 1) * 512 + lastPageLength;
// The MVE movie data is appended to the end of the EXE
file.seek(exeLength, SEEK_SET);
Video::MveDecoder *decoder = new Video::MveDecoder();
if (decoder->loadStream(&file)) {
decoder->setAudioTrack(0);
decoder->start();
bool skipMovie = false;
while (!decoder->endOfVideo() && !skipMovie && !shouldQuit()) {
unsigned int delay = MIN<uint32>(decoder->getTimeToNextFrame(), 10u);
g_system->delayMillis(delay);
const Graphics::Surface *frame = nullptr;
if (decoder->needsUpdate()) {
frame = decoder->decodeNextFrame();
}
if (frame) {
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
if (decoder->hasDirtyPalette()) {
PaletteManager *paletteManager = g_system->getPaletteManager();
decoder->applyPalette(paletteManager);
}
g_system->updateScreen();
}
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_ESCAPE || event.kbd.keycode == Common::KEYCODE_SPACE) {
skipMovie = true;
}
break;
case Common::EVENT_LBUTTONDOWN:
skipMovie = true;
break;
default:
break;
}
}
}
}
file.close();
delete decoder;
}
/*------------------------------------------------------------------------*/
bool VoyeurSavegameHeader::read(Common::InSaveFile *f, bool skipThumbnail) {

View file

@ -94,6 +94,8 @@ private:
void initStamp();
void closeStamp();
void showLogo8Intro();
/**
* Shows the game ending title animation
*/

View file

@ -46,6 +46,7 @@ namespace Video {
*
* Video decoder used in engines:
* - kingdom
* - voyeur
*/
class MveDecoder : public VideoDecoder {
bool _done;