From 432fd522d243f0779d2ebf99e8983dbb95cdd175 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 1 Oct 2017 00:56:01 -0500 Subject: [PATCH] ENGINES: Remove default1x scaler flag This flag is removed for a few reasons: * Engines universally set this flag to true for widths > 320, which made it redundant everywhere; * This flag functioned primarily as a "force 1x scaler" flag, since its behaviour was almost completely undocumented and users would need to figure out that they'd need an explicit non-default scaler set to get a scaler to operate at widths > 320; * (Most importantly) engines should not be in the business of deciding how the backend may choose to render its virtual screen. The choice of rendering behaviour belongs to the user, and the backend, in that order. A nearby future commit restores the default1x scaler behaviour in the SDL backend code for the moment, but in the future it is my hope that there will be a better configuration UI to allow users to specify how they want scaling to work for high resolutions. --- .../surfacesdl/surfacesdl-graphics.cpp | 2 - .../graphics/surfacesdl/surfacesdl-graphics.h | 1 - engines/access/access.cpp | 2 +- engines/adl/adl.cpp | 2 +- engines/agi/graphics.cpp | 2 +- engines/agos/agos.cpp | 2 +- engines/avalanche/graphics.cpp | 6 +-- engines/bbvs/bbvs.cpp | 2 +- engines/bbvs/videoplayer.cpp | 4 +- engines/bladerunner/bladerunner.cpp | 2 +- engines/cge/cge.cpp | 2 +- engines/cge2/cge2.cpp | 2 +- engines/chewy/chewy.cpp | 4 +- engines/cine/cine.cpp | 4 +- engines/composer/composer.cpp | 2 +- engines/cruise/cruise.cpp | 2 +- engines/cryo/cryo.cpp | 2 +- engines/director/graphics.cpp | 2 +- engines/director/score.cpp | 2 +- engines/dm/dm.cpp | 2 +- engines/draci/draci.cpp | 2 +- engines/drascula/drascula.cpp | 2 +- engines/dreamweb/titles.cpp | 4 +- engines/dreamweb/vgagrafx.cpp | 2 +- engines/engine.cpp | 46 +++++-------------- engines/fullpipe/fullpipe.cpp | 2 +- engines/gnap/gnap.cpp | 2 +- engines/gob/gob.cpp | 4 +- engines/gob/inter_v2.cpp | 4 +- engines/gob/inter_v5.cpp | 4 +- engines/gob/video.cpp | 6 +-- engines/gob/video.h | 2 +- engines/groovie/groovie.cpp | 4 +- engines/hopkins/graphics.cpp | 2 +- engines/hugo/hugo.cpp | 2 +- engines/kyra/screen.cpp | 4 +- engines/lab/lab.cpp | 4 +- engines/lastexpress/lastexpress.cpp | 2 +- engines/lure/lure.cpp | 2 +- engines/macventure/macventure.cpp | 2 +- engines/made/made.cpp | 2 +- engines/mads/mads.cpp | 2 +- engines/mohawk/cstime_graphics.cpp | 2 +- engines/mohawk/livingbooks_graphics.cpp | 2 +- engines/mohawk/myst_graphics.cpp | 4 +- engines/mohawk/riven_graphics.cpp | 2 +- engines/mortevielle/mortevielle.cpp | 2 +- engines/neverhood/neverhood.cpp | 2 +- engines/parallaction/graphics.cpp | 2 +- engines/pegasus/graphics.cpp | 2 +- engines/plumbers/plumbers.cpp | 2 +- engines/prince/graphics.cpp | 2 +- engines/prince/videoplayer.cpp | 6 +-- engines/queen/queen.cpp | 2 +- engines/saga/gfx.cpp | 2 +- engines/sci/console.cpp | 4 +- engines/sci/engine/kvideo.cpp | 6 +-- engines/sci/graphics/frameout.cpp | 2 +- engines/sci/graphics/frameout.h | 2 +- engines/sci/graphics/screen.cpp | 6 +-- engines/scumm/scumm.cpp | 10 ++-- engines/sherlock/scalpel/scalpel.cpp | 6 +-- engines/sherlock/tattoo/tattoo.cpp | 2 +- engines/sky/sky.cpp | 2 +- engines/sludge/graphics.cpp | 2 +- engines/sword1/animation.cpp | 6 +-- engines/sword1/sword1.cpp | 2 +- engines/sword2/animation.cpp | 6 +-- engines/sword2/sword2.cpp | 2 +- engines/sword25/sword25.cpp | 2 +- engines/teenagent/teenagent.cpp | 2 +- engines/testbed/testbed.cpp | 2 +- engines/tinsel/tinsel.cpp | 6 +-- engines/titanic/support/direct_draw.cpp | 2 +- engines/toltecs/toltecs.cpp | 2 +- engines/tony/window.cpp | 2 +- engines/toon/toon.cpp | 2 +- engines/touche/touche.cpp | 2 +- engines/tsage/tsage.cpp | 2 +- engines/tucker/tucker.cpp | 2 +- engines/util.h | 8 ++-- engines/voyeur/screen.cpp | 2 +- engines/wage/wage.cpp | 2 +- engines/wintermute/wintermute.cpp | 2 +- engines/xeen/xeen.cpp | 2 +- engines/zvision/zvision.cpp | 4 +- 86 files changed, 132 insertions(+), 159 deletions(-) diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index cd7e11b32d9..0e802f62578 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 532399ed661..e93cf410eac 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 ea2144459da..1855280a248 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 61890af37a0..9370363a3ff 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 fa1f11cce4e..119ccfea1d8 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 48b170da75e..108d5a94d75 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 03c9e9e3cb9..6ce6ef26036 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 e4dcb1a84b7..74518d5a3e0 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 2ab5c1556b1..f48c98005e2 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 1d29bde75fd..0c5dabe136a 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 7058314b9d5..32126835f87 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 ee62e20ac62..04b9db14c46 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 9df45b1dfba..75c2a8d51bc 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 414fe49eb6b..777cbe279fd 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 13ba76191bb..a04f4b650b1 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 eebd8fdc156..df525c07918 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 35741050534..52fb2ae8d23 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 46dab0f7639..3f9a5383b1a 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 350fccb176f..30cbe1d4c34 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 8fdb1c8d885..4c19ab01dfc 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 e3a97bf59ac..0de1121d91b 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 56a2d638f7b..d0d2790c0e8 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 bd0957c1bda..f0b77b96910 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 4a7acd23445..aa58352e814 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 bb51e77f0db..bb07f5f722c 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 backend, Commo } -void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List &formatList) { +void initGraphics(int width, int height, const Common::List &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 61e7eef6928..ad9b6a42f6d 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 92890530487..cf8710c64d6 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 605f1ed5b97..c9eaec9ef05 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 3928985dcd4..1e8eddeef06 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 50176e0a278..91342cf3267 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 1dc51d994c1..6480fe89f07 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 2c547baca0d..57ec4fb6d4c 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 2ba4ed18abe..291e3a1fdea 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 7227c3e8332..3cdf6add8f9 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 6881278cee9..5f6892bd208 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 eaa074ff0a5..60768798769 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 39b2feb93d7..ee67d3a99d6 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 90b684ab0bc..91f8a6a3467 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 8eac519d8c5..13417b32511 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 483281f5836..ddc6d90a81c 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 a29aa2512fc..181d778a025 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 414473bb82f..c86593ed0ef 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 29336525da2..7dc1cf339c4 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 fae0c99f6ec..bb521eee221 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 9b0d33e30b6..3f8d15cea5e 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 c80e9e5899a..d0a5c056367 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 59004cba7ff..92d1ca88396 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 0dc271997b1..7fe3e77ccba 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 162671b68ae..b732141971c 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 7748c266f57..d620fe3d4e5 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 74f622358bc..f0445e51eb0 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 6be1782f1ca..c25157c697d 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 2fc9003be5d..2e73c78a0dc 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 0aea6122cac..16d88ee6f34 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 ceb86ebb18a..79bd66250ae 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 75fa60632c2..28ed12275f0 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -300,7 +300,7 @@ void Console::postEnter() { if (duckMode) { Common::List 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 1bd886c8311..5851b015aa0 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 7fc92a829dc..434c5a0fecc 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 55ba631cb77..eddf88f5230 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 1af36677b31..b9cef360dc8 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 aec5773a3ba..c06b9de7284 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 5050062938b..2aa6ae8902b 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 31a65783e3b..38466a9459f 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 40b6959a9bd..674bfab95b1 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 3bcb5aa0433..578e6f65fe9 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 ac358e774bc..e58eb97c231 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 1e7b6da4f4b..8b12fef9aa1 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 e93f27f76c9..d25133fe995 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 4f3caa437ed..a2761eb5cea 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 b6f26417146..9d8d02ef686 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 2d10b82f519..d5777bb3dc3 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 b6364c98ada..6e14fc0ec85 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 8ad177abbba..76a83258790 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 9559480a3b5..4fd34f9791c 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 c91f51bade6..5ec35951960 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 d312d580910..05853e606ea 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 dc1c515e1c0..05192ae65ee 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 bb21f399c60..15bcbbc0fc1 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 9b393132d91..417652da505 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 ad455c5ded8..08ad6a05e71 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 0e7b1e118b3..fdac02f005d 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 &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 &formatList); #endif diff --git a/engines/voyeur/screen.cpp b/engines/voyeur/screen.cpp index 4d34078439c..e7aadcc0d82 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 c5f3673255f..4961feca6e1 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 05dfb961cbf..e68004d1e54 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 451afcc1987..e2dae4cbf88 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 6a18cf8e1b3..9eb6465947c 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