diff options
author | tron <tron@openttd.org> | 2005-06-30 05:27:32 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-06-30 05:27:32 +0000 |
commit | 9d75047211c04cc9cb1eb04fb53ebb1aacf0d326 (patch) | |
tree | 820d87a559381f3d0fa23a7bf0763578868b7150 /sdl.c | |
parent | 6e72d514b7b353d92379855aa44907d9399c83a7 (diff) | |
download | openttd-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.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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); |