From 0d7ece0dafefdbbe45fa059d12ee0b90887c18f1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 12 Dec 2017 19:18:12 +0100 Subject: [PATCH] Changed all the renderers' init functions to correctly call cgapal_rebuild() instead of manually rebuilding the CGA palette array. --- src/vnc.c | 2 ++ src/win/win_d3d.cpp | 11 ++++------- src/win/win_ddraw.cpp | 2 ++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/vnc.c b/src/vnc.c index 781f37014..0e41bd46f 100644 --- a/src/vnc.c +++ b/src/vnc.c @@ -182,6 +182,8 @@ vnc_init(UNUSED(void *arg)) 32, 32, 0, 1, 255,255,255, 16, 8, 0, 0, 0 }; + cgapal_rebuild(); + if (rfb == NULL) { wcstombs(title, ui_window_title(NULL), sizeof(title)); updatingSize = 0; diff --git a/src/win/win_d3d.cpp b/src/win/win_d3d.cpp index 995329a69..f2f0454e5 100644 --- a/src/win/win_d3d.cpp +++ b/src/win/win_d3d.cpp @@ -362,12 +362,10 @@ d3d_init(HWND h) { int c; - for (c = 0; c < 256; c++) - pal_lookup[c] = makecol(cgapal[c].r << 2, - cgapal[c].g << 2, cgapal[c].b << 2); - d3d_hwnd = h; + cgapal_rebuild(); + d3d = Direct3DCreate9(D3D_SDK_VERSION); memset(&d3dpp, 0, sizeof(d3dpp)); @@ -405,13 +403,12 @@ d3d_init_fs(HWND h) WCHAR title[200]; int c; + cgapal_rebuild(); + d3d_w = GetSystemMetrics(SM_CXSCREEN); d3d_h = GetSystemMetrics(SM_CYSCREEN); d3d_hwnd = h; - for (c = 0; c < 256; c++) - pal_lookup[c] = makecol(cgapal[c].r << 2, - cgapal[c].g << 2, cgapal[c].b << 2); /*FIXME: should be done once, in win.c */ _swprintf(title, L"%s v%s", EMU_NAME_W, EMU_VERSION_W); diff --git a/src/win/win_ddraw.cpp b/src/win/win_ddraw.cpp index 203ae7a15..55923b06d 100644 --- a/src/win/win_ddraw.cpp +++ b/src/win/win_ddraw.cpp @@ -389,6 +389,8 @@ ddraw_take_screenshot(wchar_t *fn) int ddraw_init(HWND h) { + cgapal_rebuild(); + if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL))) return(0); if (FAILED(lpdd->QueryInterface(IID_IDirectDraw7, (LPVOID *)&lpdd7)))