Fix for NetHackW.exe menu icon rendering.
This commit is contained in:
@@ -729,8 +729,6 @@ onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
data->tileDC = CreateCompatibleDC(hDC);
|
data->tileDC = CreateCompatibleDC(hDC);
|
||||||
ReleaseDC(hWnd, hDC);
|
ReleaseDC(hWnd, hDC);
|
||||||
|
|
||||||
SelectObject(data->tileDC, GetNHApp()->bmpMapTiles);
|
|
||||||
|
|
||||||
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) data);
|
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) data);
|
||||||
|
|
||||||
clearAll(data);
|
clearAll(data);
|
||||||
@@ -989,11 +987,15 @@ onPaint(HWND hWnd)
|
|||||||
PNHMapWindow data = (PNHMapWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
PNHMapWindow data = (PNHMapWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
/* update back buffer */
|
/* update back buffer */
|
||||||
|
HBITMAP savedBitmap = SelectObject(data->tileDC, GetNHApp()->bmpMapTiles);
|
||||||
|
|
||||||
for (int i = 0; i < COLNO; i++)
|
for (int i = 0; i < COLNO; i++)
|
||||||
for (int j = 0; j < ROWNO; j++)
|
for (int j = 0; j < ROWNO; j++)
|
||||||
if (data->mapDirty[i][j])
|
if (data->mapDirty[i][j])
|
||||||
paint(data, i, j);
|
paint(data, i, j);
|
||||||
|
|
||||||
|
SelectObject(data->tileDC, savedBitmap);
|
||||||
|
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
HDC hFrontBufferDC = BeginPaint(hWnd, &ps);
|
HDC hFrontBufferDC = BeginPaint(hWnd, &ps);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user