summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-30 05:27:32 +0000
committertron <tron@openttd.org>2005-06-30 05:27:32 +0000
commit9d75047211c04cc9cb1eb04fb53ebb1aacf0d326 (patch)
tree820d87a559381f3d0fa23a7bf0763578868b7150 /sdl.c
parent6e72d514b7b353d92379855aa44907d9399c83a7 (diff)
downloadopenttd-9d75047211c04cc9cb1eb04fb53ebb1aacf0d326.tar.xz
(svn r2497) Use a struct array for palette entries instead of a flat byte array
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sdl.c b/sdl.c
index e0f955f7a..b56b36d65 100644
--- a/sdl.c
+++ b/sdl.c
@@ -195,13 +195,12 @@ static SDL_Color pal[256];
static void UpdatePalette(uint start, uint end)
{
uint i;
- byte *b;
- for (i = start, b = _cur_palette + start * 3; i != end; i++, b += 3) {
- pal[i].r = b[0];
- pal[i].g = b[1];
- pal[i].b = b[2];
- pal[i].unused = b[3];
+ for (i = start; i != end; i++) {
+ pal[i].r = _cur_palette[i].r;
+ pal[i].g = _cur_palette[i].g;
+ pal[i].b = _cur_palette[i].b;
+ pal[i].unused = 0;
}
SDL_CALL SDL_SetColors(_sdl_screen, pal, start, end);