diff --git a/cnc-ddraw.vcxproj b/cnc-ddraw.vcxproj
index 70bd817792..85475c25c7 100644
--- a/cnc-ddraw.vcxproj
+++ b/cnc-ddraw.vcxproj
@@ -89,6 +89,7 @@
+
diff --git a/cnc-ddraw.vcxproj.filters b/cnc-ddraw.vcxproj.filters
index e1e9a15617..f673285871 100644
--- a/cnc-ddraw.vcxproj.filters
+++ b/cnc-ddraw.vcxproj.filters
@@ -293,6 +293,9 @@
Header Files
+
+ Header Files
+
diff --git a/inc/ddpalette.h b/inc/ddpalette.h
index e780b5af8c..cfd46ff440 100644
--- a/inc/ddpalette.h
+++ b/inc/ddpalette.h
@@ -13,265 +13,4 @@ HRESULT ddp_GetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwBase
HRESULT ddp_SetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
HRESULT dd_CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, IDirectDrawPaletteImpl** lpDDPalette, IUnknown FAR* unkOuter);
-// Original palette copied from Windows ME
-static PALETTEENTRY g_ddp_default_palette[] =
-{
- { 0, 0, 0, 0 },
- { 128, 0, 0, 0 },
- { 0, 128, 0, 0 },
- { 128, 128, 0, 0 },
- { 0, 0, 128, 0 },
- { 128, 0, 128, 0 },
- { 0, 128, 128, 0 },
- { 192, 192, 192, 0 },
- { 192, 220, 192, 0 },
- { 166, 202, 240, 0 },
- { 95, 63, 63, 0 },
- { 127, 63, 63, 0 },
- { 159, 63, 63, 0 },
- { 191, 63, 63, 0 },
- { 223, 63, 63, 0 },
- { 255, 63, 63, 0 },
- { 63, 95, 63, 0 },
- { 95, 95, 63, 0 },
- { 127, 95, 63, 0 },
- { 159, 95, 63, 0 },
- { 191, 95, 63, 0 },
- { 223, 95, 63, 0 },
- { 255, 95, 63, 0 },
- { 63, 127, 63, 0 },
- { 95, 127, 63, 0 },
- { 127, 127, 63, 0 },
- { 159, 127, 63, 0 },
- { 191, 127, 63, 0 },
- { 223, 127, 63, 0 },
- { 255, 127, 63, 0 },
- { 63, 159, 63, 0 },
- { 95, 159, 63, 0 },
- { 127, 159, 63, 0 },
- { 159, 159, 63, 0 },
- { 191, 159, 63, 0 },
- { 223, 159, 63, 0 },
- { 255, 159, 63, 0 },
- { 63, 191, 63, 0 },
- { 95, 191, 63, 0 },
- { 127, 191, 63, 0 },
- { 159, 191, 63, 0 },
- { 191, 191, 63, 0 },
- { 223, 191, 63, 0 },
- { 255, 191, 63, 0 },
- { 63, 223, 63, 0 },
- { 95, 223, 63, 0 },
- { 127, 223, 63, 0 },
- { 159, 223, 63, 0 },
- { 191, 223, 63, 0 },
- { 223, 223, 63, 0 },
- { 255, 223, 63, 0 },
- { 63, 255, 63, 0 },
- { 95, 255, 63, 0 },
- { 127, 255, 63, 0 },
- { 159, 255, 63, 0 },
- { 191, 255, 63, 0 },
- { 223, 255, 63, 0 },
- { 255, 255, 63, 0 },
- { 63, 63, 95, 0 },
- { 95, 63, 95, 0 },
- { 127, 63, 95, 0 },
- { 159, 63, 95, 0 },
- { 191, 63, 95, 0 },
- { 223, 63, 95, 0 },
- { 255, 63, 95, 0 },
- { 63, 95, 95, 0 },
- { 95, 95, 95, 0 },
- { 127, 95, 95, 0 },
- { 159, 95, 95, 0 },
- { 191, 95, 95, 0 },
- { 223, 95, 95, 0 },
- { 255, 95, 95, 0 },
- { 63, 127, 95, 0 },
- { 95, 127, 95, 0 },
- { 127, 127, 95, 0 },
- { 159, 127, 95, 0 },
- { 191, 127, 95, 0 },
- { 223, 127, 95, 0 },
- { 255, 127, 95, 0 },
- { 63, 159, 95, 0 },
- { 95, 159, 95, 0 },
- { 127, 159, 95, 0 },
- { 159, 159, 95, 0 },
- { 191, 159, 95, 0 },
- { 223, 159, 95, 0 },
- { 255, 159, 95, 0 },
- { 63, 191, 95, 0 },
- { 95, 191, 95, 0 },
- { 127, 191, 95, 0 },
- { 159, 191, 95, 0 },
- { 191, 191, 95, 0 },
- { 223, 191, 95, 0 },
- { 255, 191, 95, 0 },
- { 63, 223, 95, 0 },
- { 95, 223, 95, 0 },
- { 127, 223, 95, 0 },
- { 159, 223, 95, 0 },
- { 191, 223, 95, 0 },
- { 223, 223, 95, 0 },
- { 255, 223, 95, 0 },
- { 63, 255, 95, 0 },
- { 95, 255, 95, 0 },
- { 127, 255, 95, 0 },
- { 159, 255, 95, 0 },
- { 191, 255, 95, 0 },
- { 223, 255, 95, 0 },
- { 255, 255, 95, 0 },
- { 63, 63, 127, 0 },
- { 95, 63, 127, 0 },
- { 127, 63, 127, 0 },
- { 159, 63, 127, 0 },
- { 191, 63, 127, 0 },
- { 223, 63, 127, 0 },
- { 255, 63, 127, 0 },
- { 63, 95, 127, 0 },
- { 95, 95, 127, 0 },
- { 127, 95, 127, 0 },
- { 159, 95, 127, 0 },
- { 191, 95, 127, 0 },
- { 223, 95, 127, 0 },
- { 255, 95, 127, 0 },
- { 63, 127, 127, 0 },
- { 95, 127, 127, 0 },
- { 127, 127, 127, 0 },
- { 159, 127, 127, 0 },
- { 191, 127, 127, 0 },
- { 223, 127, 127, 0 },
- { 255, 127, 127, 0 },
- { 63, 159, 127, 0 },
- { 95, 159, 127, 0 },
- { 127, 159, 127, 0 },
- { 159, 159, 127, 0 },
- { 191, 159, 127, 0 },
- { 223, 159, 127, 0 },
- { 255, 159, 127, 0 },
- { 63, 191, 127, 0 },
- { 95, 191, 127, 0 },
- { 127, 191, 127, 0 },
- { 159, 191, 127, 0 },
- { 191, 191, 127, 0 },
- { 223, 191, 127, 0 },
- { 255, 191, 127, 0 },
- { 63, 223, 127, 0 },
- { 95, 223, 127, 0 },
- { 127, 223, 127, 0 },
- { 159, 223, 127, 0 },
- { 191, 223, 127, 0 },
- { 223, 223, 127, 0 },
- { 255, 223, 127, 0 },
- { 63, 255, 127, 0 },
- { 95, 255, 127, 0 },
- { 127, 255, 127, 0 },
- { 159, 255, 127, 0 },
- { 191, 255, 127, 0 },
- { 223, 255, 127, 0 },
- { 255, 255, 127, 0 },
- { 63, 63, 159, 0 },
- { 95, 63, 159, 0 },
- { 127, 63, 159, 0 },
- { 159, 63, 159, 0 },
- { 191, 63, 159, 0 },
- { 223, 63, 159, 0 },
- { 255, 63, 159, 0 },
- { 63, 95, 159, 0 },
- { 95, 95, 159, 0 },
- { 127, 95, 159, 0 },
- { 159, 95, 159, 0 },
- { 191, 95, 159, 0 },
- { 223, 95, 159, 0 },
- { 255, 95, 159, 0 },
- { 63, 127, 159, 0 },
- { 95, 127, 159, 0 },
- { 127, 127, 159, 0 },
- { 159, 127, 159, 0 },
- { 191, 127, 159, 0 },
- { 223, 127, 159, 0 },
- { 255, 127, 159, 0 },
- { 63, 159, 159, 0 },
- { 95, 159, 159, 0 },
- { 127, 159, 159, 0 },
- { 159, 159, 159, 0 },
- { 191, 159, 159, 0 },
- { 223, 159, 159, 0 },
- { 255, 159, 159, 0 },
- { 63, 191, 159, 0 },
- { 95, 191, 159, 0 },
- { 127, 191, 159, 0 },
- { 159, 191, 159, 0 },
- { 191, 191, 159, 0 },
- { 223, 191, 159, 0 },
- { 255, 191, 159, 0 },
- { 63, 223, 159, 0 },
- { 95, 223, 159, 0 },
- { 127, 223, 159, 0 },
- { 159, 223, 159, 0 },
- { 191, 223, 159, 0 },
- { 223, 223, 159, 0 },
- { 255, 223, 159, 0 },
- { 63, 255, 159, 0 },
- { 95, 255, 159, 0 },
- { 127, 255, 159, 0 },
- { 159, 255, 159, 0 },
- { 191, 255, 159, 0 },
- { 223, 255, 159, 0 },
- { 255, 255, 159, 0 },
- { 63, 63, 191, 0 },
- { 95, 63, 191, 0 },
- { 127, 63, 191, 0 },
- { 159, 63, 191, 0 },
- { 191, 63, 191, 0 },
- { 223, 63, 191, 0 },
- { 255, 63, 191, 0 },
- { 63, 95, 191, 0 },
- { 95, 95, 191, 0 },
- { 127, 95, 191, 0 },
- { 159, 95, 191, 0 },
- { 191, 95, 191, 0 },
- { 223, 95, 191, 0 },
- { 255, 95, 191, 0 },
- { 63, 127, 191, 0 },
- { 95, 127, 191, 0 },
- { 127, 127, 191, 0 },
- { 159, 127, 191, 0 },
- { 191, 127, 191, 0 },
- { 223, 127, 191, 0 },
- { 255, 127, 191, 0 },
- { 63, 159, 191, 0 },
- { 95, 159, 191, 0 },
- { 127, 159, 191, 0 },
- { 159, 159, 191, 0 },
- { 191, 159, 191, 0 },
- { 223, 159, 191, 0 },
- { 255, 159, 191, 0 },
- { 63, 191, 191, 0 },
- { 95, 191, 191, 0 },
- { 127, 191, 191, 0 },
- { 159, 191, 191, 0 },
- { 191, 191, 191, 0 },
- { 223, 191, 191, 0 },
- { 255, 191, 191, 0 },
- { 63, 223, 191, 0 },
- { 95, 223, 191, 0 },
- { 127, 223, 191, 0 },
- { 159, 223, 191, 0 },
- { 191, 223, 191, 0 },
- { 223, 223, 191, 0 },
- { 255, 251, 240, 0 },
- { 58, 109, 165, 0 },
- { 128, 128, 128, 0 },
- { 255, 0, 0, 0 },
- { 0, 255, 0, 0 },
- { 255, 255, 0, 0 },
- { 0, 0, 255, 0 },
- { 255, 0, 255, 0 },
- { 0, 255, 255, 0 },
- { 255, 255, 255, 0 }
-};
-
#endif
diff --git a/inc/palette.h b/inc/palette.h
new file mode 100644
index 0000000000..8e38ec4157
--- /dev/null
+++ b/inc/palette.h
@@ -0,0 +1,265 @@
+#ifndef PALETTE_H
+#define PALETTE_H
+
+// Original palette copied from Windows ME
+static PALETTEENTRY g_ddp_default_palette[] =
+{
+ { 0, 0, 0, 0 },
+ { 128, 0, 0, 0 },
+ { 0, 128, 0, 0 },
+ { 128, 128, 0, 0 },
+ { 0, 0, 128, 0 },
+ { 128, 0, 128, 0 },
+ { 0, 128, 128, 0 },
+ { 192, 192, 192, 0 },
+ { 192, 220, 192, 0 },
+ { 166, 202, 240, 0 },
+ { 95, 63, 63, 0 },
+ { 127, 63, 63, 0 },
+ { 159, 63, 63, 0 },
+ { 191, 63, 63, 0 },
+ { 223, 63, 63, 0 },
+ { 255, 63, 63, 0 },
+ { 63, 95, 63, 0 },
+ { 95, 95, 63, 0 },
+ { 127, 95, 63, 0 },
+ { 159, 95, 63, 0 },
+ { 191, 95, 63, 0 },
+ { 223, 95, 63, 0 },
+ { 255, 95, 63, 0 },
+ { 63, 127, 63, 0 },
+ { 95, 127, 63, 0 },
+ { 127, 127, 63, 0 },
+ { 159, 127, 63, 0 },
+ { 191, 127, 63, 0 },
+ { 223, 127, 63, 0 },
+ { 255, 127, 63, 0 },
+ { 63, 159, 63, 0 },
+ { 95, 159, 63, 0 },
+ { 127, 159, 63, 0 },
+ { 159, 159, 63, 0 },
+ { 191, 159, 63, 0 },
+ { 223, 159, 63, 0 },
+ { 255, 159, 63, 0 },
+ { 63, 191, 63, 0 },
+ { 95, 191, 63, 0 },
+ { 127, 191, 63, 0 },
+ { 159, 191, 63, 0 },
+ { 191, 191, 63, 0 },
+ { 223, 191, 63, 0 },
+ { 255, 191, 63, 0 },
+ { 63, 223, 63, 0 },
+ { 95, 223, 63, 0 },
+ { 127, 223, 63, 0 },
+ { 159, 223, 63, 0 },
+ { 191, 223, 63, 0 },
+ { 223, 223, 63, 0 },
+ { 255, 223, 63, 0 },
+ { 63, 255, 63, 0 },
+ { 95, 255, 63, 0 },
+ { 127, 255, 63, 0 },
+ { 159, 255, 63, 0 },
+ { 191, 255, 63, 0 },
+ { 223, 255, 63, 0 },
+ { 255, 255, 63, 0 },
+ { 63, 63, 95, 0 },
+ { 95, 63, 95, 0 },
+ { 127, 63, 95, 0 },
+ { 159, 63, 95, 0 },
+ { 191, 63, 95, 0 },
+ { 223, 63, 95, 0 },
+ { 255, 63, 95, 0 },
+ { 63, 95, 95, 0 },
+ { 95, 95, 95, 0 },
+ { 127, 95, 95, 0 },
+ { 159, 95, 95, 0 },
+ { 191, 95, 95, 0 },
+ { 223, 95, 95, 0 },
+ { 255, 95, 95, 0 },
+ { 63, 127, 95, 0 },
+ { 95, 127, 95, 0 },
+ { 127, 127, 95, 0 },
+ { 159, 127, 95, 0 },
+ { 191, 127, 95, 0 },
+ { 223, 127, 95, 0 },
+ { 255, 127, 95, 0 },
+ { 63, 159, 95, 0 },
+ { 95, 159, 95, 0 },
+ { 127, 159, 95, 0 },
+ { 159, 159, 95, 0 },
+ { 191, 159, 95, 0 },
+ { 223, 159, 95, 0 },
+ { 255, 159, 95, 0 },
+ { 63, 191, 95, 0 },
+ { 95, 191, 95, 0 },
+ { 127, 191, 95, 0 },
+ { 159, 191, 95, 0 },
+ { 191, 191, 95, 0 },
+ { 223, 191, 95, 0 },
+ { 255, 191, 95, 0 },
+ { 63, 223, 95, 0 },
+ { 95, 223, 95, 0 },
+ { 127, 223, 95, 0 },
+ { 159, 223, 95, 0 },
+ { 191, 223, 95, 0 },
+ { 223, 223, 95, 0 },
+ { 255, 223, 95, 0 },
+ { 63, 255, 95, 0 },
+ { 95, 255, 95, 0 },
+ { 127, 255, 95, 0 },
+ { 159, 255, 95, 0 },
+ { 191, 255, 95, 0 },
+ { 223, 255, 95, 0 },
+ { 255, 255, 95, 0 },
+ { 63, 63, 127, 0 },
+ { 95, 63, 127, 0 },
+ { 127, 63, 127, 0 },
+ { 159, 63, 127, 0 },
+ { 191, 63, 127, 0 },
+ { 223, 63, 127, 0 },
+ { 255, 63, 127, 0 },
+ { 63, 95, 127, 0 },
+ { 95, 95, 127, 0 },
+ { 127, 95, 127, 0 },
+ { 159, 95, 127, 0 },
+ { 191, 95, 127, 0 },
+ { 223, 95, 127, 0 },
+ { 255, 95, 127, 0 },
+ { 63, 127, 127, 0 },
+ { 95, 127, 127, 0 },
+ { 127, 127, 127, 0 },
+ { 159, 127, 127, 0 },
+ { 191, 127, 127, 0 },
+ { 223, 127, 127, 0 },
+ { 255, 127, 127, 0 },
+ { 63, 159, 127, 0 },
+ { 95, 159, 127, 0 },
+ { 127, 159, 127, 0 },
+ { 159, 159, 127, 0 },
+ { 191, 159, 127, 0 },
+ { 223, 159, 127, 0 },
+ { 255, 159, 127, 0 },
+ { 63, 191, 127, 0 },
+ { 95, 191, 127, 0 },
+ { 127, 191, 127, 0 },
+ { 159, 191, 127, 0 },
+ { 191, 191, 127, 0 },
+ { 223, 191, 127, 0 },
+ { 255, 191, 127, 0 },
+ { 63, 223, 127, 0 },
+ { 95, 223, 127, 0 },
+ { 127, 223, 127, 0 },
+ { 159, 223, 127, 0 },
+ { 191, 223, 127, 0 },
+ { 223, 223, 127, 0 },
+ { 255, 223, 127, 0 },
+ { 63, 255, 127, 0 },
+ { 95, 255, 127, 0 },
+ { 127, 255, 127, 0 },
+ { 159, 255, 127, 0 },
+ { 191, 255, 127, 0 },
+ { 223, 255, 127, 0 },
+ { 255, 255, 127, 0 },
+ { 63, 63, 159, 0 },
+ { 95, 63, 159, 0 },
+ { 127, 63, 159, 0 },
+ { 159, 63, 159, 0 },
+ { 191, 63, 159, 0 },
+ { 223, 63, 159, 0 },
+ { 255, 63, 159, 0 },
+ { 63, 95, 159, 0 },
+ { 95, 95, 159, 0 },
+ { 127, 95, 159, 0 },
+ { 159, 95, 159, 0 },
+ { 191, 95, 159, 0 },
+ { 223, 95, 159, 0 },
+ { 255, 95, 159, 0 },
+ { 63, 127, 159, 0 },
+ { 95, 127, 159, 0 },
+ { 127, 127, 159, 0 },
+ { 159, 127, 159, 0 },
+ { 191, 127, 159, 0 },
+ { 223, 127, 159, 0 },
+ { 255, 127, 159, 0 },
+ { 63, 159, 159, 0 },
+ { 95, 159, 159, 0 },
+ { 127, 159, 159, 0 },
+ { 159, 159, 159, 0 },
+ { 191, 159, 159, 0 },
+ { 223, 159, 159, 0 },
+ { 255, 159, 159, 0 },
+ { 63, 191, 159, 0 },
+ { 95, 191, 159, 0 },
+ { 127, 191, 159, 0 },
+ { 159, 191, 159, 0 },
+ { 191, 191, 159, 0 },
+ { 223, 191, 159, 0 },
+ { 255, 191, 159, 0 },
+ { 63, 223, 159, 0 },
+ { 95, 223, 159, 0 },
+ { 127, 223, 159, 0 },
+ { 159, 223, 159, 0 },
+ { 191, 223, 159, 0 },
+ { 223, 223, 159, 0 },
+ { 255, 223, 159, 0 },
+ { 63, 255, 159, 0 },
+ { 95, 255, 159, 0 },
+ { 127, 255, 159, 0 },
+ { 159, 255, 159, 0 },
+ { 191, 255, 159, 0 },
+ { 223, 255, 159, 0 },
+ { 255, 255, 159, 0 },
+ { 63, 63, 191, 0 },
+ { 95, 63, 191, 0 },
+ { 127, 63, 191, 0 },
+ { 159, 63, 191, 0 },
+ { 191, 63, 191, 0 },
+ { 223, 63, 191, 0 },
+ { 255, 63, 191, 0 },
+ { 63, 95, 191, 0 },
+ { 95, 95, 191, 0 },
+ { 127, 95, 191, 0 },
+ { 159, 95, 191, 0 },
+ { 191, 95, 191, 0 },
+ { 223, 95, 191, 0 },
+ { 255, 95, 191, 0 },
+ { 63, 127, 191, 0 },
+ { 95, 127, 191, 0 },
+ { 127, 127, 191, 0 },
+ { 159, 127, 191, 0 },
+ { 191, 127, 191, 0 },
+ { 223, 127, 191, 0 },
+ { 255, 127, 191, 0 },
+ { 63, 159, 191, 0 },
+ { 95, 159, 191, 0 },
+ { 127, 159, 191, 0 },
+ { 159, 159, 191, 0 },
+ { 191, 159, 191, 0 },
+ { 223, 159, 191, 0 },
+ { 255, 159, 191, 0 },
+ { 63, 191, 191, 0 },
+ { 95, 191, 191, 0 },
+ { 127, 191, 191, 0 },
+ { 159, 191, 191, 0 },
+ { 191, 191, 191, 0 },
+ { 223, 191, 191, 0 },
+ { 255, 191, 191, 0 },
+ { 63, 223, 191, 0 },
+ { 95, 223, 191, 0 },
+ { 127, 223, 191, 0 },
+ { 159, 223, 191, 0 },
+ { 191, 223, 191, 0 },
+ { 223, 223, 191, 0 },
+ { 255, 251, 240, 0 },
+ { 58, 109, 165, 0 },
+ { 128, 128, 128, 0 },
+ { 255, 0, 0, 0 },
+ { 0, 255, 0, 0 },
+ { 255, 255, 0, 0 },
+ { 0, 0, 255, 0 },
+ { 255, 0, 255, 0 },
+ { 0, 255, 255, 0 },
+ { 255, 255, 255, 0 }
+};
+
+#endif
diff --git a/src/ddsurface.c b/src/ddsurface.c
index 18ebb27831..c13480ab7e 100644
--- a/src/ddsurface.c
+++ b/src/ddsurface.c
@@ -15,6 +15,7 @@
#include "utils.h"
#include "versionhelpers.h"
#include "ddpalette.h"
+#include "palette.h"
LONG g_dds_gdi_handles;
diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c
index d982b2a7a0..7dff04dbd4 100644
--- a/src/winapi_hooks.c
+++ b/src/winapi_hooks.c
@@ -21,6 +21,7 @@
#include "hook.h"
#include "directinput.h"
#include "ddpalette.h"
+#include "palette.h"
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)