diff options
author | Johannes Schickel | 2011-02-19 21:42:34 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-19 21:46:45 +0100 |
commit | e21d6e0d1120e917a4a019a4070ec4db5e988b9b (patch) | |
tree | 1142828b72ccf17d513c621e108d749f148fd32b /backends/graphics/opengl | |
parent | 32d0e4c15fb33f80db194087850466664a43516a (diff) | |
parent | b26f30b98793c522265a3eeb48fb3b41034663c6 (diff) | |
download | scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.gz scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.bz2 scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.zip |
Merge branch 'osystem-palette' of https://github.com/lordhoto/scummvm into master
Conflicts:
backends/platform/android/android.cpp
engines/sci/graphics/screen.cpp
engines/sci/graphics/transitions.cpp
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index a1b2e00f51..beac2f6d3e 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -62,8 +62,8 @@ OpenGLGraphicsManager::OpenGLGraphicsManager() _videoMode.fullscreen = ConfMan.getBool("fullscreen"); _videoMode.antialiasing = false; - _gamePalette = (byte *)calloc(sizeof(byte) * 4, 256); - _cursorPalette = (byte *)calloc(sizeof(byte) * 4, 256); + _gamePalette = (byte *)calloc(sizeof(byte) * 3, 256); + _cursorPalette = (byte *)calloc(sizeof(byte) * 3, 256); } OpenGLGraphicsManager::~OpenGLGraphicsManager() { @@ -314,7 +314,7 @@ void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) #endif // Save the screen palette - memcpy(_gamePalette + start * 4, colors, num * 4); + memcpy(_gamePalette + start * 3, colors, num * 3); _screenNeedsRedraw = true; @@ -330,7 +330,7 @@ void OpenGLGraphicsManager::grabPalette(byte *colors, uint start, uint num) { #endif // Copies current palette to buffer - memcpy(colors, _gamePalette + start * 4, num * 4); + memcpy(colors, _gamePalette + start * 3, num * 3); } void OpenGLGraphicsManager::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { @@ -580,7 +580,7 @@ void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uin assert(colors); // Save the cursor palette - memcpy(_cursorPalette + start * 4, colors, num * 4); + memcpy(_cursorPalette + start * 3, colors, num * 3); _cursorPaletteDisabled = false; _cursorNeedsRedraw = true; @@ -686,9 +686,9 @@ void OpenGLGraphicsManager::refreshGameScreen() { byte *dst = surface; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { - dst[0] = _gamePalette[src[j] * 4]; - dst[1] = _gamePalette[src[j] * 4 + 1]; - dst[2] = _gamePalette[src[j] * 4 + 2]; + dst[0] = _gamePalette[src[j] * 3]; + dst[1] = _gamePalette[src[j] * 3 + 1]; + dst[2] = _gamePalette[src[j] * 3 + 2]; dst += 3; } src += _screenData.pitch; @@ -728,9 +728,9 @@ void OpenGLGraphicsManager::refreshOverlay() { byte *dst = surface; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { - dst[0] = _gamePalette[src[j] * 4]; - dst[1] = _gamePalette[src[j] * 4 + 1]; - dst[2] = _gamePalette[src[j] * 4 + 2]; + dst[0] = _gamePalette[src[j] * 3]; + dst[1] = _gamePalette[src[j] * 3 + 1]; + dst[2] = _gamePalette[src[j] * 3 + 2]; dst += 3; } src += _screenData.pitch; @@ -772,9 +772,9 @@ void OpenGLGraphicsManager::refreshCursor() { for (int i = 0; i < _cursorState.w * _cursorState.h; i++) { // Check for keycolor if (src[i] != _cursorKeyColor) { - dst[0] = palette[src[i] * 4]; - dst[1] = palette[src[i] * 4 + 1]; - dst[2] = palette[src[i] * 4 + 2]; + dst[0] = palette[src[i] * 3]; + dst[1] = palette[src[i] * 3 + 1]; + dst[2] = palette[src[i] * 3 + 2]; dst[3] = 255; } dst += 4; |