summaryrefslogtreecommitdiff
path: root/win32.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 /win32.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 'win32.c')
-rw-r--r--win32.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/win32.c b/win32.c
index e2850c320..498144c7e 100644
--- a/win32.c
+++ b/win32.c
@@ -50,17 +50,16 @@ static void MakePalette(void)
{
LOGPALETTE *pal;
uint i;
- byte *b;
pal = alloca(sizeof(LOGPALETTE) + (256-1) * sizeof(PALETTEENTRY));
pal->palVersion = 0x300;
pal->palNumEntries = 256;
- for (i = 0, b = _cur_palette; i != 256; i++, b += 3) {
- pal->palPalEntry[i].peRed = b[0];
- pal->palPalEntry[i].peGreen = b[1];
- pal->palPalEntry[i].peBlue = b[2];
+ for (i = 0; i != 256; i++) {
+ pal->palPalEntry[i].peRed = _cur_palette[i].r;
+ pal->palPalEntry[i].peGreen = _cur_palette[i].g;
+ pal->palPalEntry[i].peBlue = _cur_palette[i].b;
pal->palPalEntry[i].peFlags = 0;
}