[Scummvm-git-logs] scummvm master -> b3c24b58527ce17c474e0481a8d094e9a9f24dd0
bluegr
noreply at scummvm.org
Fri Apr 10 14:39:09 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b3c24b5852 ZVISION: Support running with different pixel formats
Commit: b3c24b58527ce17c474e0481a8d094e9a9f24dd0
https://github.com/scummvm/scummvm/commit/b3c24b58527ce17c474e0481a8d094e9a9f24dd0
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-04-10T17:39:04+03:00
Commit Message:
ZVISION: Support running with different pixel formats
Changed paths:
engines/zvision/graphics/render_manager.cpp
engines/zvision/graphics/render_manager.h
engines/zvision/scripting/actions.cpp
engines/zvision/zvision.cpp
engines/zvision/zvision.h
diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp
index 5551040828f..ac80308c206 100644
--- a/engines/zvision/graphics/render_manager.cpp
+++ b/engines/zvision/graphics/render_manager.cpp
@@ -74,7 +74,6 @@ RenderManager::RenderManager(ZVision *engine, const ScreenLayout layout, const G
_menuSurface.create(_menuArea.width(), _menuArea.height(), _pixelFormat);
_textSurface.create(_textArea.width(), _textArea.height(), _pixelFormat);
debugC(1, kDebugGraphics, "render manager created");
- initialize(false);
}
RenderManager::~RenderManager() {
@@ -90,7 +89,7 @@ RenderManager::~RenderManager() {
_screen.free();
}
-void RenderManager::initialize(bool hiRes) {
+Common::Error RenderManager::initialize(bool hiRes) {
debugC(1, kDebugGraphics, "Initializing render manager");
_hiRes = hiRes;
@@ -118,8 +117,14 @@ void RenderManager::initialize(bool hiRes) {
} else
debugC(1, kDebugGraphics, "Switching to standard resolution");
#endif
- _screen.create(_screenArea.width(), _screenArea.height(), _engine->_screenPixelFormat);
- _screen.setTransparentColor((uint32)-1);
+
+ // Set hardware/window resolution
+ initGraphics(_screenArea.width(), _screenArea.height(), nullptr);
+
+ if (g_system->getScreenFormat().isCLUT8())
+ return Common::kUnsupportedColorMode;
+
+ _screen.create(_screenArea.width(), _screenArea.height(), g_system->getScreenFormat());
_screen.clear();
debugC(1, kDebugGraphics, "_workingAreaCenter = %d,%d", _workingAreaCenter.x, _workingAreaCenter.y);
@@ -154,11 +159,10 @@ void RenderManager::initialize(bool hiRes) {
clearTextSurface(true);
debugC(2, kDebugGraphics, "Backbuffers cleared");
- // Set hardware/window resolution
- debugC(1, kDebugGraphics, "_screen.w = %d, _screen.h = %d", _screen.w, _screen.h);
- initGraphics(_screen.w, _screen.h, &_engine->_screenPixelFormat);
_frameLimiter.initialize();
debugC(1, kDebugGraphics, "Render manager initialized");
+
+ return Common::kNoError;
}
bool RenderManager::renderSceneToScreen(bool immediate, bool overlayOnly, bool preStream) {
diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h
index 175f580888a..de40463523e 100644
--- a/engines/zvision/graphics/render_manager.h
+++ b/engines/zvision/graphics/render_manager.h
@@ -160,7 +160,7 @@ private:
bool _widescreen;
public:
- void initialize(bool hiRes = false);
+ Common::Error initialize(bool hiRes = false);
/**
* Renders the scene to the screen
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index 8905a633994..66cd83afabf 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -1140,6 +1140,7 @@ bool ActionStreamVideo::execute() {
_engine->getCursorManager()->showMouse(false);
if (switchToHires) {
+ // TODO: Check if 800x600 is supported, and fall back if not
_engine->getRenderManager()->initialize(true);
srcRect = Common::Rect(Common::Point(0, 69), 720, 344);
// ZGI hi-res video resolution = 720x480, with baked-in letterboxing around content at 720x344 (origin 0,69), interestingly conforming to playfield vertical resolution of 344
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index d2d8beaab1f..7fb93d2c5fd 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -89,7 +89,6 @@ ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
: Engine(syst),
_gameDescription(gameDesc),
_resourcePixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), /* RGB 555 */
- _screenPixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), /* RGB 565 */
_clock(_system),
_scriptManager(nullptr),
_renderManager(nullptr),
@@ -180,7 +179,7 @@ void ZVision::saveSettings() {
ConfMan.flushToDisk();
}
-void ZVision::initialize() {
+Common::Error ZVision::initialize() {
// Graphics
_widescreen = ConfMan.getBool("widescreen");
_doubleFPS = ConfMan.getBool("doublefps");
@@ -225,7 +224,9 @@ void ZVision::initialize() {
// Initialize the managers
- _renderManager->initialize();
+ Common::Error err = _renderManager->initialize();
+ if (err.getCode() != Common::kNoError)
+ return err;
_cursorManager->initialize();
_scriptManager->initialize();
_stringManager->initialize(getGameId());
@@ -246,12 +247,16 @@ void ZVision::initialize() {
getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this, "zvisionFPS");
// Ensure a new game is launched with correct panorama quality setting
_scriptManager->setStateValue(StateKey_HighQuality, ConfMan.getBool("highquality"));
+
+ return Common::kNoError;
}
extern const FontStyle getSystemFont(int fontIndex);
Common::Error ZVision::run() {
- initialize();
+ Common::Error err = initialize();
+ if (err.getCode() != Common::kNoError)
+ return err;
// Check if a saved game is to be loaded from the launcher
if (ConfMan.hasKey("save_slot"))
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 2bb22828419..d19325fdcf0 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -129,7 +129,6 @@ public:
public:
const Graphics::PixelFormat _resourcePixelFormat;
- const Graphics::PixelFormat _screenPixelFormat;
private:
const ZVisionGameDescription *_gameDescription;
@@ -285,7 +284,7 @@ public:
}
private:
- void initialize();
+ Common::Error initialize();
void initFonts();
void initializePath(const Common::FSNode &gamePath) override;
More information about the Scummvm-git-logs
mailing list