diff options
author | Colin Snover | 2016-07-28 14:49:13 -0500 |
---|---|---|
committer | Colin Snover | 2016-08-19 13:57:40 -0500 |
commit | 9bfeb3c297a7868c53d4c37775148067d72f44c0 (patch) | |
tree | 1e8b4fcc44824122de9efd4f4b5c2c6b9204bff6 /engines/sci/graphics | |
parent | 97be9aa6dc204843f4a896f7e12f6cabc4322b44 (diff) | |
download | scummvm-rg350-9bfeb3c297a7868c53d4c37775148067d72f44c0.tar.gz scummvm-rg350-9bfeb3c297a7868c53d4c37775148067d72f44c0.tar.bz2 scummvm-rg350-9bfeb3c297a7868c53d4c37775148067d72f44c0.zip |
SCI32: Remove GfxScreen from GfxFrameout
Only cursor remains to be updated to go through GfxFrameout, and
then we can let GfxScreen go back to being SCI16-only.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 22 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.h | 8 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 28 |
3 files changed, 21 insertions, 37 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 21ffb5f937..7661fe5be2 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -29,6 +29,7 @@ #include "common/system.h" #include "common/textconsole.h" #include "engines/engine.h" +#include "engines/util.h" #include "graphics/palette.h" #include "graphics/surface.h" @@ -55,31 +56,36 @@ namespace Sci { -GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette32 *palette, GfxTransitions32 *transitions) : +GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxPalette32 *palette, GfxTransitions32 *transitions) : _isHiRes(ConfMan.getBool("enable_high_resolution_graphics")), _palette(palette), _resMan(resMan), - _screen(screen), _segMan(segMan), _transitions(transitions), _benchmarkingFinished(false), _throttleFrameOut(true), _throttleState(0), - // TODO: Stop using _gfxScreen - _currentBuffer(screen->getDisplayWidth(), screen->getDisplayHeight(), nullptr), _remapOccurred(false), _frameNowVisible(false), - _screenRect(screen->getDisplayWidth(), screen->getDisplayHeight()), _overdrawThreshold(0), _palMorphIsOn(false) { - _currentBuffer.setPixels(calloc(1, screen->getDisplayWidth() * screen->getDisplayHeight())); - // QFG4 is the only SCI32 game that doesn't have a high-resolution toggle if (g_sci->getGameId() == GID_QFG4) { _isHiRes = false; } + if (g_sci->getGameId() == GID_PHANTASMAGORIA) { + _currentBuffer = Buffer(630, 450, nullptr); + } else if (_isHiRes) { + _currentBuffer = Buffer(640, 480, nullptr); + } else { + _currentBuffer = Buffer(320, 200, nullptr); + } + _currentBuffer.setPixels(calloc(1, _currentBuffer.screenWidth * _currentBuffer.screenHeight)); + _screenRect = Common::Rect(_currentBuffer.screenWidth, _currentBuffer.screenHeight); + initGraphics(_currentBuffer.screenWidth, _currentBuffer.screenHeight, _isHiRes); + switch (g_sci->getGameId()) { case GID_HOYLE5: case GID_GK2: @@ -559,7 +565,7 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, PlaneShowStyle *show int16 prevRoom = g_sci->getEngineState()->variables[VAR_GLOBAL][12].toSint16(); - Common::Rect rect(_screen->getDisplayWidth(), _screen->getDisplayHeight()); + Common::Rect rect(_currentBuffer.screenWidth, _currentBuffer.screenHeight); _showList.add(rect); showBits(); diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 012ecf9e64..8107316371 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -31,7 +31,6 @@ typedef Common::Array<DrawList> ScreenItemListList; typedef Common::Array<RectList> EraseListList; class GfxCoordAdjuster32; -class GfxScreen; class GfxTransitions32; struct PlaneShowStyle; @@ -44,13 +43,14 @@ private: GfxCoordAdjuster32 *_coordAdjuster; GfxPalette32 *_palette; ResourceManager *_resMan; - GfxScreen *_screen; SegManager *_segMan; public: - GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette32 *palette, GfxTransitions32 *transitions); + GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxPalette32 *palette, GfxTransitions32 *transitions); ~GfxFrameout(); + bool _isHiRes; + void clear(); void syncWithScripts(bool addElements); // this is what Game::restore does, only needed when our ScummVM dialogs are patched in void run(); @@ -308,8 +308,6 @@ private: } public: - bool _isHiRes; - /** * Whether palMorphFrameOut should be used instead of * frameOut for rendering. Used by kMorphOn to diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index c977a93817..8e638b9cad 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -30,6 +30,9 @@ #include "sci/engine/state.h" #include "sci/graphics/screen.h" #include "sci/graphics/view.h" +#ifdef ENABLE_SCI32 +#include "sci/graphics/frameout.h" +#endif namespace Sci { @@ -53,12 +56,6 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { if ((g_sci->getPlatform() == Common::kPlatformWindows) || (g_sci->forceHiresGraphics())) { if (g_sci->getGameId() == GID_KQ6) _upscaledHires = GFX_SCREEN_UPSCALED_640x440; -#ifdef ENABLE_SCI32 - if (g_sci->getGameId() == GID_GK1) - _upscaledHires = GFX_SCREEN_UPSCALED_640x480; - if (g_sci->getGameId() == GID_PQ4) - _upscaledHires = GFX_SCREEN_UPSCALED_640x480; -#endif } // Japanese versions of games use hi-res font on upscaled version of the game. @@ -90,28 +87,11 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { } } -#ifdef ENABLE_SCI32 - // GK1 Mac uses a 640x480 resolution too - if (g_sci->getPlatform() == Common::kPlatformMacintosh) { - if (g_sci->getGameId() == GID_GK1) - _upscaledHires = GFX_SCREEN_UPSCALED_640x480; - } -#endif - if (_resMan->detectHires()) { _scriptWidth = 640; _scriptHeight = 480; } -#ifdef ENABLE_SCI32 - // Phantasmagoria 1 effectively outputs 630x450 - // Coordinate translation has to use this resolution as well - if (g_sci->getGameId() == GID_PHANTASMAGORIA) { - _width = 630; - _height = 450; - } -#endif - // if not yet set, set those to script-width/height if (!_width) _width = _scriptWidth; @@ -212,7 +192,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { initGraphics(_displayWidth, _displayHeight + 28 + 2, _displayWidth > 320); else error("Unknown SCI1.1 Mac game"); - } else + } else if (getSciVersion() < SCI_VERSION_2) initGraphics(_displayWidth, _displayHeight, _displayWidth > 320); } |