aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 16:23:15 +0200
committerJohannes Schickel2011-04-17 16:24:37 +0200
commit7ac3ae108a69587693e0820cde43a63c34a186ec (patch)
treec3004c8f20548e63bacc813f0a55bdca2b39d4aa /backends/graphics
parent4fd3e3d6fe72b6b978fbc5e9e0b5218741d15c83 (diff)
downloadscummvm-rg350-7ac3ae108a69587693e0820cde43a63c34a186ec.tar.gz
scummvm-rg350-7ac3ae108a69587693e0820cde43a63c34a186ec.tar.bz2
scummvm-rg350-7ac3ae108a69587693e0820cde43a63c34a186ec.zip
BACKEND: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 4ac2747d25..968c85b998 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -617,7 +617,7 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int
// Allocate space for cursor data
if (_cursorData.w != w || _cursorData.h != h ||
_cursorData.bytesPerPixel != _cursorFormat.bytesPerPixel)
- _cursorData.create(w, h, _cursorFormat.bytesPerPixel);
+ _cursorData.create(w, h, _cursorFormat);
// Save cursor data
memcpy(_cursorData.pixels, buf, h * _cursorData.pitch);
@@ -1175,9 +1175,9 @@ void OpenGLGraphicsManager::loadTextures() {
_oldVideoMode.screenHeight != _videoMode.screenHeight)
_screenData.create(_videoMode.screenWidth, _videoMode.screenHeight,
#ifdef USE_RGB_COLOR
- _screenFormat.bytesPerPixel
+ _screenFormat
#else
- 1
+ Graphics::PixelFormat::createFormatCLUT8()
#endif
);
@@ -1185,7 +1185,7 @@ void OpenGLGraphicsManager::loadTextures() {
if (_oldVideoMode.overlayWidth != _videoMode.overlayWidth ||
_oldVideoMode.overlayHeight != _videoMode.overlayHeight)
_overlayData.create(_videoMode.overlayWidth, _videoMode.overlayHeight,
- _overlayFormat.bytesPerPixel);
+ _overlayFormat);
_screenNeedsRedraw = true;
_overlayNeedsRedraw = true;
@@ -1387,7 +1387,7 @@ void OpenGLGraphicsManager::updateOSD() {
const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont);
if (_osdSurface.w != _osdTexture->getWidth() || _osdSurface.h != _osdTexture->getHeight())
- _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), 2);
+ _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), _overlayFormat);
else
// Clear everything
memset(_osdSurface.pixels, 0, _osdSurface.h * _osdSurface.pitch);