From 4c9e67ccfa709a74f2c78580f42bb642b258cd22 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 7 Jun 2015 17:05:26 +0200 Subject: SHERLOCK: 3DO animation support --- engines/sherlock/scalpel/scalpel.cpp | 66 +++++++++++++++++++++- engines/sherlock/scalpel/scalpel.h | 4 ++ .../sherlock/scalpel/scalpel_user_interface.cpp | 6 +- engines/sherlock/scalpel/tsage/logo.cpp | 2 +- 4 files changed, 73 insertions(+), 5 deletions(-) (limited to 'engines/sherlock/scalpel') diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index 9d2c3b8d81..e7d8ef18c3 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -182,7 +182,16 @@ ScalpelEngine::~ScalpelEngine() { } void ScalpelEngine::initialize() { - initGraphics(320, 200, false); + // 3DO actually uses RGB555, but some platforms of ours only support RGB565, so we use that + const Graphics::PixelFormat *pixelFormatRGB565 = new Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); + + if (getPlatform() == Common::kPlatform3DO) { + // 320x200 16-bit RGB565 for 3DO support + initGraphics(320, 200, false, pixelFormatRGB565); + } else { + // 320x200 palettized + initGraphics(320, 200, false); + } // Let the base engine intialize SherlockEngine::initialize(); @@ -231,6 +240,14 @@ void ScalpelEngine::showOpening() { // 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 + if (!showCityCutscene3DO()) + return; + if (!showAlleyCutscene3DO()) + return; + if (!showStreetCutscene3DO()) + return; + if (!showOfficeCutscene3DO()) + return; return; } @@ -507,6 +524,53 @@ bool ScalpelEngine::showOfficeCutscene() { return finished; } +// 3DO variant +bool ScalpelEngine::showCityCutscene3DO() { + + bool finished = _animation->play3DO("26open1", 1, 255, 2); + + if (finished) + finished = _animation->play3DO("26open2", 1, 0, 2); + + return finished; +} + +bool ScalpelEngine::showAlleyCutscene3DO() { + bool finished = _animation->play3DO("27PRO1", 1, 3, 2); + + if (finished) + finished = _animation->play3DO("27PRO2", 1, 0, 2); + + if (finished) + finished = _animation->play3DO("27PRO3", 1, 0, 2); + + return finished; +} + +bool ScalpelEngine::showStreetCutscene3DO() { + bool finished = _animation->play3DO("14KICK", 1, 3, 2); + + if (finished) + finished = _animation->play3DO("14NOTE", 1, 0, 3); + + return finished; +} + +bool ScalpelEngine::showOfficeCutscene3DO() { + bool finished = _animation->play3DO("COFF1", 1, 3, 3); + + if (finished) + finished = _animation->play3DO("COFF2", 1, 0, 3); + + if (finished) + finished = _animation->play3DO("COFF3", 1, 0, 3); + + if (finished) + finished = _animation->play3DO("COFF4", 1, 0, 3); + + return finished; +} + void ScalpelEngine::loadInventory() { Inventory &inv = *_inventory; diff --git a/engines/sherlock/scalpel/scalpel.h b/engines/sherlock/scalpel/scalpel.h index 8743bfb7a9..7cd555a5b1 100644 --- a/engines/sherlock/scalpel/scalpel.h +++ b/engines/sherlock/scalpel/scalpel.h @@ -43,21 +43,25 @@ private: * Show the starting city cutscene which shows the game title */ bool showCityCutscene(); + bool showCityCutscene3DO(); /** * Show the back alley where the initial murder takes place */ bool showAlleyCutscene(); + bool showAlleyCutscene3DO(); /** * Show the Baker Street outside cutscene */ bool showStreetCutscene(); + bool showStreetCutscene3DO(); /** * Show Holmes and Watson at the breakfast table, lestrade's note, and then the scrolling credits */ bool showOfficeCutscene(); + bool showOfficeCutscene3DO(); /** * Show the game credits diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 62083586e7..a89ebb61fc 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -1235,7 +1235,7 @@ void ScalpelUserInterface::doLookControl() { } else { // Looking at an inventory object // Backup the user interface - Surface tempSurface(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT - CONTROLS_Y1); + Surface tempSurface(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT - CONTROLS_Y1, _vm->getPlatform()); tempSurface.blitFrom(screen._backBuffer2, Common::Point(0, 0), Common::Rect(0, CONTROLS_Y1, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT)); @@ -1791,7 +1791,7 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first // If it wasn't a right button click, then we need depress // the look button before we close the window. So save a copy of the // menu area, and draw the controls onto it - Surface tempSurface((*_controls)[0]._frame.w, (*_controls)[0]._frame.h); + Surface tempSurface((*_controls)[0]._frame.w, (*_controls)[0]._frame.h, _vm->getPlatform()); Common::Point pt(MENU_POINTS[0][0], MENU_POINTS[0][1]); tempSurface.blitFrom(screen._backBuffer2, Common::Point(0, 0), @@ -1982,7 +1982,7 @@ void ScalpelUserInterface::summonWindow(bool slideUp, int height) { // Extract the window that's been drawn on the back buffer Surface tempSurface(SHERLOCK_SCREEN_WIDTH, - (SHERLOCK_SCREEN_HEIGHT - height)); + (SHERLOCK_SCREEN_HEIGHT - height), _vm->getPlatform()); Common::Rect r(0, height, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT); tempSurface.blitFrom(screen._backBuffer1, Common::Point(0, 0), r); diff --git a/engines/sherlock/scalpel/tsage/logo.cpp b/engines/sherlock/scalpel/tsage/logo.cpp index 072b10f7eb..2ac6af2601 100644 --- a/engines/sherlock/scalpel/tsage/logo.cpp +++ b/engines/sherlock/scalpel/tsage/logo.cpp @@ -104,7 +104,7 @@ void Visage::surfaceFromRes(ObjectSurface &s) { int frameWidth = _stream->readUint16LE(); int frameHeight = _stream->readUint16LE(); Common::Rect r(0, 0, frameWidth, frameHeight); - s.create(r.width(), r.height()); + s.create(r.width(), r.height(), Common::kPlatformDOS); // maybe change this to a bool later? TODO s._centroid.x = _stream->readSint16LE(); s._centroid.y = _stream->readSint16LE(); -- cgit v1.2.3