[Scummvm-git-logs] scummvm master -> d1fa1154fe5758fe48928062ff9b43d1bcfc7770

bluegr bluegr at gmail.com
Sun Nov 10 00:25:49 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d1fa1154fe BACKENDS: Fix using fillScreen in non-paletted screen modes


Commit: d1fa1154fe5758fe48928062ff9b43d1bcfc7770
    https://github.com/scummvm/scummvm/commit/d1fa1154fe5758fe48928062ff9b43d1bcfc7770
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-11-10T01:25:46+02:00

Commit Message:
BACKENDS: Fix using fillScreen in non-paletted screen modes

Changed paths:
    backends/base-backend.cpp
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    common/system.h


diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp
index 3e95c3e..9164b8d 100644
--- a/backends/base-backend.cpp
+++ b/backends/base-backend.cpp
@@ -57,7 +57,7 @@ void BaseBackend::initBackend() {
 
 void BaseBackend::fillScreen(uint32 col) {
 	Graphics::Surface *screen = lockScreen();
-	if (screen && screen->getPixels())
-		memset(screen->getPixels(), col, screen->h * screen->pitch);
+	if (screen)
+		screen->fillRect(Common::Rect(screen->w, screen->h), col);
 	unlockScreen();
 }
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 9d11925..f40b84c 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -452,11 +452,6 @@ void OpenGLGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x,
 }
 
 void OpenGLGraphicsManager::fillScreen(uint32 col) {
-	// FIXME: This does not conform to the OSystem specs because fillScreen
-	// is always taking CLUT8 color values and use color indexed mode. This is,
-	// however, plain odd and probably was a forgotten when we introduced
-	// RGB support. Thus, we simply do the "sane" thing here and hope OSystem
-	// gets fixed one day.
 	_gameScreen->fill(col);
 }
 
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 3b2e3ea..7cddd44 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -1610,8 +1610,8 @@ void SurfaceSdlGraphicsManager::unlockScreen() {
 
 void SurfaceSdlGraphicsManager::fillScreen(uint32 col) {
 	Graphics::Surface *screen = lockScreen();
-	if (screen && screen->getPixels())
-		memset(screen->getPixels(), col, screen->h * screen->pitch);
+	if (screen)
+		screen->fillRect(Common::Rect(screen->w, screen->h), col);
 	unlockScreen();
 }
 
diff --git a/common/system.h b/common/system.h
index 0b75d90..0ea9253 100644
--- a/common/system.h
+++ b/common/system.h
@@ -900,10 +900,6 @@ public:
 
 	/**
 	 * Fills the screen with a given color value.
-	 *
-	 * @note We are using uint32 here even though currently
-	 * we only support 8bpp indexed mode. Thus the value should
-	 * be always inside [0, 255] for now.
 	 */
 	virtual void fillScreen(uint32 col) = 0;
 





More information about the Scummvm-git-logs mailing list