summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-17 15:43:04 +0100
committerMichael Lutz <michi@icosahedron.de>2021-01-17 19:57:36 +0100
commit49df9c415595a7aa104ff5463372118ec874a4c2 (patch)
tree38231f0fc0714c6d2d1a0690c12635dd4a59d1ba /src
parent881d17d8f1e48949e62326ed112fc45d861c3aa6 (diff)
downloadopenttd-49df9c415595a7aa104ff5463372118ec874a4c2.tar.xz
Codechange: [Win32] Use _local_palette for most operations
Other drivers do this too, and this makes the world a bit more the same.
Diffstat (limited to 'src')
-rw-r--r--src/video/win32_v.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 2f464fae2..9e1df8473 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -73,24 +73,24 @@ static Palette _local_palette;
static void MakePalette()
{
+ _cur_palette.first_dirty = 0;
+ _cur_palette.count_dirty = 256;
+ _local_palette = _cur_palette;
+
LOGPALETTE *pal = (LOGPALETTE*)alloca(sizeof(LOGPALETTE) + (256 - 1) * sizeof(PALETTEENTRY));
pal->palVersion = 0x300;
pal->palNumEntries = 256;
for (uint i = 0; i != 256; i++) {
- pal->palPalEntry[i].peRed = _cur_palette.palette[i].r;
- pal->palPalEntry[i].peGreen = _cur_palette.palette[i].g;
- pal->palPalEntry[i].peBlue = _cur_palette.palette[i].b;
+ pal->palPalEntry[i].peRed = _local_palette.palette[i].r;
+ pal->palPalEntry[i].peGreen = _local_palette.palette[i].g;
+ pal->palPalEntry[i].peBlue = _local_palette.palette[i].b;
pal->palPalEntry[i].peFlags = 0;
}
_wnd.gdi_palette = CreatePalette(pal);
if (_wnd.gdi_palette == nullptr) usererror("CreatePalette failed!\n");
-
- _cur_palette.first_dirty = 0;
- _cur_palette.count_dirty = 256;
- _local_palette = _cur_palette;
}
static void UpdatePalette(HDC dc, uint start, uint count)