https://github.com/libsdl-org/Maelstrom/commit/82e2d8bb5fbd1714a40150be00e1ff818a1c0230
From 82e2d8bb5fbd1714a40150be00e1ff818a1c0230 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 23 Sep 2012 00:45:44 -0700
Subject: [PATCH] Removed obsolete color palette
---
game/init.cpp | 3 +--
screenlib/SDL_FrameBuf.cpp | 17 +----------------
screenlib/SDL_FrameBuf.h | 5 +----
3 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/game/init.cpp b/game/init.cpp
index 9a538119..d25130c9 100644
--- a/game/init.cpp
+++ b/game/init.cpp
@@ -822,8 +822,7 @@ int DoInitializations(Uint32 window_flags, Uint32 render_flags)
if (!InitResolutions(w, h)) {
return(-1);
}
- if (screen->Init(w, h, window_flags, render_flags,
- colors[gGammaCorrect], icon) < 0){
+ if (screen->Init(w, h, window_flags, render_flags, icon) < 0){
error("Fatal: %s\n", screen->Error());
return(-1);
}
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
index 66f4f5e8..71939580 100644
--- a/screenlib/SDL_FrameBuf.cpp
+++ b/screenlib/SDL_FrameBuf.cpp
@@ -43,7 +43,7 @@ FrameBuf:: FrameBuf() : ErrorBase()
int
FrameBuf:: Init(int width, int height, Uint32 window_flags, Uint32 render_flags,
- SDL_Color *colors, SDL_Surface *icon)
+ SDL_Surface *icon)
{
window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, window_flags);
if (!window) {
@@ -90,11 +90,6 @@ FrameBuf:: Init(int width, int height, Uint32 window_flags, Uint32 render_flags,
UpdateWindowSize(width, height);
}
- /* Copy the image colormap */
- if ( colors ) {
- SetPalette(colors);
- }
-
return(0);
}
@@ -111,16 +106,6 @@ FrameBuf:: ~FrameBuf()
}
}
-void
-FrameBuf:: SetPalette(SDL_Color *colors)
-{
- int i;
-
- for ( i=0; i<256; ++i ) {
- image_map[i] = MapRGB(colors[i].r, colors[i].g, colors[i].b);
- }
-}
-
void
FrameBuf::ProcessEvent(SDL_Event *event)
{
diff --git a/screenlib/SDL_FrameBuf.h b/screenlib/SDL_FrameBuf.h
index ab25d185..7fccd5db 100644
--- a/screenlib/SDL_FrameBuf.h
+++ b/screenlib/SDL_FrameBuf.h
@@ -46,12 +46,10 @@ class FrameBuf : public ErrorBase {
public:
FrameBuf();
int Init(int width, int height, Uint32 window_flags, Uint32 render_flags,
- SDL_Color *colors = NULL, SDL_Surface *icon = NULL);
+ SDL_Surface *icon = NULL);
virtual ~FrameBuf();
/* Setup routines */
- /* Set the image palette -- 256 entries */
- void SetPalette(SDL_Color *colors);
/* Map an RGB value to a color pixel */
Uint32 MapRGB(Uint8 R, Uint8 G, Uint8 B) {
return (0xFF000000 | ((Uint32)R << 16) | ((Uint32)G << 8) | B);
@@ -211,7 +209,6 @@ class FrameBuf : public ErrorBase {
SDL_Window *window;
SDL_Renderer *renderer;
SDL_Texture *texture;
- Uint32 image_map[256];
int faded;
SDL_Rect rect;
SDL_Rect clip;