From 2949721b40e2b2add7acdf5470a607329d0301ea Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 5 Feb 2002 05:33:33 +0000 Subject: [PATCH] no message --- stepmania/src/Background.cpp | 7 +- stepmania/src/MusicStatusDisplay.h | 8 +- stepmania/src/MusicWheel.cpp | 68 ++++-- stepmania/src/MusicWheel.h | 13 +- stepmania/src/RageUtil.cpp | 20 +- stepmania/src/StepMania.RC | 23 ++ stepmania/src/StepMania.cpp | 343 +++++++++++++++++++---------- stepmania/src/StepMania.dsp | 8 +- stepmania/src/StepMania.dsw | 12 - stepmania/src/TextBanner.cpp | 21 +- stepmania/src/TextBanner.h | 5 +- stepmania/src/error.bmp | Bin 0 -> 31578 bytes stepmania/src/resource.h | 8 +- 13 files changed, 346 insertions(+), 190 deletions(-) create mode 100644 stepmania/src/error.bmp diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 8facb4d0a9..560503dacd 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -13,6 +13,7 @@ #include "RageUtil.h" #include "ScreenDimensions.h" #include "ThemeManager.h" +#include "RageBitmapTexture.h" const CString VIS_DIR = "Visualizations\\"; @@ -45,10 +46,8 @@ bool Background::LoadFromSong( Song &song ) else { // load the static background (if available), and a visualization - if( song.HasBackground() ) - m_sprSongBackground.Load( song.GetBackgroundPath() ); - else - m_sprSongBackground.Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BACKGROUND) ); + if( song.HasBackground() ) m_sprSongBackground.Load( song.GetBackgroundPath(), HINT_DITHER ); + else m_sprSongBackground.Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BACKGROUND), HINT_DITHER ); m_sprSongBackground.StretchTo( CRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ) ); m_sprSongBackground.SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); diff --git a/stepmania/src/MusicStatusDisplay.h b/stepmania/src/MusicStatusDisplay.h index 289a45f26a..0bb8e2aebe 100644 --- a/stepmania/src/MusicStatusDisplay.h +++ b/stepmania/src/MusicStatusDisplay.h @@ -28,6 +28,7 @@ public: { Load( THEME->GetPathTo(GRAPHIC_MUSIC_STATUS_ICONS) ); StopAnimating(); + SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); m_bIsNew = false; m_Rank = NO_CROWN; @@ -36,10 +37,13 @@ public: SetDiffuseColor( D3DXCOLOR(0,0,0,0) ); // invisible } - void SetNew( bool bIsNew ) + void SetIsNew( bool bIsNew ) { m_bIsNew = bIsNew; - SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible + if( m_bIsNew ) + SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible + else + SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible SetState( 0 ); }; void SetBlinking( bool bIsBlinking ) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 0bad71b5ed..4458d340a7 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -54,23 +54,27 @@ const int NUM_SECTION_TINTS = sizeof(COLOR_SECTION_TINTS) / sizeof(D3DXCOLOR); D3DXCOLOR COLOR_SECTION_LETTER = D3DXCOLOR(1,1,0.3f,1); - -void WheelItem::LoadFromSong( Song &song ) +WheelItem::WheelItem() { + m_pSong = NULL; +} + + +void WheelItem::LoadFromSong( Song* pSong ) +{ + ASSERT( pSong != NULL ); + + m_pSong = pSong; + m_WheelItemType = TYPE_MUSIC; + m_MusicStatusDisplay.SetIsNew( m_pSong->GetNumTimesPlayed() == 0 ); m_MusicStatusDisplay.SetXY( -132, 0 ); - this->AddActor( &m_MusicStatusDisplay ); + m_Banner.LoadFromSong( pSong ); m_Banner.SetHorizAlign( align_left ); m_Banner.SetXY( 15, 0 ); - this->AddActor( &m_Banner ); - - - m_pSong = &song; - m_Banner.LoadFromSong( song ); - m_MusicStatusDisplay.SetNew( m_pSong->GetNumTimesPlayed() == 0 ); -}; +} void WheelItem::LoadFromSectionName( CString sSectionName ) @@ -79,18 +83,16 @@ void WheelItem::LoadFromSectionName( CString sSectionName ) m_sprSectionBackground.Load( THEME->GetPathTo(GRAPHIC_SECTION_BACKGROUND) ); m_sprSectionBackground.SetXY( -30, 0 ); - this->AddActor( &m_sprSectionBackground ); m_textSectionName.Load( THEME->GetPathTo(FONT_OUTLINE) ); m_textSectionName.TurnShadowOff(); m_textSectionName.SetText( sSectionName ); m_textSectionName.SetHorizAlign( align_left ); - m_textSectionName.SetXY( -100, 0 ); + m_textSectionName.SetXY( -85, 0 ); m_textSectionName.SetDiffuseColor( COLOR_SECTION_LETTER ); m_textSectionName.SetZoom( 1.5f ); - this->AddActor( &m_textSectionName ); +} -}; void WheelItem::SetTintColor( D3DXCOLOR c ) { @@ -99,7 +101,7 @@ void WheelItem::SetTintColor( D3DXCOLOR c ) void WheelItem::SetDiffuseColor( D3DXCOLOR c ) { - ActorFrame::SetDiffuseColor( c ); + Actor::SetDiffuseColor( c ); D3DXCOLOR colorTempTint = m_colorTint; @@ -122,6 +124,35 @@ void WheelItem::SetDiffuseColor( D3DXCOLOR c ) }; +void WheelItem::Update( float fDeltaTime ) +{ + switch( m_WheelItemType ) + { + case TYPE_SECTION: + m_sprSectionBackground.Update( fDeltaTime ); + m_textSectionName.Update( fDeltaTime ); + break; + case TYPE_MUSIC: + m_MusicStatusDisplay.Update( fDeltaTime ); + m_Banner.Update( fDeltaTime ); + break; + } +} + +void WheelItem::RenderPrimitives() +{ + switch( m_WheelItemType ) + { + case TYPE_SECTION: + m_sprSectionBackground.Draw(); + m_textSectionName.Draw(); + break; + case TYPE_MUSIC: + m_MusicStatusDisplay.Draw(); + m_Banner.Draw(); + break; + } +} @@ -222,8 +253,7 @@ void MusicWheel::RebuildWheelItems() ASSERT( true ); // unhandled SORT_ORDER } - - + m_WheelItems.RemoveAll(); // clear out the previous wheel items... // ...and load new ones @@ -238,7 +268,7 @@ void MusicWheel::RebuildWheelItems() for( int i=0; i< arraySongs.GetSize(); i++ ) { Song* pSong = arraySongs[i]; - m_WheelItems[i].LoadFromSong( *pSong ); + m_WheelItems[i].LoadFromSong( pSong ); m_WheelItems[i].SetTintColor( *m_mapGroupNameToColorPtr[pSong->GetGroupName()] ); } } @@ -269,7 +299,7 @@ void MusicWheel::RebuildWheelItems() if( sThisSection == m_sExpandedSectionName ) // this song is in the expanded section { WheelItem &WI = m_WheelItems[iCurWheelItem++]; - WI.LoadFromSong( *pSong ); + WI.LoadFromSong( pSong ); WI.SetTintColor( *m_mapGroupNameToColorPtr[pSong->GetGroupName()] ); } } diff --git a/stepmania/src/MusicWheel.h b/stepmania/src/MusicWheel.h index 9e360e0b75..7a404e89cf 100644 --- a/stepmania/src/MusicWheel.h +++ b/stepmania/src/MusicWheel.h @@ -35,13 +35,13 @@ const WindowMessage SM_PlaySongSample = WindowMessage(SM_User+48); -class WheelItem : public ActorFrame +class WheelItem : public Actor { public: - WheelItem() - { - m_pSong = NULL; - }; + WheelItem(); + + virtual void Update( float fDeltaTime ); + virtual void RenderPrimitives(); void SetTintColor( D3DXCOLOR c ); void SetDiffuseColor( D3DXCOLOR c ); @@ -52,10 +52,9 @@ public: return m_textSectionName.GetText(); }; - void LoadFromSong( Song &song ); + void LoadFromSong( Song* pSong ); void LoadFromSectionName( CString sSectionName ); - // common enum WheelItemType { TYPE_SECTION, TYPE_MUSIC }; WheelItemType m_WheelItemType; diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index f2fe68227b..dd50e9bf49 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -66,8 +66,6 @@ bool IsAnInt( CString s ) //----------------------------------------------------------------------------- void RageLogStart() { -#if defined(DEBUG) | defined(_DEBUG) - DeleteFile( g_sLogFileName ); DeleteFile( g_sErrorFileName ); @@ -82,8 +80,6 @@ void RageLogStart() RageLog( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond ); RageLog( "\n" ); - -#endif } @@ -99,7 +95,9 @@ void RageLog( LPCTSTR fmt, ...) CString sBuff = vssprintf( fmt, va ); sBuff += "\n"; - fprintf(g_fileLog, sBuff); + fprintf(g_fileLog, sBuff); + fclose( g_fileLog ); + g_fileLog = fopen( g_sLogFileName, "w" ); } void RageLogHr( HRESULT hr, LPCTSTR fmt, ...) @@ -408,13 +406,17 @@ VOID DisplayErrorAndDie( CString sError ) } sError += "\n\n" + fromClipboard; */ - +#ifdef DEBUG // don't use error handler in Release mode + AfxMessageBox( sError ); + exit(1); +#else FILE* fp = fopen( g_sErrorFileName, "w" ); - fprintf( fp, sError ); fclose( fp ); - - exit(1); + // generate an exception so the error handler shows + int d = 0; + int ksg = 3/d; +#endif } diff --git a/stepmania/src/StepMania.RC b/stepmania/src/StepMania.RC index a731b35667..59114eab2f 100644 --- a/stepmania/src/StepMania.RC +++ b/stepmania/src/StepMania.RC @@ -125,6 +125,29 @@ END // SPLASH BITMAP DISCARDABLE "splash.bmp" +BITMAP_ERROR BITMAP DISCARDABLE "error.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ERROR_DIALOG DIALOG DISCARDABLE 0, 0, 332, 234 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +CAPTION "StepMania Error" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_EDIT_ERROR,5,80,320,80,ES_CENTER | ES_MULTILINE | + ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + DEFPUSHBUTTON "Close",IDOK,265,215,60,15 + CONTROL 129,IDC_STATIC,"Static",SS_BITMAP,0,0,258,37 + LTEXT "We're sorry. An error has occurred while running StepMania.\r\n\r\nMore specific details about the error may be listeted in the box below:", + IDC_STATIC,7,47,298,28 + PUSHBUTTON "Restart StepMania",IDC_BUTTON_RESTART,175,215,80,15 + PUSHBUTTON "Report the Error",IDC_BUTTON_REPORT,120,190,80,15 + PUSHBUTTON "View Log",IDC_BUTTON_VIEW_LOG,120,170,80,15 +END + #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index c975ee50ed..2d717fd018 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -30,6 +30,8 @@ #include "WindowTitleMenu.h" #include "WindowPlayerOptions.h" +#include "ScreenDimensions.h" + #include //----------------------------------------------------------------------------- @@ -45,12 +47,9 @@ const CString g_sAppName = "StepMania"; const CString g_sAppClassName = "StepMania Class"; - -HWND g_hWndMain; // Main Window Handle -HINSTANCE g_hInstance; // The Handle to Window Instance - -#include "ScreenDimensions.h" - +HWND g_hWndMain; // Main Window Handle +HINSTANCE g_hInstance; // The Handle to Window Instance +HANDLE g_hMutex; // Used to check if an instance of our app is already const DWORD g_dwWindowStyle = WS_VISIBLE|WS_POPUP|WS_CAPTION|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU; @@ -65,6 +64,7 @@ BOOL g_bIsActive = FALSE; // Whether the focus is on our app //----------------------------------------------------------------------------- // Main game functions LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); +BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); void Update(); // Update the game logic void Render(); // Render a frame @@ -78,8 +78,6 @@ VOID DestroyObjects(); // deallocate game objects when we're done with them BOOL SwitchDisplayMode();// BOOL bWindowed, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP ); -BOOL WeAreAlone( LPSTR szName ); - //----------------------------------------------------------------------------- // Name: WinMain() @@ -87,114 +85,234 @@ BOOL WeAreAlone( LPSTR szName ); //----------------------------------------------------------------------------- int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) { - if( !WeAreAlone("StepMania") ) + +#ifndef DEBUG // don't use error handler in Release mode + try { - RageError( "StepMania is already running!" ); - } - - // Make sure the current directory is the root program directory - if( !DoesFileExist("Songs") ) - { - // change dir to path of the execuctable - TCHAR szFullAppPath[MAX_PATH]; - GetModuleFileName(NULL, szFullAppPath, MAX_PATH); - - // strip off executable name - LPSTR pLastBackslash = strrchr(szFullAppPath, '\\'); - *pLastBackslash = '\0'; // terminate the string - - SetCurrentDirectory(szFullAppPath); - } - - - CoInitialize (NULL); // Initialize COM - - // Register the window class - WNDCLASS wndClass = { - 0, - WndProc, // callback handler - 0, // cbClsExtra; - 0, // cbWndExtra; - hInstance, - LoadIcon( hInstance, MAKEINTRESOURCE(IDI_ICON) ), - LoadCursor( hInstance, IDC_ARROW), - (HBRUSH)GetStockObject( BLACK_BRUSH ), - NULL, // lpszMenuName; - g_sAppClassName // lpszClassName; - }; - RegisterClass( &wndClass ); - - - // Set the window's initial width - RECT rcWnd; - SetRect( &rcWnd, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ); - AdjustWindowRect( &rcWnd, g_dwWindowStyle, FALSE ); - - - // Create our main window - g_hWndMain = CreateWindow( - g_sAppClassName,// pointer to registered class name - g_sAppName, // pointer to window name - g_dwWindowStyle, // window style - CW_USEDEFAULT, // horizontal position of window - CW_USEDEFAULT, // vertical position of window - RECTWIDTH(rcWnd), // window width - RECTHEIGHT(rcWnd),// window height - NULL, // handle to parent or owner window - NULL, // handle to menu, or child-window identifier - hInstance, // handle to application instance - NULL // pointer to window-creation data - ); - if( NULL == g_hWndMain ) - exit(1); - - - // Load keyboard accelerators - HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) ); - - - // run the game - CreateObjects( g_hWndMain ); // Create the game objects - - // Now we're ready to recieve and process Windows messages. - MSG msg; - ZeroMemory( &msg, sizeof(msg) ); - - - while( WM_QUIT != msg.message ) - { - // Look for messages, if none are found then - // update the state and display it - if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) +#endif + // Check to see if the app is already running. + g_hMutex = CreateMutex( NULL, TRUE, g_sAppName ); + if( GetLastError() == ERROR_ALREADY_EXISTS ) { - GetMessage(&msg, NULL, 0, 0 ); + CloseHandle( g_hMutex ); + RageError( "StepMania is already running!" ); + } - // Translate and dispatch the message - if( 0 == TranslateAccelerator( g_hWndMain, hAccel, &msg ) ) + // Make sure the current directory is the root program directory + if( !DoesFileExist("Songs") ) + { + // change dir to path of the execuctable + TCHAR szFullAppPath[MAX_PATH]; + GetModuleFileName(NULL, szFullAppPath, MAX_PATH); + + // strip off executable name + LPSTR pLastBackslash = strrchr(szFullAppPath, '\\'); + *pLastBackslash = '\0'; // terminate the string + + SetCurrentDirectory(szFullAppPath); + } + + + CoInitialize (NULL); // Initialize COM + + // Register the window class + WNDCLASS wndClass = { + 0, + WndProc, // callback handler + 0, // cbClsExtra; + 0, // cbWndExtra; + hInstance, + LoadIcon( hInstance, MAKEINTRESOURCE(IDI_ICON) ), + LoadCursor( hInstance, IDC_ARROW), + (HBRUSH)GetStockObject( BLACK_BRUSH ), + NULL, // lpszMenuName; + g_sAppClassName // lpszClassName; + }; + RegisterClass( &wndClass ); + + + // Set the window's initial width + RECT rcWnd; + SetRect( &rcWnd, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ); + AdjustWindowRect( &rcWnd, g_dwWindowStyle, FALSE ); + + + // Create our main window + g_hWndMain = CreateWindow( + g_sAppClassName,// pointer to registered class name + g_sAppName, // pointer to window name + g_dwWindowStyle, // window style + CW_USEDEFAULT, // horizontal position of window + CW_USEDEFAULT, // vertical position of window + RECTWIDTH(rcWnd), // window width + RECTHEIGHT(rcWnd),// window height + NULL, // handle to parent or owner window + NULL, // handle to menu, or child-window identifier + hInstance, // handle to application instance + NULL // pointer to window-creation data + ); + if( NULL == g_hWndMain ) + exit(1); + + + // Load keyboard accelerators + HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) ); + + // run the game + CreateObjects( g_hWndMain ); // Create the game objects + + // Now we're ready to recieve and process Windows messages. + MSG msg; + ZeroMemory( &msg, sizeof(msg) ); + + + while( WM_QUIT != msg.message ) + { + // Look for messages, if none are found then + // update the state and display it + if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) { - TranslateMessage( &msg ); - DispatchMessage( &msg ); + GetMessage(&msg, NULL, 0, 0 ); + + // Translate and dispatch the message + if( 0 == TranslateAccelerator( g_hWndMain, hAccel, &msg ) ) + { + TranslateMessage( &msg ); + DispatchMessage( &msg ); + } } - } - else // No messages are waiting. Render a frame during idle time. - { - Update(); - Render(); - //if( !g_bFullscreen ) - ::Sleep(0 ); // give some time for the movie decoding thread - } - } // end while( WM_QUIT != msg.message ) + else // No messages are waiting. Render a frame during idle time. + { + Update(); + Render(); + //if( !g_bFullscreen ) + ::Sleep(0 ); // give some time for the movie decoding thread + } + } // end while( WM_QUIT != msg.message ) - // clean up after a normal exit - DestroyObjects(); // deallocate our game objects and leave fullscreen - DestroyWindow( g_hWndMain ); - UnregisterClass( g_sAppClassName, hInstance ); - CoUninitialize(); // Uninitialize COM + // clean up after a normal exit + CloseHandle( g_hMutex ); + DestroyObjects(); // deallocate our game objects and leave fullscreen + DestroyWindow( g_hWndMain ); + UnregisterClass( g_sAppClassName, hInstance ); + CoUninitialize(); // Uninitialize COM + +#ifndef DEBUG // don't use error handler in Release mode + } + catch(...) // catch all exceptions + { + CloseHandle( g_hMutex ); + DestroyObjects(); // deallocate our game objects and leave fullscreen + ShowWindow( g_hWndMain, SW_HIDE ); + + DialogBox( + hInstance, + MAKEINTRESOURCE(IDD_ERROR_DIALOG), + NULL, + ErrorWndProc + ); + exit( 1 ); + + DestroyWindow( g_hWndMain ); + UnregisterClass( g_sAppClassName, hInstance ); + CoUninitialize(); // Uninitialize COM + } +#endif + return 0L; } +//----------------------------------------------------------------------------- +// Name: ErrorWndProc() +// Desc: Callback for all Windows messages +//----------------------------------------------------------------------------- +BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + { + CString sError; + CStdioFile file; + if( file.Open("error.txt", CFile::modeRead) ) + { + CString sBuffer; + while( file.ReadString(sBuffer) ) + { + sError += sBuffer + "\r\n"; + } + } + sError.TrimRight(); + if( sError == "" ) + sError = "Program Crash. Click 'View Log' for trace."; + SendDlgItemMessage( + hWnd, + IDC_EDIT_ERROR, + WM_SETTEXT, + 0, + (LPARAM)(LPCTSTR)sError + ); + } + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_BUTTON_VIEW_LOG: + { + PROCESS_INFORMATION pi; + STARTUPINFO si; + ZeroMemory( &si, sizeof(si) ); + + CreateProcess( + NULL, // pointer to name of executable module + "notepad.exe log.txt", // pointer to command line string + NULL, // process security attributes + NULL, // thread security attributes + false, // handle inheritance flag + 0, // creation flags + NULL, // pointer to new environment block + NULL, // pointer to current directory name + &si, // pointer to STARTUPINFO + &pi // pointer to PROCESS_INFORMATION + ); + } + break; + case IDC_BUTTON_REPORT: + GotoURL( "Docs/report.htm" ); + break; + case IDC_BUTTON_RESTART: + { + // Launch StepMania + PROCESS_INFORMATION pi; + STARTUPINFO si; + ZeroMemory( &si, sizeof(si) ); + + CreateProcess( + NULL, // pointer to name of executable module + "stepmania.exe", // pointer to command line string + NULL, // process security attributes + NULL, // thread security attributes + false, // handle inheritance flag + 0, // creation flags + NULL, // pointer to new environment block + NULL, // pointer to current directory name + &si, // pointer to STARTUPINFO + &pi // pointer to PROCESS_INFORMATION + ); + } + EndDialog( hWnd, 0 ); + break; + // fall through + case IDOK: + EndDialog( hWnd, 0 ); + break; + } + } + return FALSE; +} + //----------------------------------------------------------------------------- // Name: WndProc() @@ -648,21 +766,6 @@ BOOL SwitchDisplayMode()//( BOOL bWindowed, DWORD dwWidth, DWORD dwHeight, DWORD } -//----------------------------------------------------------------------------- -// Name: WeAreAlone() -// Desc: check for DirectX 8 -//----------------------------------------------------------------------------- -BOOL WeAreAlone (LPSTR szName) -{ - HANDLE hMutex = CreateMutex (NULL, TRUE, szName); - if (GetLastError() == ERROR_ALREADY_EXISTS) - { - CloseHandle(hMutex); - return FALSE; - } - return TRUE; -} - diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 72556bc2f6..b8c93e90d2 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -38,7 +38,7 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 1 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../Release" +# PROP Output_Dir "../" # PROP Intermediate_Dir "../Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -737,6 +737,10 @@ SOURCE=.\TipDisplay.h # End Group # Begin Source File +SOURCE=.\error.bmp +# End Source File +# Begin Source File + SOURCE=.\splash.bmp # End Source File # End Target diff --git a/stepmania/src/StepMania.dsw b/stepmania/src/StepMania.dsw index edae4bc44c..a387ec3711 100644 --- a/stepmania/src/StepMania.dsw +++ b/stepmania/src/StepMania.dsw @@ -27,18 +27,6 @@ Package=<4> ############################################################################### -Project: "smlauncher"=.\smlauncher\smlauncher.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - Project: "smpackage"=.\smpackage\smpackage.dsp - Package Owner=<4> Package=<5> diff --git a/stepmania/src/TextBanner.cpp b/stepmania/src/TextBanner.cpp index 3a11d8c531..c1522799e0 100644 --- a/stepmania/src/TextBanner.cpp +++ b/stepmania/src/TextBanner.cpp @@ -30,27 +30,28 @@ TextBanner::TextBanner() m_textSubTitle.SetHorizAlign( align_left ); m_textArtist.SetHorizAlign( align_left ); - m_rect.ScaleToCover( CRect( -TEXT_BANNER_WIDTH/2, - -TEXT_BANNER_HEIGHT/2, - TEXT_BANNER_WIDTH/2, - TEXT_BANNER_HEIGHT/2 ) - ); - //this->AddActor( &m_rect ); - this->AddActor( &m_textTitle ); this->AddActor( &m_textSubTitle ); this->AddActor( &m_textArtist ); } -bool TextBanner::LoadFromSong( Song &song ) +bool TextBanner::LoadFromSong( Song* pSong ) { - CString sTitle = song.GetTitle(); + if( pSong == NULL ) + { + m_textTitle.SetText( "" ); + m_textSubTitle.SetText( "" ); + m_textArtist.SetText( "" ); + return true; + } + + CString sTitle = pSong->GetTitle(); CString sSubTitle; m_textTitle.SetText( sTitle ); m_textSubTitle.SetText( sSubTitle ); - m_textArtist.SetText( "/" + song.GetArtist() ); + m_textArtist.SetText( "/" + pSong->GetArtist() ); float fTitleZoom, fSubTitleZoom, fArtistZoom; diff --git a/stepmania/src/TextBanner.h b/stepmania/src/TextBanner.h index c3520b215c..14f3b2d903 100644 --- a/stepmania/src/TextBanner.h +++ b/stepmania/src/TextBanner.h @@ -26,13 +26,10 @@ class TextBanner : public ActorFrame { public: TextBanner(); - bool LoadFromSong( Song &song ); + bool LoadFromSong( Song* pSong ); private: BitmapText m_textTitle, m_textSubTitle, m_textArtist; - - RectangleActor m_rect; - }; diff --git a/stepmania/src/error.bmp b/stepmania/src/error.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a5340e81570ac5d13dd1166eb63002a76b411beb GIT binary patch literal 31578 zcmeI5c~Dfxy1>87RTN{c;KCq_q7E1l0<(Z5>dWB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-$eKz=5UBKl#9UknQF?=bGVg8%t_=_60 z%0hCwJUun9xw$e9AD>1=p_OOUWMpXSY@9h8IL?o|2S39-HYza8f01f`!-d_H)#d5w zdCd)t)O*bm3BC`j(G;`|3_ES~I?|(?L;mu0`){~+Ow)c;11mpms+KmSH#A;RDJmq< z_+CtkMuRWFcRsc|FwlMf^|?xnozJPl>?0ocdatH8AagCgB@rD>kZZcy+6Hs)c6Uq~ zKP-a1WSE;hYEuV1M(^uXjSXq4?5vs;d=)CQjS7REcb9mWN-@mm>0&WNU%%ho-kPRT zNTTtXc|v_=Ti0Ocoqsp3-sm1OcD@)$FX)5A`*%BZIra59IqmAsj`Q~?RxCKp`1a@2 wu}G3@Z2e~OzibRV?B_T4RX9`E7&|xV;#G+;%wHAKrhX#xFPQL(X#n8=0eGEy>i_@% literal 0 HcmV?d00001 diff --git a/stepmania/src/resource.h b/stepmania/src/resource.h index 1501aac90e..7eca2d5a3a 100644 --- a/stepmania/src/resource.h +++ b/stepmania/src/resource.h @@ -2,11 +2,17 @@ // Microsoft Developer Studio generated include file. // Used by StepMania.RC // +#define IDD_ERROR_DIALOG 111 +#define BITMAP_ERROR 129 #define IDR_MAIN_ACCEL 1001 +#define IDC_BUTTON_RESTART 1001 #define IDM_TOGGLEFULLSCREEN 1002 +#define IDC_BUTTON_REPORT 1002 #define IDM_CHANGERESOLUTION 1003 +#define IDC_BUTTON_VIEW_LOG 1003 #define IDM_CHANGEDISPLAYCOLOR 1004 #define IDM_CHANGETEXTURECOLOR 1005 +#define IDC_EDIT_ERROR 1005 #define IDM_TOGGLESTATISTICS 1006 #define IDI_ICON 1007 #define IDC_CURSOR 1008 @@ -16,7 +22,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 111 +#define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40009 #define _APS_NEXT_CONTROL_VALUE 1009 #define _APS_NEXT_SYMED_VALUE 101