From 7c42b794eac922f19dca06a2075d1c9ca99fde61 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 29 Oct 2005 21:08:37 +0000 Subject: [PATCH] cleanup --- .../LoadingWindow/LoadingWindow_Win32.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index 27881709a5..ae184e9f90 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -12,16 +12,10 @@ static HBITMAP g_hBitmap = NULL; -/* Load a file into a GDI surface. */ -HBITMAP LoadWin32Surface( CString fn ) +/* Load a RageSurface into a GDI surface. */ +static HBITMAP LoadWin32Surface( RageSurface *s ) { - CString error; - RageSurface *s = RageSurfaceUtils::LoadFile( fn, error ); - if( s == NULL ) - return NULL; - RageSurfaceUtils::ConvertSurface( s, s->w, s->h, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0 ); - HBITMAP bitmap = CreateCompatibleBitmap( GetDC(NULL), s->w, s->h ); ASSERT( bitmap ); @@ -47,6 +41,18 @@ HBITMAP LoadWin32Surface( CString fn ) return bitmap; } +static HBITMAP LoadWin32Surface( CString sFile ) +{ + CString error; + RageSurface *pSurface = RageSurfaceUtils::LoadFile( sFile, error ); + if( pSurface == NULL ) + return NULL; + + HBITMAP ret = LoadWin32Surface( pSurface ); + delete pSurface; + return ret; +} + BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { switch( msg )