From 7a3ff956d02ebbecfd73b0d8fe6218f8afb7187e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 13 Sep 2003 19:09:01 +0000 Subject: [PATCH] fix splash window redraw problems --- stepmania/src/StepMania.RC | 3 +- .../LoadingWindow/LoadingWindow_Win32.cpp | 28 ++++--------------- stepmania/src/resource.h | 5 ++-- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/stepmania/src/StepMania.RC b/stepmania/src/StepMania.RC index e44cfea6f4..66202df741 100644 --- a/stepmania/src/StepMania.RC +++ b/stepmania/src/StepMania.RC @@ -52,12 +52,13 @@ BEGIN SS_CENTERIMAGE CTEXT "line3",IDC_STATIC_MESSAGE3,0,65,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CONTROL "",IDC_SPLASH,"Static",SS_BITMAP,0,0,310,25 END IDD_DISASM_CRASH DIALOGEX 0, 0, 399, 151 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "StepMania Error" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN DEFPUSHBUTTON "Close",IDC_BUTTON_CLOSE,348,135,50,15 LTEXT "crash reason: programmer needs good whack on head", diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index 86628c5ffe..8eedc3e00a 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -22,29 +22,13 @@ BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + SendMessage( + GetDlgItem(hWnd,IDC_SPLASH), + STM_SETIMAGE, + (WPARAM) IMAGE_BITMAP, + (LPARAM) (HANDLE) g_hBitmap ); break; - case WM_PAINT: - { - if( g_hBitmap ) - { - PAINTSTRUCT ps; - HDC hdcDst = BeginPaint( hWnd, &ps ); - HDC hdcSrc = CreateCompatibleDC( NULL ); - SelectObject( hdcSrc, g_hBitmap ); - BOOL bSuccess = BitBlt( - hdcDst, - 0, 0, - 1000, 1000, // let GDI do the clipping... - hdcSrc, - 0, 0, - SRCCOPY ); -// DWORD dwLastError = GetLastError(); - ASSERT( bSuccess ); - EndPaint( hWnd, &ps ); - } - return FALSE; - } - break; + case WM_DESTROY: DeleteObject( g_hBitmap ); g_hBitmap = NULL; diff --git a/stepmania/src/resource.h b/stepmania/src/resource.h index 347f60041f..6feba9d101 100644 --- a/stepmania/src/resource.h +++ b/stepmania/src/resource.h @@ -1,5 +1,5 @@ //{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. +// Microsoft Developer Studio generated include file. // Used by StepMania.RC // #define IDC_CRASH_SAVE 16 @@ -32,6 +32,7 @@ #define IDC_HUSH 1016 #define IDC_MESSAGE 1017 #define IDC_CHECK2 1019 +#define IDC_SPLASH 1020 #define IDC_ASMBOX 1133 #define IDC_REGDUMP 1283 #define IDC_STATIC_BOMBREASON 1284 @@ -44,7 +45,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 130 #define _APS_NEXT_COMMAND_VALUE 40009 -#define _APS_NEXT_CONTROL_VALUE 1020 +#define _APS_NEXT_CONTROL_VALUE 1021 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif