void GobEngine::setTrueColor(bool trueColor) { if (isTrueColor() == trueColor) return; _features = (_features & ~kFeaturesTrueColor) | (trueColor ? kFeaturesTrueColor : 0); _video->setSize(is640x480()); _pixelFormat = g_system->getScreenFormat(); Common::Array<SurfacePtr>::iterator surf; for (surf = _draw->_spritesArray.begin(); surf != _draw->_spritesArray.end(); ++surf) if (*surf) (*surf)->setBPP(_pixelFormat.bytesPerPixel); if (_draw->_backSurface) _draw->_backSurface->setBPP(_pixelFormat.bytesPerPixel); if (_draw->_frontSurface) _draw->_frontSurface->setBPP(_pixelFormat.bytesPerPixel); if (_draw->_cursorSprites) _draw->_cursorSprites->setBPP(_pixelFormat.bytesPerPixel); if (_draw->_cursorSpritesBack) _draw->_cursorSpritesBack->setBPP(_pixelFormat.bytesPerPixel); if (_draw->_scummvmCursor) _draw->_scummvmCursor->setBPP(_pixelFormat.bytesPerPixel); SurfacePtr _scummvmCursor; }
Common::Error BuriedEngine::run() { _console = new BuriedConsole(this); #ifndef USE_ICONV // The Japanese version needs iconv support if (getLanguage() == Common::JA_JPN) return Common::Error(Common::kUnknownError, "No iconv support available"); #endif if (isTrueColor()) { initGraphics(640, 480, true, 0); if (_system->getScreenFormat().bytesPerPixel == 1) return Common::kUnsupportedColorMode; } else { initGraphics(640, 480, true); } if (isWin95()) { _mainEXE = new DatabasePE(); _library = new DatabasePE(); } else if (isCompressed()) { _mainEXE = new DatabaseNECompressed(); _library = new DatabaseNECompressed(); } else { _mainEXE = new DatabaseNE(); // Demo only uses the main EXE if (!isDemo()) _library = new DatabaseNE(); } if (!_mainEXE->load(getEXEName())) error("Failed to load main EXE '%s'", getEXEName().c_str()); if (_library && !_library->load(getLibraryName())) error("Failed to load library DLL '%s'", getLibraryName().c_str()); syncSoundSettings(); _gfx = new GraphicsManager(this); _sound = new SoundManager(this); _mainWindow = new FrameWindow(this); _mainWindow->showWindow(Window::kWindowShow); if (isDemo()) { ((FrameWindow *)_mainWindow)->showTitleSequence(); ((FrameWindow *)_mainWindow)->showMainMenu(); } else { bool doIntro = true; if (ConfMan.hasKey("save_slot")) { uint32 gameToLoad = ConfMan.getInt("save_slot"); doIntro = (loadGameState(gameToLoad).getCode() != Common::kNoError); // If the trial version tries to load a game without a time // zone that's part of the trial version, force the intro. if (isTrial() && !((FrameWindow *)_mainWindow)->getMainChildWindow()) doIntro = true; } // Play the intro only if we're starting from scratch if (doIntro) ((FrameWindow *)_mainWindow)->showClosingScreen(); } while (!shouldQuit()) { updateVideos(); pollForEvents(); sendAllMessages(); _gfx->updateScreen(); _system->delayMillis(10); } return Common::kNoError; }