Skip to content

Commit

Permalink
SHERLOCK: 3DO: play EA intro movie
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kiewitz committed Jun 8, 2015
1 parent 6260c33 commit 4ed4dfa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion engines/sherlock/debugger.cpp
Expand Up @@ -44,7 +44,7 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {

void Debugger::postEnter() {
if (!_3doPlayMovieFile.empty()) {
Scalpel3DOMoviePlay(_3doPlayMovieFile.c_str());
Scalpel3DOMoviePlay(_3doPlayMovieFile.c_str(), Common::Point(0, 0));

_3doPlayMovieFile.clear();
}
Expand Down
22 changes: 5 additions & 17 deletions engines/sherlock/scalpel/3do/movie_decoder.cpp
Expand Up @@ -464,16 +464,12 @@ Audio::AudioStream *Scalpel3DOMovieDecoder::StreamAudioTrack::getAudioStream() c
// Test-code

// Code for showing a movie. Only meant for testing/debug purposes
void Scalpel3DOMoviePlay(const char *filename) {
// HACK
initGraphics(320, 240, false, NULL);

bool Scalpel3DOMoviePlay(const char *filename, Common::Point pos) {
Scalpel3DOMovieDecoder *videoDecoder = new Scalpel3DOMovieDecoder();

if (!videoDecoder->loadFile(filename)) {
// HACK
initGraphics(320, 200, false);
return;
warning("Scalpel3DOMoviePlay: could not open '%s'", filename);
return false;
}

bool skipVideo = false;
Expand All @@ -489,13 +485,7 @@ void Scalpel3DOMoviePlay(const char *filename) {
const Graphics::Surface *frame = videoDecoder->decodeNextFrame();

if (frame) {
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, width, height);

if (videoDecoder->hasDirtyPalette()) {
const byte *palette = videoDecoder->getPalette();
g_system->getPaletteManager()->setPalette(palette, 0, 255);
}

g_system->copyRectToScreen(frame->getPixels(), frame->pitch, pos.x, pos.y, width, height);
g_system->updateScreen();
}
}
Expand All @@ -508,9 +498,7 @@ void Scalpel3DOMoviePlay(const char *filename) {

g_system->delayMillis(10);
}

// HACK: switch back to 8bpp
initGraphics(320, 200, false);
return !skipVideo;
}


Expand Down
3 changes: 2 additions & 1 deletion engines/sherlock/scalpel/3do/movie_decoder.h
Expand Up @@ -23,6 +23,7 @@
#ifndef SHERLOCK_SCALPEL_3DO_MOVIE_DECODER_H
#define SHERLOCK_SCALPEL_3DO_MOVIE_DECODER_H

#include "common/rect.h"
#include "video/video_decoder.h"
#include "audio/decoders/3do.h"

Expand Down Expand Up @@ -119,7 +120,7 @@ class Scalpel3DOMovieDecoder : public Video::VideoDecoder {
};

// Testing
extern void Scalpel3DOMoviePlay(const char *filename);
extern bool Scalpel3DOMoviePlay(const char *filename, Common::Point pos);

} // End of namespace Sherlock

Expand Down
10 changes: 5 additions & 5 deletions engines/sherlock/scalpel/scalpel.cpp
Expand Up @@ -29,6 +29,8 @@
#include "sherlock/sherlock.h"
#include "sherlock/music.h"
#include "sherlock/animation.h"
// for 3DO
#include "sherlock/scalpel/3do/movie_decoder.h"

namespace Sherlock {

Expand Down Expand Up @@ -238,11 +240,9 @@ void ScalpelEngine::showOpening() {
return;

if (getPlatform() == Common::kPlatform3DO) {
// 3DO opening seems to be similar
// TODO
// 3DO animations are in directory Prologue/
// .3DX seem to be just like .VDX except that all INT16LE are INT16BE
// .3DA however seems to be completely different
// 3DO intro
Scalpel3DOMoviePlay("EAlogo.stream", Common::Point(20, 0));
_screen->clear();
if (!showCityCutscene3DO())
return;
if (!showAlleyCutscene3DO())
Expand Down

0 comments on commit 4ed4dfa

Please sign in to comment.