void Scene::changeScene(int16 sceneNumber, int actorsEntrance, SceneTransitionType transitionType, int chapter) { debug(5, "Scene::changeScene(%d, %d, %d, %d)", sceneNumber, actorsEntrance, transitionType, chapter); // This is used for latter ITE demos where all places on world map except // Tent Faire are substituted with IFF picture and short description if (_vm->_hasITESceneSubstitutes) { for (int i = 0; i < ARRAYSIZE(sceneSubstitutes); i++) { if (sceneSubstitutes[i].sceneId == sceneNumber) { const byte *pal; Common::File file; Rect rect; PalEntry cPal[PAL_ENTRIES]; _vm->_interface->setMode(kPanelSceneSubstitute); if (file.open(sceneSubstitutes[i].image)) { Image::IFFDecoder decoder; decoder.loadStream(file); pal = decoder.getPalette(); rect.setWidth(decoder.getSurface()->w); rect.setHeight(decoder.getSurface()->h); _vm->_gfx->drawRegion(rect, (const byte *)decoder.getSurface()->getPixels()); for (int j = 0; j < PAL_ENTRIES; j++) { cPal[j].red = *pal++; cPal[j].green = *pal++; cPal[j].blue = *pal++; } _vm->_gfx->setPalette(cPal); } _vm->_interface->setStatusText("Click or Press Return to continue. Press Q to quit.", 96); _vm->_font->textDrawRect(kKnownFontMedium, sceneSubstitutes[i].title, Common::Rect(0, 7, _vm->getDisplayInfo().width, 27), _vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline); _vm->_font->textDrawRect(kKnownFontMedium, sceneSubstitutes[i].message, Common::Rect(24, getHeight() - 33, _vm->getDisplayInfo().width - 11, getHeight()), _vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline); return; } } } LoadSceneParams sceneParams; sceneParams.actorsEntrance = actorsEntrance; sceneParams.loadFlag = kLoadBySceneNumber; sceneParams.sceneDescriptor = sceneNumber; sceneParams.transitionType = transitionType; sceneParams.sceneProc = NULL; sceneParams.sceneSkipTarget = false; sceneParams.chapter = chapter; if (sceneNumber != -2) { endScene(); } loadScene(sceneParams); }
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->getWidth() == 640 && surface->getHeight() == 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(); }