aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorBastien Bouclet2011-07-02 22:14:13 +0200
committerBastien Bouclet2011-07-02 22:14:13 +0200
commit0b1cb0ebbb9a3779f8e3d1fb0d3a44252394fe0c (patch)
tree97c1f28a2c4d8e5a5c132c4e0d3a7dda31d635c8 /backends
parent8b896600697d4605a9b23bef148c6a96bb2552a5 (diff)
downloadscummvm-rg350-0b1cb0ebbb9a3779f8e3d1fb0d3a44252394fe0c.tar.gz
scummvm-rg350-0b1cb0ebbb9a3779f8e3d1fb0d3a44252394fe0c.tar.bz2
scummvm-rg350-0b1cb0ebbb9a3779f8e3d1fb0d3a44252394fe0c.zip
SDL: Remove an unnecessary memset
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 3739cb28fc..2d41ecead4 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -157,12 +157,6 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_currentPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256);
_cursorPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256);
- // Init palette with black :
- // SDL 1.2 palettes default to all black,
- // SDL 1.3 palettes default to all white,
- // thus we have to set our own default.
- memset(_currentPalette, 0, sizeof(SDL_Color) * 256);
-
_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
memset(&_mouseCurState, 0, sizeof(_mouseCurState));
@@ -758,7 +752,10 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
error("allocating _screen failed");
#endif
- // Set a default palette. SDL_SetColors does nothing for non indexed surfaces.
+ // SDL 1.2 palettes default to all black,
+ // SDL 1.3 palettes default to all white,
+ // Thus set our own default palette to all black.
+ // SDL_SetColors does nothing for non indexed surfaces.
SDL_SetColors(_screen, _currentPalette, 0, 256);
//