diff options
86 files changed, 132 insertions, 159 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index cd7e11b32d..0e802f6257 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -332,7 +332,6 @@ void SurfaceSdlGraphicsManager::beginGFXTransaction() { _transactionDetails.needHotswap = false; _transactionDetails.needUpdatescreen = false; - _transactionDetails.normal1xScaler = false; #if SDL_VERSION_ATLEAST(2, 0, 0) _transactionDetails.needTextureUpdate = false; #endif @@ -657,7 +656,6 @@ bool SurfaceSdlGraphicsManager::setGraphicsMode(int mode) { return false; } - _transactionDetails.normal1xScaler = (mode == GFX_NORMAL); if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor) _transactionDetails.needHotswap = true; diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h index 532399ed66..e93cf410ea 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.h +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h @@ -238,7 +238,6 @@ protected: bool sizeChanged; bool needHotswap; bool needUpdatescreen; - bool normal1xScaler; #if SDL_VERSION_ATLEAST(2, 0, 0) bool needTextureUpdate; #endif diff --git a/engines/access/access.cpp b/engines/access/access.cpp index ea2144459d..1855280a24 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -153,7 +153,7 @@ AccessEngine::~AccessEngine() { } void AccessEngine::setVGA() { - initGraphics(320, 200, false); + initGraphics(320, 200); } void AccessEngine::initialize() { diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 61890af37a..9370363a3f 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -681,7 +681,7 @@ void AdlEngine::gameLoop() { } Common::Error AdlEngine::run() { - initGraphics(DISPLAY_WIDTH * 2, DISPLAY_HEIGHT * 2, true); + initGraphics(DISPLAY_WIDTH * 2, DISPLAY_HEIGHT * 2); _console = new Console(this); _display = new Display(); diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index fa1f11cce4..119ccfea1d 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -210,7 +210,7 @@ int GfxMgr::initVideo() { _displayPixels = _displayScreenWidth * _displayScreenHeight; _displayScreen = (byte *)calloc(_displayPixels, 1); - initGraphics(_displayScreenWidth, _displayScreenHeight, _displayScreenWidth > 320); + initGraphics(_displayScreenWidth, _displayScreenHeight); setPalette(true); // set gfx-mode palette diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 48b170da75..108d5a94d7 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -577,7 +577,7 @@ Common::Error AGOSEngine::init() { _screenHeight = 200; } - initGraphics(_screenWidth, _screenHeight, getGameType() == GType_FF || getGameType() == GType_PP); + initGraphics(_screenWidth, _screenHeight); _midi = new MidiPlayer(); diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 03c9e9e3cb..6ce6ef2603 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -68,7 +68,7 @@ GraphicManager::~GraphicManager() { } void GraphicManager::init() { - initGraphics(kScreenWidth, kScreenHeight * 2, true); // Doubling the height. + initGraphics(kScreenWidth, kScreenHeight * 2); // Doubling the height. for (int i = 0; i < 64; ++i) { _egaPalette[i][0] = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55; @@ -799,7 +799,7 @@ void GraphicManager::menuRefreshScreen() { } void GraphicManager::menuInitialize() { - initGraphics(kScreenWidth, kMenuScreenHeight, true); + initGraphics(kScreenWidth, kMenuScreenHeight); _menu.create(kScreenWidth, kMenuScreenHeight, Graphics::PixelFormat::createFormatCLUT8()); } @@ -808,7 +808,7 @@ void GraphicManager::menuFree() { } void GraphicManager::menuRestoreScreen() { - initGraphics(kScreenWidth, 2 * kScreenHeight, true); + initGraphics(kScreenWidth, 2 * kScreenHeight); } void GraphicManager::menuLoadPictures() { diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp index e4dcb1a84b..74518d5a3e 100644 --- a/engines/bbvs/bbvs.cpp +++ b/engines/bbvs/bbvs.cpp @@ -170,7 +170,7 @@ Common::Error BbvsEngine::run() { _isSaveAllowed = false; _hasSnapshot = false; - initGraphics(320, 240, false); + initGraphics(320, 240); _screen = new Screen(_system); _gameModule = new GameModule(); diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp index 2ab5c1556b..f48c98005e 100644 --- a/engines/bbvs/videoplayer.cpp +++ b/engines/bbvs/videoplayer.cpp @@ -37,7 +37,7 @@ void BbvsEngine::playVideo(int videoNum) { videoFilename = Common::String::format("vid/video%03d.avi", videoNum - 1); // Set the correct video mode - initGraphics(320, 240, false, 0); + initGraphics(320, 240, nullptr); if (_system->getScreenFormat().bytesPerPixel == 1) { warning("Couldn't switch to a RGB color video mode to play a video."); return; @@ -84,7 +84,7 @@ void BbvsEngine::playVideo(int videoNum) { delete videoDecoder; - initGraphics(320, 240, false); + initGraphics(320, 240); } diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 1d29bde75f..0c5dabe136 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -139,7 +139,7 @@ bool BladeRunnerEngine::hasFeature(EngineFeature f) const { Common::Error BladeRunnerEngine::run() { Graphics::PixelFormat format = createRGB555(); - initGraphics(640, 480, true, &format); + initGraphics(640, 480, &format); _system->showMouse(true); diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 7058314b9d..32126835f8 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -219,7 +219,7 @@ Common::Error CGEEngine::run() { } // Initialize graphics using following: - initGraphics(kScrWidth, kScrHeight, false); + initGraphics(kScrWidth, kScrHeight); // Setup necessary game objects init(); diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index ee62e20ac6..04b9db14c4 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -191,7 +191,7 @@ bool CGE2Engine::hasFeature(EngineFeature f) const { Common::Error CGE2Engine::run() { syncSoundSettings(); - initGraphics(kScrWidth, kScrHeight, false); + initGraphics(kScrWidth, kScrHeight); init(); cge2_main(); diff --git a/engines/chewy/chewy.cpp b/engines/chewy/chewy.cpp index 9df45b1dfb..75c2a8d51b 100644 --- a/engines/chewy/chewy.cpp +++ b/engines/chewy/chewy.cpp @@ -83,8 +83,8 @@ void ChewyEngine::initialize() { Common::Error ChewyEngine::run() { // Initialize backend - //initGraphics(640, 480, true); - initGraphics(320, 200, false); + //initGraphics(640, 480); + initGraphics(320, 200); initialize(); diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 414fe49eb6..777cbe279f 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -99,7 +99,7 @@ Common::Error CineEngine::run() { } // Initialize backend - initGraphics(320, 200, false); + initGraphics(320, 200); if (g_cine->getGameType() == GType_FW && (g_cine->getFeatures() & GF_CD)) checkCD(); @@ -259,7 +259,7 @@ void CineEngine::showSplashScreen() { const Graphics::Surface *surface = decoder.getSurface(); if (surface->w == 640 && surface->h == 480) { - initGraphics(640, 480, true); + initGraphics(640, 480); const byte *palette = decoder.getPalette(); int paletteColorCount = decoder.getPaletteColorCount(); diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index 13ba76191b..a04f4b650b 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -101,7 +101,7 @@ Common::Error ComposerEngine::run() { uint height = 480; if (_bookIni.hasKey("Height", "Common")) height = atoi(getStringFromConfig("Common", "Height").c_str()); - initGraphics(width, height, true); + initGraphics(width, height); _screen.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); Graphics::Cursor *cursor = Graphics::makeDefaultWinCursor(); diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index eebd8fdc15..df525c0791 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -84,7 +84,7 @@ bool CruiseEngine::hasFeature(EngineFeature f) const { Common::Error CruiseEngine::run() { // Initialize backend - initGraphics(320, 200, false); + initGraphics(320, 200); if (!loadLanguageStrings()) { error("Could not setup language data for your version"); diff --git a/engines/cryo/cryo.cpp b/engines/cryo/cryo.cpp index 3574105053..52fb2ae8d2 100644 --- a/engines/cryo/cryo.cpp +++ b/engines/cryo/cryo.cpp @@ -74,7 +74,7 @@ Common::Error CryoEngine::run() { _timerTicks = 0; // incremented in realtime // Initialize graphics using following: - initGraphics(320, 200, false); + initGraphics(320, 200); _screen.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); _game->run(); diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp index 46dab0f763..3f9a5383b1 100644 --- a/engines/director/graphics.cpp +++ b/engines/director/graphics.cpp @@ -228,7 +228,7 @@ void DirectorEngine::testFontScaling() { int w = 640; int h = 480; - initGraphics(w, h, true); + initGraphics(w, h); _system->getPaletteManager()->setPalette(defaultPalette, 0, 256); Graphics::ManagedSurface surface; diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 350fccb176..30cbe1d4c3 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -1170,7 +1170,7 @@ Common::Rect Score::readRect(Common::ReadStreamEndian &stream) { } void Score::startLoop() { - initGraphics(_movieRect.width(), _movieRect.height(), true); + initGraphics(_movieRect.width(), _movieRect.height()); _surface->create(_movieRect.width(), _movieRect.height()); _trailSurface->create(_movieRect.width(), _movieRect.height()); diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 8fdb1c8d88..4c19ab01df 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -357,7 +357,7 @@ Common::Error DMEngine::run() { initConstants(); // scummvm/engine specific - initGraphics(320, 200, false); + initGraphics(320, 200); _console = new Console(this); _displayMan = new DisplayMan(this); _dungeonMan = new DungeonMan(this); diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index e3a97bf59a..0de1121d91 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -150,7 +150,7 @@ static SoundArchive* openAnyPossibleDubbing() { int DraciEngine::init() { // Initialize graphics using following: - initGraphics(kScreenWidth, kScreenHeight, false); + initGraphics(kScreenWidth, kScreenHeight); // Open game's archives _initArchive = new BArchive(initPath); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 56a2d638f7..d0d2790c0e 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -236,7 +236,7 @@ bool DrasculaEngine::hasFeature(EngineFeature f) const { Common::Error DrasculaEngine::run() { // Initialize backend - initGraphics(320, 200, false); + initGraphics(320, 200); switch (getLanguage()) { case Common::EN_ANY: diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp index bd0957c1bd..f0b77b9691 100644 --- a/engines/dreamweb/titles.cpp +++ b/engines/dreamweb/titles.cpp @@ -99,7 +99,7 @@ void DreamWebEngine::gettingShot() { } void DreamWebEngine::bibleQuote() { - initGraphics(640, 480, true); + initGraphics(640, 480); showPCX("I00"); fadeScreenUps(); @@ -285,7 +285,7 @@ void DreamWebEngine::realCredits() { _sound->loadRoomsSample(_roomsSample); _sound->volumeSet(0); - initGraphics(640, 480, true); + initGraphics(640, 480); hangOn(35); showPCX("I01"); diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 4a7acd2344..aa58352e81 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -151,7 +151,7 @@ void DreamWebEngine::doShake() { void DreamWebEngine::setMode() { waitForVSync(); - initGraphics(kScreenwidth, kScreenheight, false); + initGraphics(kScreenwidth, kScreenheight); } void DreamWebEngine::showPCX(const Common::String &suffix) { diff --git a/engines/engine.cpp b/engines/engine.cpp index bb51e77f0d..bb07f5f722 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -194,38 +194,16 @@ void Engine::initializePath(const Common::FSNode &gamePath) { SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 4); } -void initCommonGFX(bool defaultTo1XScaler) { +void initCommonGFX() { const Common::ConfigManager::Domain *transientDomain = ConfMan.getDomain(Common::ConfigManager::kTransientDomain); const Common::ConfigManager::Domain *gameDomain = ConfMan.getActiveDomain(); assert(transientDomain); - const bool useDefaultGraphicsMode = - (!transientDomain->contains("gfx_mode") || - !scumm_stricmp(transientDomain->getVal("gfx_mode").c_str(), "normal") || - !scumm_stricmp(transientDomain->getVal("gfx_mode").c_str(), "default") - ) - && - ( - !gameDomain || - !gameDomain->contains("gfx_mode") || - !scumm_stricmp(gameDomain->getVal("gfx_mode").c_str(), "normal") || - !scumm_stricmp(gameDomain->getVal("gfx_mode").c_str(), "default") - ); - - // See if the game should default to 1x scaler - if (useDefaultGraphicsMode && defaultTo1XScaler) { - g_system->resetGraphicsScale(); - } else { - // Override global scaler with any game-specific define - if (ConfMan.hasKey("gfx_mode")) { - Common::String gfxMode = ConfMan.get("gfx_mode"); - g_system->setGraphicsMode(gfxMode.c_str()); - - // HACK: For OpenGL modes, we will still honor the graphics scale override - if (defaultTo1XScaler && gfxMode.equalsIgnoreCase("opengl")) - g_system->resetGraphicsScale(); - } + // Override global scaler with any game-specific define + if (ConfMan.hasKey("gfx_mode")) { + Common::String gfxMode = ConfMan.get("gfx_mode"); + g_system->setGraphicsMode(gfxMode.c_str()); } // Note: The following code deals with the fullscreen / ASR settings. This @@ -307,11 +285,11 @@ void splashScreen() { splash = true; } -void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format) { +void initGraphics(int width, int height, const Graphics::PixelFormat *format) { g_system->beginGFXTransaction(); - initCommonGFX(defaultTo1xScaler); + initCommonGFX(); #ifdef USE_RGB_COLOR if (format) g_system->initSize(width, height, format); @@ -399,20 +377,20 @@ inline PixelFormat findCompatibleFormat(Common::List<PixelFormat> backend, Commo } -void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList) { +void initGraphics(int width, int height, const Common::List<Graphics::PixelFormat> &formatList) { Graphics::PixelFormat format = findCompatibleFormat(g_system->getSupportedFormats(), formatList); - initGraphics(width, height, defaultTo1xScaler, &format); + initGraphics(width, height, &format); } -void initGraphics(int width, int height, bool defaultTo1xScaler) { +void initGraphics(int width, int height) { Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8(); - initGraphics(width, height, defaultTo1xScaler, &format); + initGraphics(width, height, &format); } void GUIErrorMessage(const Common::String &msg) { g_system->setWindowCaption("Error"); g_system->beginGFXTransaction(); - initCommonGFX(false); + initCommonGFX(); g_system->initSize(320, 200); if (g_system->endGFXTransaction() == OSystem::kTransactionSuccess) { GUI::MessageDialog dialog(msg); diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 61e7eef692..ad9b6a42f6 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -280,7 +280,7 @@ Common::Error FullpipeEngine::saveGameState(int slot, const Common::String &desc Common::Error FullpipeEngine::run() { const Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0); // Initialize backend - initGraphics(800, 600, true, &format); + initGraphics(800, 600, &format); _backgroundSurface = new Graphics::Surface; _backgroundSurface->create(800, 600, format); diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index 9289053048..cf8710c64d 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -200,7 +200,7 @@ Common::Error GnapEngine::run() { #else Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); #endif - initGraphics(800, 600, true, &format); + initGraphics(800, 600, &format); // We do not support color conversion yet if (_system->getScreenFormat() != format) diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 605f1ed5b9..c9eaec9ef0 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -260,7 +260,7 @@ void GobEngine::setTrueColor(bool trueColor) { _features = (_features & ~kFeaturesTrueColor) | (trueColor ? kFeaturesTrueColor : 0); - _video->setSize(is640x480()); + _video->setSize(); _pixelFormat = g_system->getScreenFormat(); @@ -708,7 +708,7 @@ Common::Error GobEngine::initGraphics() { _mode = 0x14; } - _video->setSize(is640x480()); + _video->setSize(); _pixelFormat = g_system->getScreenFormat(); diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 3928985dcd..1e8eddeef0 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -797,7 +797,7 @@ void Inter_v2::o2_initScreen() { height = _vm->_height = 400; _vm->_global->_colorCount = 16; - _vm->_video->setSize(true); + _vm->_video->setSize(); } else if (_vm->_global->_videoMode == 0x10) { @@ -810,7 +810,7 @@ void Inter_v2::o2_initScreen() { _vm->_height = 200; _vm->_global->_colorCount = 256; - _vm->_video->setSize(false); + _vm->_video->setSize(); } } diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index 50176e0a27..91342cf326 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -140,13 +140,13 @@ void Inter_v5::o5_initScreen() { _vm->_width = 320; _vm->_height = 200; - _vm->_video->setSize(false); + _vm->_video->setSize(); } else if (_vm->_global->_videoMode == 0x13) { width = _vm->_width = 640; height = _vm->_height = 480; - _vm->_video->setSize(true); + _vm->_video->setSize(); } _vm->_global->_fakeVideoMode = videoMode; diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 1dc51d994c..6480fe89f0 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -237,11 +237,11 @@ void Video::clearScreen() { g_system->fillScreen(0); } -void Video::setSize(bool defaultTo1XScaler) { +void Video::setSize() { if (_vm->isTrueColor()) - initGraphics(_vm->_width, _vm->_height, defaultTo1XScaler, 0); + initGraphics(_vm->_width, _vm->_height, nullptr); else - initGraphics(_vm->_width, _vm->_height, defaultTo1XScaler); + initGraphics(_vm->_width, _vm->_height); } void Video::retrace(bool mouse) { diff --git a/engines/gob/video.h b/engines/gob/video.h index 2c547baca0..57ec4fb6d4 100644 --- a/engines/gob/video.h +++ b/engines/gob/video.h @@ -112,7 +112,7 @@ public: void initPrimary(int16 mode); SurfacePtr initSurfDesc(int16 width, int16 height, int16 flags = 0); - void setSize(bool defaultTo1XScaler); + void setSize(); void clearScreen(); void retrace(bool mouse = true); diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 2ba4ed18ab..291e3a1fde 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -106,7 +106,7 @@ Common::Error GroovieEngine::run() { case kGroovieV2: { // Request the mode with the highest precision available Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0); - initGraphics(640, 480, true, &format); + initGraphics(640, 480, &format); if (_system->getScreenFormat() != format) return Common::kUnsupportedColorMode; @@ -116,7 +116,7 @@ Common::Error GroovieEngine::run() { break; } case kGroovieT7G: - initGraphics(640, 480, true); + initGraphics(640, 480); _pixelFormat = Graphics::PixelFormat::createFormatCLUT8(); break; } diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 7227c3e833..3cdf6add8f 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -106,7 +106,7 @@ GraphicsManager::~GraphicsManager() { void GraphicsManager::setGraphicalMode(int width, int height) { if (!_initGraphicsFl) { Graphics::PixelFormat pixelFormat16(2, 5, 6, 5, 0, 11, 5, 0, 0); - initGraphics(width, height, true, &pixelFormat16); + initGraphics(width, height, &pixelFormat16); // Init surfaces _backBuffer = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 6881278cee..5f6892bd20 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -218,7 +218,7 @@ void HugoEngine::gameOverMsg() { Common::Error HugoEngine::run() { s_Engine = this; - initGraphics(320, 200, false); + initGraphics(320, 200); _mouse = new MouseHandler(this); _inventory = new InventoryHandler(this); diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index eaa074ff0a..6076879876 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -253,10 +253,8 @@ void Screen::setResolution() { _system->getPaletteManager()->grabPalette(palette, 0, 256); int width = 320, height = 200; - bool defaultTo1xScaler = false; if (_vm->gameFlags().useHiRes) { - defaultTo1xScaler = true; height = 400; if (_debugEnabled) @@ -270,7 +268,7 @@ void Screen::setResolution() { width = 320; } - initGraphics(width, height, defaultTo1xScaler); + initGraphics(width, height); _system->getPaletteManager()->setPalette(palette, 0, 256); } diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp index 39b2feb93d..ee67d3a99d 100644 --- a/engines/lab/lab.cpp +++ b/engines/lab/lab.cpp @@ -160,9 +160,9 @@ LabEngine::~LabEngine() { Common::Error LabEngine::run() { if (getFeatures() & GF_LOWRES) - initGraphics(320, 200, false); + initGraphics(320, 200); else - initGraphics(640, 480, true); + initGraphics(640, 480); _interface = new Interface(this); _event = new EventManager(this); diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 90b684ab0b..91f8a6a346 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -111,7 +111,7 @@ LastExpressEngine::~LastExpressEngine() { Common::Error LastExpressEngine::run() { // Initialize the graphics const Graphics::PixelFormat dataPixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); - initGraphics(640, 480, true, &dataPixelFormat); + initGraphics(640, 480, &dataPixelFormat); // We do not support color conversion if (_system->getScreenFormat() != dataPixelFormat) diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index 8eac519d8c..13417b3251 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -55,7 +55,7 @@ Common::Error LureEngine::init() { _initialized = false; _saveLoadAllowed = false; - initGraphics(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT, false); + initGraphics(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT); // Check the version of the lure.dat file Common::File f; diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp index 483281f583..ddc6d90a81 100644 --- a/engines/macventure/macventure.cpp +++ b/engines/macventure/macventure.cpp @@ -146,7 +146,7 @@ void MacVentureEngine::initDebugChannels() { Common::Error MacVentureEngine::run() { debug("MacVenture::MacVentureEngine::init()"); - initGraphics(kScreenWidth, kScreenHeight, true); + initGraphics(kScreenWidth, kScreenHeight); _debugger = new Console(this); diff --git a/engines/made/made.cpp b/engines/made/made.cpp index a29aa2512f..181d778a02 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -292,7 +292,7 @@ Common::Error MadeEngine::run() { syncSoundSettings(); // Initialize backend - initGraphics(320, 200, false); + initGraphics(320, 200); resetAllTimers(); diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 414473bb82..c86593ed0e 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -159,7 +159,7 @@ void MADSEngine::saveOptions() { } Common::Error MADSEngine::run() { - initGraphics(MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT, false); + initGraphics(MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT); initialize(); // Run the game diff --git a/engines/mohawk/cstime_graphics.cpp b/engines/mohawk/cstime_graphics.cpp index 29336525da..7dc1cf339c 100644 --- a/engines/mohawk/cstime_graphics.cpp +++ b/engines/mohawk/cstime_graphics.cpp @@ -32,7 +32,7 @@ namespace Mohawk { CSTimeGraphics::CSTimeGraphics(MohawkEngine_CSTime *vm) : GraphicsManager(), _vm(vm) { _bmpDecoder = new MohawkBitmap(); - initGraphics(640, 480, true); + initGraphics(640, 480); } CSTimeGraphics::~CSTimeGraphics() { diff --git a/engines/mohawk/livingbooks_graphics.cpp b/engines/mohawk/livingbooks_graphics.cpp index fae0c99f6e..bb521eee22 100644 --- a/engines/mohawk/livingbooks_graphics.cpp +++ b/engines/mohawk/livingbooks_graphics.cpp @@ -34,7 +34,7 @@ namespace Mohawk { LBGraphics::LBGraphics(MohawkEngine_LivingBooks *vm, uint16 width, uint16 height) : GraphicsManager(), _vm(vm) { _bmpDecoder = _vm->isPreMohawk() ? new LivingBooksBitmap_v1() : new MohawkBitmap(); - initGraphics(width, height, true); + initGraphics(width, height); } LBGraphics::~LBGraphics() { diff --git a/engines/mohawk/myst_graphics.cpp b/engines/mohawk/myst_graphics.cpp index 9b0d33e30b..3f8d15cea5 100644 --- a/engines/mohawk/myst_graphics.cpp +++ b/engines/mohawk/myst_graphics.cpp @@ -40,13 +40,13 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { if (_vm->getFeatures() & GF_ME) { // High color - initGraphics(_viewport.width(), _viewport.height(), true, nullptr); + initGraphics(_viewport.width(), _viewport.height(), nullptr); if (_vm->_system->getScreenFormat().bytesPerPixel == 1) error("Myst ME requires greater than 256 colors to run"); } else { // Paletted - initGraphics(_viewport.width(), _viewport.height(), true); + initGraphics(_viewport.width(), _viewport.height()); clearScreenPalette(); } diff --git a/engines/mohawk/riven_graphics.cpp b/engines/mohawk/riven_graphics.cpp index c80e9e5899..d0a5c05636 100644 --- a/engines/mohawk/riven_graphics.cpp +++ b/engines/mohawk/riven_graphics.cpp @@ -308,7 +308,7 @@ RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm // Restrict ourselves to a single pixel format to simplify the effects implementation _pixelFormat = Graphics::createPixelFormat<565>(); - initGraphics(608, 436, true, &_pixelFormat); + initGraphics(608, 436, &_pixelFormat); // The actual game graphics only take up the first 392 rows. The inventory // occupies the rest of the screen and we don't use the buffer to hold that. diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 59004cba7f..92d1ca8839 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -247,7 +247,7 @@ void MortevielleEngine::pauseEngineIntern(bool pause) { */ Common::ErrorCode MortevielleEngine::initialize() { // Initialize graphics mode - initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, true); + initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT); // Set up an intermediate screen surface _screenSurface->create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp index 0dc271997b..7fe3e77ccb 100644 --- a/engines/neverhood/neverhood.cpp +++ b/engines/neverhood/neverhood.cpp @@ -65,7 +65,7 @@ NeverhoodEngine::~NeverhoodEngine() { } Common::Error NeverhoodEngine::run() { - initGraphics(640, 480, true); + initGraphics(640, 480); const Common::FSNode gameDataDir(ConfMan.get("path")); diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 162671b68a..b732141971 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -731,7 +731,7 @@ Gfx::Gfx(Parallaction* vm) : _gameType = _vm->getGameType(); _doubleBuffering = _gameType != GType_Nippon; - initGraphics(_vm->_screenWidth, _vm->_screenHeight, _gameType == GType_BRA); + initGraphics(_vm->_screenWidth, _vm->_screenHeight); setPalette(_palette); diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp index 7748c266f5..d620fe3d4e 100644 --- a/engines/pegasus/graphics.cpp +++ b/engines/pegasus/graphics.cpp @@ -35,7 +35,7 @@ namespace Pegasus { GraphicsManager::GraphicsManager(PegasusEngine *vm) : _vm(vm) { - initGraphics(640, 480, true, NULL); + initGraphics(640, 480, nullptr); if (_vm->_system->getScreenFormat().bytesPerPixel == 1) error("No true color mode available"); diff --git a/engines/plumbers/plumbers.cpp b/engines/plumbers/plumbers.cpp index 74f622358b..f0445e51eb 100644 --- a/engines/plumbers/plumbers.cpp +++ b/engines/plumbers/plumbers.cpp @@ -88,7 +88,7 @@ static const byte cursorPalette[] = { }; Common::Error PlumbersGame::run() { - initGraphics(640, 480, true); + initGraphics(640, 480); _console = new Console(this); CursorMan.replaceCursor(MOUSECURSOR_SCI, 11, 16, 0, 0, 0); diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 6be1782f1c..c25157c697 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -31,7 +31,7 @@ namespace Prince { GraphicsMan::GraphicsMan(PrinceEngine *vm) : _vm(vm), _changed(false) { - initGraphics(640, 480, true); + initGraphics(640, 480); _frontScreen = new Graphics::Surface(); _frontScreen->create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); diff --git a/engines/prince/videoplayer.cpp b/engines/prince/videoplayer.cpp index 2fc9003be5..2e73c78a0d 100644 --- a/engines/prince/videoplayer.cpp +++ b/engines/prince/videoplayer.cpp @@ -30,7 +30,7 @@ namespace Prince { void PrinceEngine::playVideo(Common::String videoFilename) { // Set the correct video mode - initGraphics(640, 480, true, 0); + initGraphics(640, 480, nullptr); if (_system->getScreenFormat().bytesPerPixel == 1) { warning("Couldn't switch to a RGB color video mode to play a video."); return; @@ -42,7 +42,7 @@ void PrinceEngine::playVideo(Common::String videoFilename) { if (!videoDecoder->loadFile(videoFilename)) { delete videoDecoder; warning("Unable to open video %s", videoFilename.c_str()); - initGraphics(640, 480, true); + initGraphics(640, 480); return; } @@ -78,7 +78,7 @@ void PrinceEngine::playVideo(Common::String videoFilename) { delete videoDecoder; - initGraphics(640, 480, true); + initGraphics(640, 480); } } // End of namespace Prince diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 0aea6122ca..16d88ee6f3 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -324,7 +324,7 @@ bool Queen::QueenEngine::hasFeature(EngineFeature f) const { } Common::Error QueenEngine::run() { - initGraphics(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT, false); + initGraphics(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); _resource = new Resource(); diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index ceb86ebb18..79bd66250a 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -40,7 +40,7 @@ namespace Saga { #define RID_IHNM_HOURGLASS_CURSOR 11 // not in demo Gfx::Gfx(SagaEngine *vm, OSystem *system, int width, int height) : _vm(vm), _system(system) { - initGraphics(width, height, width > 320); + initGraphics(width, height); debug(5, "Init screen %dx%d", width, height); // Convert surface data to R surface data diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 75fa60632c..28ed12275f 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -300,7 +300,7 @@ void Console::postEnter() { if (duckMode) { Common::List<Graphics::PixelFormat> formats; formats.push_back(videoDecoder->getPixelFormat()); - initGraphics(640, 480, true, formats); + initGraphics(640, 480, formats); if (g_system->getScreenFormat().bytesPerPixel != videoDecoder->getPixelFormat().bytesPerPixel) error("Could not switch screen format for the duck video"); @@ -316,7 +316,7 @@ void Console::postEnter() { #ifdef ENABLE_SCI32 // Switch back to 8bpp if we played a duck video if (duckMode) - initGraphics(oldWidth, oldHeight, oldWidth > 320); + initGraphics(oldWidth, oldHeight); #endif _engine->_gfxCursor->kernelShow(); diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 1bd886c831..5851b015aa 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -140,7 +140,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { // The only argument is the string for the video // HACK: Switch to 16bpp graphics for Cinepak. - initGraphics(screenWidth, screenHeight, screenWidth > 320, NULL); + initGraphics(screenWidth, screenHeight, nullptr); if (g_system->getScreenFormat().bytesPerPixel == 1) { warning("This video requires >8bpp color to be displayed, but could not switch to RGB color mode"); @@ -176,7 +176,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { // The only known movie to do use this codec is the GK2 demo trailer // If another video turns up that uses Indeo, we may have to add a better // check. - initGraphics(screenWidth, screenHeight, screenWidth > 320, NULL); + initGraphics(screenWidth, screenHeight, nullptr); if (g_system->getScreenFormat().bytesPerPixel == 1) { warning("This video requires >8bpp color to be displayed, but could not switch to RGB color mode"); @@ -206,7 +206,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { // HACK: Switch back to 8bpp if we played a true color video. // We also won't be copying the screen to the SCI screen... if (g_system->getScreenFormat().bytesPerPixel != 1) - initGraphics(screenWidth, screenHeight, screenWidth > 320); + initGraphics(screenWidth, screenHeight); else if (getSciVersion() < SCI_VERSION_2) { g_sci->_gfxScreen->kernelSyncWithFramebuffer(); g_sci->_gfxPalette16->kernelSyncScreenPalette(); diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 7fc92a829d..434c5a0fec 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -80,7 +80,7 @@ GfxFrameout::GfxFrameout(SegManager *segMan, GfxPalette32 *palette, GfxTransitio } else { _currentBuffer.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } - initGraphics(_currentBuffer.w, _currentBuffer.h, _isHiRes); + initGraphics(_currentBuffer.w, _currentBuffer.h); switch (g_sci->getGameId()) { case GID_HOYLE5: diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 55ba631cb7..eddf88f523 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -207,7 +207,7 @@ public: * Resets the pixel format of the hardware surface to the given format. */ void setPixelFormat(const Graphics::PixelFormat &format) const { - initGraphics(_currentBuffer.w, _currentBuffer.h, _isHiRes, &format); + initGraphics(_currentBuffer.w, _currentBuffer.h, &format); } /** diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 1af36677b3..b9cef360dc 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -179,13 +179,13 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { // We add 2 to the height of the icon bar to add a buffer between the screen and the // icon bar (as did the original interpreter). if (g_sci->getGameId() == GID_KQ6) - initGraphics(_displayWidth, _displayHeight + 26 + 2, _displayWidth > 320); + initGraphics(_displayWidth, _displayHeight + 26 + 2); else if (g_sci->getGameId() == GID_FREDDYPHARKAS) - initGraphics(_displayWidth, _displayHeight + 28 + 2, _displayWidth > 320); + initGraphics(_displayWidth, _displayHeight + 28 + 2); else error("Unknown SCI1.1 Mac game"); } else - initGraphics(_displayWidth, _displayHeight, _displayWidth > 320); + initGraphics(_displayWidth, _displayHeight); } GfxScreen::~GfxScreen() { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index aec5773a3b..c06b9de728 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -962,7 +962,7 @@ ScummEngine_vCUPhe::~ScummEngine_vCUPhe() { } Common::Error ScummEngine_vCUPhe::run() { - initGraphics(CUP_Player::kDefaultVideoWidth, CUP_Player::kDefaultVideoHeight, true); + initGraphics(CUP_Player::kDefaultVideoWidth, CUP_Player::kDefaultVideoHeight); if (_cupPlayer->open(_filenamePattern.pattern)) { _cupPlayer->play(); @@ -1247,7 +1247,7 @@ Common::Error ScummEngine::init() { // Initialize backend if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { - initGraphics(kHercWidth, kHercHeight, true); + initGraphics(kHercWidth, kHercHeight); } else { int screenWidth = _screenWidth; int screenHeight = _screenHeight; @@ -1266,7 +1266,7 @@ Common::Error ScummEngine::init() { _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); if (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine) { - initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat); + initGraphics(screenWidth, screenHeight, &_outputPixelFormat); if (_outputPixelFormat != _system->getScreenFormat()) return Common::kUnsupportedColorMode; } else { @@ -1281,7 +1281,7 @@ Common::Error ScummEngine::init() { } } - initGraphics(screenWidth, screenHeight, screenWidth > 320, tryModes); + initGraphics(screenWidth, screenHeight, tryModes); if (_system->getScreenFormat().bytesPerPixel != 2) return Common::kUnsupportedColorMode; } @@ -1298,7 +1298,7 @@ Common::Error ScummEngine::init() { if (_game.platform == Common::kPlatformFMTowns && _game.version == 5) return Common::Error(Common::kUnsupportedColorMode, "This game requires dual graphics layer support which is disabled in this build"); #endif - initGraphics(screenWidth, screenHeight, (screenWidth > 320)); + initGraphics(screenWidth, screenHeight); } } diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index 5050062938..2aa6ae8902 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -251,14 +251,14 @@ ScalpelEngine::~ScalpelEngine() { void ScalpelEngine::setupGraphics() { if (getPlatform() != Common::kPlatform3DO) { // 320x200 palettized - initGraphics(320, 200, false); + initGraphics(320, 200); } else { // 3DO actually uses RGB555, but some platforms of ours only support RGB565, so we use that const Graphics::PixelFormat pixelFormatRGB565 = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); // First try for a 640x400 mode g_system->beginGFXTransaction(); - initCommonGFX(true); + initCommonGFX(); g_system->initSize(640, 400, &pixelFormatRGB565); OSystem::TransactionError gfxError = g_system->endGFXTransaction(); @@ -266,7 +266,7 @@ void ScalpelEngine::setupGraphics() { _isScreenDoubled = true; } else { // System doesn't support it, so fall back on 320x200 mode - initGraphics(320, 200, false, &pixelFormatRGB565); + initGraphics(320, 200, &pixelFormatRGB565); } } } diff --git a/engines/sherlock/tattoo/tattoo.cpp b/engines/sherlock/tattoo/tattoo.cpp index 31a65783e3..38466a9459 100644 --- a/engines/sherlock/tattoo/tattoo.cpp +++ b/engines/sherlock/tattoo/tattoo.cpp @@ -51,7 +51,7 @@ void TattooEngine::showOpening() { } void TattooEngine::initialize() { - initGraphics(640, 480, true); + initGraphics(640, 480); // Initialize the base engine SherlockEngine::initialize(); diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 40b6959a9b..674bfab95b 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -259,7 +259,7 @@ Common::Error SkyEngine::go() { } Common::Error SkyEngine::init() { - initGraphics(320, 200, false); + initGraphics(320, 200); _skyDisk = new Disk(); _skySound = new Sound(_mixer, _skyDisk, Audio::Mixer::kMaxChannelVolume); diff --git a/engines/sludge/graphics.cpp b/engines/sludge/graphics.cpp index 3bcb5aa043..578e6f65fe 100644 --- a/engines/sludge/graphics.cpp +++ b/engines/sludge/graphics.cpp @@ -143,7 +143,7 @@ void GraphicsManager::kill() { } bool GraphicsManager::initGfx() { - initGraphics(_winWidth, _winHeight, true, _vm->getScreenPixelFormat()); + initGraphics(_winWidth, _winHeight, _vm->getScreenPixelFormat()); _renderSurface.create(_winWidth, _winHeight, *_vm->getScreenPixelFormat()); if (!killResizeBackdrop(_winWidth, _winHeight)) diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index ac358e774b..e58eb97c23 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -191,12 +191,12 @@ bool MoviePlayer::load(uint32 id) { // Need to switch to true color for PSX/MP2 videos if (_decoderType == kVideoDecoderPSX || _decoderType == kVideoDecoderMP2) - initGraphics(g_system->getWidth(), g_system->getHeight(), true, 0); + initGraphics(g_system->getWidth(), g_system->getHeight(), nullptr); if (!_decoder->loadFile(filename)) { // Go back to 8bpp color if (_decoderType == kVideoDecoderPSX || _decoderType == kVideoDecoderMP2) - initGraphics(g_system->getWidth(), g_system->getHeight(), true); + initGraphics(g_system->getWidth(), g_system->getHeight()); return false; } @@ -422,7 +422,7 @@ bool MoviePlayer::playVideo() { // Need to jump back to paletted color if (_decoderType == kVideoDecoderPSX || _decoderType == kVideoDecoderMP2) - initGraphics(g_system->getWidth(), g_system->getHeight(), true); + initGraphics(g_system->getWidth(), g_system->getHeight()); return !_vm->shouldQuit() && !skipped; } diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 1e7b6da4f4..8b12fef9aa 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -94,7 +94,7 @@ SwordEngine::~SwordEngine() { Common::Error SwordEngine::init() { - initGraphics(640, 480, true); + initGraphics(640, 480); if (0 == scumm_stricmp(ConfMan.get("gameid").c_str(), "sword1mac") || 0 == scumm_stricmp(ConfMan.get("gameid").c_str(), "sword1macdemo")) diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index e93f27f76c..d25133fe99 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -103,12 +103,12 @@ bool MoviePlayer::load(const char *name) { // Need to switch to true color for PSX/MP2 videos if (_decoderType == kVideoDecoderPSX || _decoderType == kVideoDecoderMP2) - initGraphics(g_system->getWidth(), g_system->getHeight(), true, 0); + initGraphics(g_system->getWidth(), g_system->getHeight(), nullptr); if (!_decoder->loadFile(filename)) { // Go back to 8bpp color if (_decoderType == kVideoDecoderPSX || _decoderType == kVideoDecoderMP2) - initGraphics(g_system->getWidth(), g_system->getHeight(), true); + initGraphics(g_system->getWidth(), g_system->getHeight()); return false; } @@ -145,7 +145,7 @@ void MoviePlayer::play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadI // Need to jump back to paletted color if (_decoderType == kVideoDecoderPSX || _decoderType == kVideoDecoderMP2) - initGraphics(640, 480, true); + initGraphics(640, 480); } void MoviePlayer::openTextObject(uint32 index) { diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 4f3caa437e..a2761eb5ce 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -442,7 +442,7 @@ Common::Error Sword2Engine::run() { _resman = NULL; _memory = NULL; - initGraphics(640, 480, true); + initGraphics(640, 480); _screen = new Screen(this, 640, 480); // Create the debugger as early as possible (but not before the diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp index b6f2641714..9d8d02ef68 100644 --- a/engines/sword25/sword25.cpp +++ b/engines/sword25/sword25.cpp @@ -97,7 +97,7 @@ Common::Error Sword25Engine::run() { Common::Error Sword25Engine::appStart() { // Initialize the graphics mode to RGBA8888 Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); - initGraphics(800, 600, true, &format); + initGraphics(800, 600, &format); if (format != g_system->getScreenFormat()) return Common::kUnsupportedColorMode; diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 2d10b82f51..d5777bb3dc 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -540,7 +540,7 @@ Common::Error TeenAgentEngine::run() { Common::EventManager *_event = _system->getEventManager(); - initGraphics(kScreenWidth, kScreenHeight, false); + initGraphics(kScreenWidth, kScreenHeight); console = new Console(this); scene = new Scene(this); diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index b6364c98ad..6e14fc0ec8 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -185,7 +185,7 @@ void TestbedEngine::invokeTestsuites(TestbedConfigManager &cfMan) { Common::Error TestbedEngine::run() { // Initialize graphics using following: - initGraphics(320, 200, false); + initGraphics(320, 200); // As of now we are using GUI::MessageDialog for interaction, Test if it works. // interactive mode could also be modified by a config parameter "non-interactive=1" diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 8ad177abbb..76a8325879 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -900,13 +900,13 @@ Common::Error TinselEngine::run() { // Initialize backend if (getGameID() == GID_DW2) { #ifndef DW2_EXACT_SIZE - initGraphics(640, 480, true); + initGraphics(640, 480); #else - initGraphics(640, 432, true); + initGraphics(640, 432); #endif _screenSurface.create(640, 432, Graphics::PixelFormat::createFormatCLUT8()); } else { - initGraphics(320, 200, false); + initGraphics(320, 200); _screenSurface.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } diff --git a/engines/titanic/support/direct_draw.cpp b/engines/titanic/support/direct_draw.cpp index 9559480a3b..4fd34f9791 100644 --- a/engines/titanic/support/direct_draw.cpp +++ b/engines/titanic/support/direct_draw.cpp @@ -40,7 +40,7 @@ void DirectDraw::setDisplayMode(int width, int height, int bpp, int refreshRate) assert(bpp == 16); Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); - initGraphics(width, height, true, &pixelFormat); + initGraphics(width, height, &pixelFormat); } void DirectDraw::diagnostics() { diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp index c91f51bade..5ec3595196 100644 --- a/engines/toltecs/toltecs.cpp +++ b/engines/toltecs/toltecs.cpp @@ -70,7 +70,7 @@ ToltecsEngine::~ToltecsEngine() { } Common::Error ToltecsEngine::run() { - initGraphics(640, 400, true); + initGraphics(640, 400); _isSaveAllowed = true; diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index d312d58091..05853e606e 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -54,7 +54,7 @@ RMWindow::~RMWindow() { */ void RMWindow::init() { Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); - initGraphics(RM_SX, RM_SY, true, &pixelFormat); + initGraphics(RM_SX, RM_SY, &pixelFormat); reset(); } diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index dc1c515e1c..05192ae65e 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -1116,7 +1116,7 @@ Common::Error ToonEngine::run() { if (!loadToonDat()) return Common::kUnknownError; - initGraphics(TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT, true); + initGraphics(TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT); init(); // do we need to load directly a game? diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index bb21f399c6..15bcbbc0fc 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -199,7 +199,7 @@ ToucheEngine::~ToucheEngine() { } Common::Error ToucheEngine::run() { - initGraphics(kScreenWidth, kScreenHeight, true); + initGraphics(kScreenWidth, kScreenHeight); Graphics::setupFont(_language); diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 9b393132d9..417652da50 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -53,7 +53,7 @@ TSageEngine::TSageEngine(OSystem *system, const tSageGameDescription *gameDesc) } Common::Error TSageEngine::init() { - initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, false); + initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT); return Common::kNoError; } diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index ad455c5ded..08ad6a05e7 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -89,7 +89,7 @@ bool TuckerEngine::hasFeature(EngineFeature f) const { } Common::Error TuckerEngine::run() { - initGraphics(kScreenWidth, kScreenHeight, false); + initGraphics(kScreenWidth, kScreenHeight); syncSoundSettings(); _compressedSound.openFile(); if (_startSlot == -1) diff --git a/engines/util.h b/engines/util.h index 0e7b1e118b..fdac02f005 100644 --- a/engines/util.h +++ b/engines/util.h @@ -30,7 +30,7 @@ /** * Setup the backend's graphics mode. */ -void initCommonGFX(bool defaultTo1XScaler); +void initCommonGFX(); /** * Setup the backend's screen size and graphics mode. @@ -45,8 +45,8 @@ void initCommonGFX(bool defaultTo1XScaler); * Uses the backend's preferred format if graphics format pointer is NULL. * Finds the best compatible format if a list of graphics formats is provided. */ -void initGraphics(int width, int height, bool defaultTo1xScaler); -void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format); -void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList); +void initGraphics(int width, int height); +void initGraphics(int width, int height, const Graphics::PixelFormat *format); +void initGraphics(int width, int height, const Common::List<Graphics::PixelFormat> &formatList); #endif diff --git a/engines/voyeur/screen.cpp b/engines/voyeur/screen.cpp index 4d34078439..e7aadcc0d8 100644 --- a/engines/voyeur/screen.cpp +++ b/engines/voyeur/screen.cpp @@ -54,7 +54,7 @@ Screen::Screen(VoyeurEngine *vm) : Graphics::Screen(), _vm(vm), _drawPtr(&_defau } void Screen::sInitGraphics() { - initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, false); + initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT); create(SCREEN_WIDTH, SCREEN_HEIGHT); clearPalette(); } diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index c5f3673255..4961feca6e 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -106,7 +106,7 @@ WageEngine::~WageEngine() { Common::Error WageEngine::run() { debug("WageEngine::init"); - initGraphics(512, 342, true); + initGraphics(512, 342); // Create debugger console. It requires GFX to be initialized _console = new Console(this); diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp index 05dfb961cb..e68004d1e5 100644 --- a/engines/wintermute/wintermute.cpp +++ b/engines/wintermute/wintermute.cpp @@ -109,7 +109,7 @@ bool WintermuteEngine::hasFeature(EngineFeature f) const { Common::Error WintermuteEngine::run() { // Initialize graphics using following: Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0); - initGraphics(800, 600, true, &format); + initGraphics(800, 600, &format); if (g_system->getScreenFormat() != format) { error("Wintermute currently REQUIRES 32bpp"); } diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index 451afcc198..e2dae4cbf8 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -107,7 +107,7 @@ void XeenEngine::initialize() { _eventData = f.readStream(f.size()); // Set graphics mode - initGraphics(320, 200, false); + initGraphics(320, 200); // If requested, load a savegame instead of showing the intro if (ConfMan.hasKey("save_slot")) { diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index 6a18cf8e1b..9eb6465947 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -401,13 +401,13 @@ void ZVision::initScreen() { ((WINDOW_HEIGHT - workingWindowHeight) / 2) + workingWindowHeight ); - initGraphics(WINDOW_WIDTH, WINDOW_HEIGHT, true, &_screenPixelFormat); + initGraphics(WINDOW_WIDTH, WINDOW_HEIGHT, &_screenPixelFormat); } void ZVision::initHiresScreen() { _renderManager->upscaleRect(_workingWindow); - initGraphics(HIRES_WINDOW_WIDTH, HIRES_WINDOW_HEIGHT, true, &_screenPixelFormat); + initGraphics(HIRES_WINDOW_WIDTH, HIRES_WINDOW_HEIGHT, &_screenPixelFormat); } } // End of namespace ZVision |