aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/cine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cine/cine.cpp')
-rw-r--r--engines/cine/cine.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index a4af8f2201..d2f088dcd8 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -22,10 +22,14 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/events.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
+
+#include "image/iff.h"
#include "cine/cine.h"
#include "cine/bg_list.h"
@@ -89,9 +93,16 @@ void CineEngine::syncSoundSettings() {
}
Common::Error CineEngine::run() {
+ if (g_cine->getGameType() == GType_FW && (g_cine->getFeatures() & GF_CD)) {
+ showSplashScreen();
+ }
+
// Initialize backend
initGraphics(320, 200, false);
+ if (g_cine->getGameType() == GType_FW && (g_cine->getFeatures() & GF_CD))
+ checkCD();
+
if (getPlatform() == Common::kPlatformDOS) {
g_sound = new PCSound(_mixer, this);
} else {
@@ -236,4 +247,45 @@ void CineEngine::initialize() {
}
}
+void CineEngine::showSplashScreen() {
+ Common::File file;
+ if (!file.open("sony.lbm"))
+ return;
+
+ Image::IFFDecoder decoder;
+ if (!decoder.loadStream(file))
+ return;
+
+ const Graphics::Surface *surface = decoder.getSurface();
+ if (surface->w == 640 && surface->h == 480) {
+ initGraphics(640, 480, true);
+
+ const byte *palette = decoder.getPalette();
+ int paletteColorCount = decoder.getPaletteColorCount();
+ g_system->getPaletteManager()->setPalette(palette, 0, paletteColorCount);
+
+ g_system->copyRectToScreen(surface->getPixels(), 640, 0, 0, 640, 480);
+ g_system->updateScreen();
+
+ Common::EventManager *eventMan = g_system->getEventManager();
+
+ bool done = false;
+ uint32 now = g_system->getMillis();
+
+ while (!done && g_system->getMillis() - now < 2000) {
+ Common::Event event;
+ while (eventMan->pollEvent(event)) {
+ if (event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ done = true;
+ break;
+ }
+ if (shouldQuit())
+ done = true;
+ }
+ }
+ }
+
+ decoder.destroy();
+}
+
} // End of namespace Cine