no message
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "ScreenDimensions.h"
|
#include "ScreenDimensions.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "RageBitmapTexture.h"
|
||||||
|
|
||||||
|
|
||||||
const CString VIS_DIR = "Visualizations\\";
|
const CString VIS_DIR = "Visualizations\\";
|
||||||
@@ -45,10 +46,8 @@ bool Background::LoadFromSong( Song &song )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// load the static background (if available), and a visualization
|
// load the static background (if available), and a visualization
|
||||||
if( song.HasBackground() )
|
if( song.HasBackground() ) m_sprSongBackground.Load( song.GetBackgroundPath(), HINT_DITHER );
|
||||||
m_sprSongBackground.Load( song.GetBackgroundPath() );
|
else m_sprSongBackground.Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BACKGROUND), HINT_DITHER );
|
||||||
else
|
|
||||||
m_sprSongBackground.Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BACKGROUND) );
|
|
||||||
|
|
||||||
m_sprSongBackground.StretchTo( CRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ) );
|
m_sprSongBackground.StretchTo( CRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ) );
|
||||||
m_sprSongBackground.SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
|
m_sprSongBackground.SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
{
|
{
|
||||||
Load( THEME->GetPathTo(GRAPHIC_MUSIC_STATUS_ICONS) );
|
Load( THEME->GetPathTo(GRAPHIC_MUSIC_STATUS_ICONS) );
|
||||||
StopAnimating();
|
StopAnimating();
|
||||||
|
SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||||
|
|
||||||
m_bIsNew = false;
|
m_bIsNew = false;
|
||||||
m_Rank = NO_CROWN;
|
m_Rank = NO_CROWN;
|
||||||
@@ -36,10 +37,13 @@ public:
|
|||||||
|
|
||||||
SetDiffuseColor( D3DXCOLOR(0,0,0,0) ); // invisible
|
SetDiffuseColor( D3DXCOLOR(0,0,0,0) ); // invisible
|
||||||
}
|
}
|
||||||
void SetNew( bool bIsNew )
|
void SetIsNew( bool bIsNew )
|
||||||
{
|
{
|
||||||
m_bIsNew = bIsNew;
|
m_bIsNew = bIsNew;
|
||||||
|
if( m_bIsNew )
|
||||||
SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible
|
SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible
|
||||||
|
else
|
||||||
|
SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
|
||||||
SetState( 0 );
|
SetState( 0 );
|
||||||
};
|
};
|
||||||
void SetBlinking( bool bIsBlinking )
|
void SetBlinking( bool bIsBlinking )
|
||||||
|
|||||||
@@ -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);
|
D3DXCOLOR COLOR_SECTION_LETTER = D3DXCOLOR(1,1,0.3f,1);
|
||||||
|
|
||||||
|
|
||||||
|
WheelItem::WheelItem()
|
||||||
void WheelItem::LoadFromSong( Song &song )
|
|
||||||
{
|
{
|
||||||
|
m_pSong = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WheelItem::LoadFromSong( Song* pSong )
|
||||||
|
{
|
||||||
|
ASSERT( pSong != NULL );
|
||||||
|
|
||||||
|
m_pSong = pSong;
|
||||||
|
|
||||||
m_WheelItemType = TYPE_MUSIC;
|
m_WheelItemType = TYPE_MUSIC;
|
||||||
|
|
||||||
|
m_MusicStatusDisplay.SetIsNew( m_pSong->GetNumTimesPlayed() == 0 );
|
||||||
m_MusicStatusDisplay.SetXY( -132, 0 );
|
m_MusicStatusDisplay.SetXY( -132, 0 );
|
||||||
this->AddActor( &m_MusicStatusDisplay );
|
|
||||||
|
|
||||||
|
m_Banner.LoadFromSong( pSong );
|
||||||
m_Banner.SetHorizAlign( align_left );
|
m_Banner.SetHorizAlign( align_left );
|
||||||
m_Banner.SetXY( 15, 0 );
|
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 )
|
void WheelItem::LoadFromSectionName( CString sSectionName )
|
||||||
@@ -79,18 +83,16 @@ void WheelItem::LoadFromSectionName( CString sSectionName )
|
|||||||
|
|
||||||
m_sprSectionBackground.Load( THEME->GetPathTo(GRAPHIC_SECTION_BACKGROUND) );
|
m_sprSectionBackground.Load( THEME->GetPathTo(GRAPHIC_SECTION_BACKGROUND) );
|
||||||
m_sprSectionBackground.SetXY( -30, 0 );
|
m_sprSectionBackground.SetXY( -30, 0 );
|
||||||
this->AddActor( &m_sprSectionBackground );
|
|
||||||
|
|
||||||
m_textSectionName.Load( THEME->GetPathTo(FONT_OUTLINE) );
|
m_textSectionName.Load( THEME->GetPathTo(FONT_OUTLINE) );
|
||||||
m_textSectionName.TurnShadowOff();
|
m_textSectionName.TurnShadowOff();
|
||||||
m_textSectionName.SetText( sSectionName );
|
m_textSectionName.SetText( sSectionName );
|
||||||
m_textSectionName.SetHorizAlign( align_left );
|
m_textSectionName.SetHorizAlign( align_left );
|
||||||
m_textSectionName.SetXY( -100, 0 );
|
m_textSectionName.SetXY( -85, 0 );
|
||||||
m_textSectionName.SetDiffuseColor( COLOR_SECTION_LETTER );
|
m_textSectionName.SetDiffuseColor( COLOR_SECTION_LETTER );
|
||||||
m_textSectionName.SetZoom( 1.5f );
|
m_textSectionName.SetZoom( 1.5f );
|
||||||
this->AddActor( &m_textSectionName );
|
}
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
void WheelItem::SetTintColor( D3DXCOLOR c )
|
void WheelItem::SetTintColor( D3DXCOLOR c )
|
||||||
{
|
{
|
||||||
@@ -99,7 +101,7 @@ void WheelItem::SetTintColor( D3DXCOLOR c )
|
|||||||
|
|
||||||
void WheelItem::SetDiffuseColor( D3DXCOLOR c )
|
void WheelItem::SetDiffuseColor( D3DXCOLOR c )
|
||||||
{
|
{
|
||||||
ActorFrame::SetDiffuseColor( c );
|
Actor::SetDiffuseColor( c );
|
||||||
|
|
||||||
|
|
||||||
D3DXCOLOR colorTempTint = m_colorTint;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -223,7 +254,6 @@ void MusicWheel::RebuildWheelItems()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_WheelItems.RemoveAll(); // clear out the previous wheel items...
|
m_WheelItems.RemoveAll(); // clear out the previous wheel items...
|
||||||
|
|
||||||
// ...and load new ones
|
// ...and load new ones
|
||||||
@@ -238,7 +268,7 @@ void MusicWheel::RebuildWheelItems()
|
|||||||
for( int i=0; i< arraySongs.GetSize(); i++ )
|
for( int i=0; i< arraySongs.GetSize(); i++ )
|
||||||
{
|
{
|
||||||
Song* pSong = arraySongs[i];
|
Song* pSong = arraySongs[i];
|
||||||
m_WheelItems[i].LoadFromSong( *pSong );
|
m_WheelItems[i].LoadFromSong( pSong );
|
||||||
m_WheelItems[i].SetTintColor( *m_mapGroupNameToColorPtr[pSong->GetGroupName()] );
|
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
|
if( sThisSection == m_sExpandedSectionName ) // this song is in the expanded section
|
||||||
{
|
{
|
||||||
WheelItem &WI = m_WheelItems[iCurWheelItem++];
|
WheelItem &WI = m_WheelItems[iCurWheelItem++];
|
||||||
WI.LoadFromSong( *pSong );
|
WI.LoadFromSong( pSong );
|
||||||
WI.SetTintColor( *m_mapGroupNameToColorPtr[pSong->GetGroupName()] );
|
WI.SetTintColor( *m_mapGroupNameToColorPtr[pSong->GetGroupName()] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ const WindowMessage SM_PlaySongSample = WindowMessage(SM_User+48);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WheelItem : public ActorFrame
|
class WheelItem : public Actor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WheelItem()
|
WheelItem();
|
||||||
{
|
|
||||||
m_pSong = NULL;
|
virtual void Update( float fDeltaTime );
|
||||||
};
|
virtual void RenderPrimitives();
|
||||||
|
|
||||||
void SetTintColor( D3DXCOLOR c );
|
void SetTintColor( D3DXCOLOR c );
|
||||||
void SetDiffuseColor( D3DXCOLOR c );
|
void SetDiffuseColor( D3DXCOLOR c );
|
||||||
@@ -52,10 +52,9 @@ public:
|
|||||||
return m_textSectionName.GetText();
|
return m_textSectionName.GetText();
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoadFromSong( Song &song );
|
void LoadFromSong( Song* pSong );
|
||||||
void LoadFromSectionName( CString sSectionName );
|
void LoadFromSectionName( CString sSectionName );
|
||||||
|
|
||||||
|
|
||||||
// common
|
// common
|
||||||
enum WheelItemType { TYPE_SECTION, TYPE_MUSIC };
|
enum WheelItemType { TYPE_SECTION, TYPE_MUSIC };
|
||||||
WheelItemType m_WheelItemType;
|
WheelItemType m_WheelItemType;
|
||||||
|
|||||||
@@ -66,8 +66,6 @@ bool IsAnInt( CString s )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void RageLogStart()
|
void RageLogStart()
|
||||||
{
|
{
|
||||||
#if defined(DEBUG) | defined(_DEBUG)
|
|
||||||
|
|
||||||
DeleteFile( g_sLogFileName );
|
DeleteFile( g_sLogFileName );
|
||||||
DeleteFile( g_sErrorFileName );
|
DeleteFile( g_sErrorFileName );
|
||||||
|
|
||||||
@@ -82,8 +80,6 @@ void RageLogStart()
|
|||||||
RageLog( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d",
|
RageLog( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d",
|
||||||
st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond );
|
st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond );
|
||||||
RageLog( "\n" );
|
RageLog( "\n" );
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -100,6 +96,8 @@ void RageLog( LPCTSTR fmt, ...)
|
|||||||
sBuff += "\n";
|
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, ...)
|
void RageLogHr( HRESULT hr, LPCTSTR fmt, ...)
|
||||||
@@ -408,13 +406,17 @@ VOID DisplayErrorAndDie( CString sError )
|
|||||||
}
|
}
|
||||||
sError += "\n\n" + fromClipboard;
|
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" );
|
FILE* fp = fopen( g_sErrorFileName, "w" );
|
||||||
|
|
||||||
fprintf( fp, sError );
|
fprintf( fp, sError );
|
||||||
fclose( fp );
|
fclose( fp );
|
||||||
|
// generate an exception so the error handler shows
|
||||||
exit(1);
|
int d = 0;
|
||||||
|
int ksg = 3/d;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,29 @@ END
|
|||||||
//
|
//
|
||||||
|
|
||||||
SPLASH BITMAP DISCARDABLE "splash.bmp"
|
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
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
+126
-23
@@ -30,6 +30,8 @@
|
|||||||
#include "WindowTitleMenu.h"
|
#include "WindowTitleMenu.h"
|
||||||
#include "WindowPlayerOptions.h"
|
#include "WindowPlayerOptions.h"
|
||||||
|
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#include <DXUtil.h>
|
#include <DXUtil.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -45,12 +47,9 @@
|
|||||||
const CString g_sAppName = "StepMania";
|
const CString g_sAppName = "StepMania";
|
||||||
const CString g_sAppClassName = "StepMania Class";
|
const CString g_sAppClassName = "StepMania Class";
|
||||||
|
|
||||||
|
|
||||||
HWND g_hWndMain; // Main Window Handle
|
HWND g_hWndMain; // Main Window Handle
|
||||||
HINSTANCE g_hInstance; // The Handle to Window Instance
|
HINSTANCE g_hInstance; // The Handle to Window Instance
|
||||||
|
HANDLE g_hMutex; // Used to check if an instance of our app is already
|
||||||
#include "ScreenDimensions.h"
|
|
||||||
|
|
||||||
const DWORD g_dwWindowStyle = WS_VISIBLE|WS_POPUP|WS_CAPTION|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU;
|
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
|
// Main game functions
|
||||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
|
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 Update(); // Update the game logic
|
||||||
void Render(); // Render a frame
|
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 SwitchDisplayMode();// BOOL bWindowed, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP );
|
||||||
|
|
||||||
BOOL WeAreAlone( LPSTR szName );
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Name: WinMain()
|
// Name: WinMain()
|
||||||
@@ -87,8 +85,16 @@ BOOL WeAreAlone( LPSTR szName );
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
|
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
|
||||||
{
|
{
|
||||||
if( !WeAreAlone("StepMania") )
|
|
||||||
|
#ifndef DEBUG // don't use error handler in Release mode
|
||||||
|
try
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
|
// Check to see if the app is already running.
|
||||||
|
g_hMutex = CreateMutex( NULL, TRUE, g_sAppName );
|
||||||
|
if( GetLastError() == ERROR_ALREADY_EXISTS )
|
||||||
|
{
|
||||||
|
CloseHandle( g_hMutex );
|
||||||
RageError( "StepMania is already running!" );
|
RageError( "StepMania is already running!" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +158,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
|
|||||||
// Load keyboard accelerators
|
// Load keyboard accelerators
|
||||||
HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) );
|
HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) );
|
||||||
|
|
||||||
|
|
||||||
// run the game
|
// run the game
|
||||||
CreateObjects( g_hWndMain ); // Create the game objects
|
CreateObjects( g_hWndMain ); // Create the game objects
|
||||||
|
|
||||||
@@ -187,14 +192,127 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
|
|||||||
|
|
||||||
|
|
||||||
// clean up after a normal exit
|
// clean up after a normal exit
|
||||||
|
CloseHandle( g_hMutex );
|
||||||
DestroyObjects(); // deallocate our game objects and leave fullscreen
|
DestroyObjects(); // deallocate our game objects and leave fullscreen
|
||||||
DestroyWindow( g_hWndMain );
|
DestroyWindow( g_hWndMain );
|
||||||
UnregisterClass( g_sAppClassName, hInstance );
|
UnregisterClass( g_sAppClassName, hInstance );
|
||||||
CoUninitialize(); // Uninitialize COM
|
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;
|
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()
|
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ RSC=rc.exe
|
|||||||
# PROP BASE Target_Dir ""
|
# PROP BASE Target_Dir ""
|
||||||
# PROP Use_MFC 1
|
# PROP Use_MFC 1
|
||||||
# PROP Use_Debug_Libraries 0
|
# PROP Use_Debug_Libraries 0
|
||||||
# PROP Output_Dir "../Release"
|
# PROP Output_Dir "../"
|
||||||
# PROP Intermediate_Dir "../Release"
|
# PROP Intermediate_Dir "../Release"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
@@ -69,7 +69,7 @@ LINK32=link.exe
|
|||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# 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 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 BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
@@ -737,6 +737,10 @@ SOURCE=.\TipDisplay.h
|
|||||||
# End Group
|
# End Group
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\error.bmp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\splash.bmp
|
SOURCE=.\splash.bmp
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Target
|
# End Target
|
||||||
|
|||||||
@@ -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>
|
Project: "smpackage"=.\smpackage\smpackage.dsp - Package Owner=<4>
|
||||||
|
|
||||||
Package=<5>
|
Package=<5>
|
||||||
|
|||||||
@@ -30,27 +30,28 @@ TextBanner::TextBanner()
|
|||||||
m_textSubTitle.SetHorizAlign( align_left );
|
m_textSubTitle.SetHorizAlign( align_left );
|
||||||
m_textArtist.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_textTitle );
|
||||||
this->AddActor( &m_textSubTitle );
|
this->AddActor( &m_textSubTitle );
|
||||||
this->AddActor( &m_textArtist );
|
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;
|
CString sSubTitle;
|
||||||
|
|
||||||
m_textTitle.SetText( sTitle );
|
m_textTitle.SetText( sTitle );
|
||||||
m_textSubTitle.SetText( sSubTitle );
|
m_textSubTitle.SetText( sSubTitle );
|
||||||
m_textArtist.SetText( "/" + song.GetArtist() );
|
m_textArtist.SetText( "/" + pSong->GetArtist() );
|
||||||
|
|
||||||
|
|
||||||
float fTitleZoom, fSubTitleZoom, fArtistZoom;
|
float fTitleZoom, fSubTitleZoom, fArtistZoom;
|
||||||
|
|||||||
@@ -26,13 +26,10 @@ class TextBanner : public ActorFrame
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextBanner();
|
TextBanner();
|
||||||
bool LoadFromSong( Song &song );
|
bool LoadFromSong( Song* pSong );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BitmapText m_textTitle, m_textSubTitle, m_textArtist;
|
BitmapText m_textTitle, m_textSubTitle, m_textArtist;
|
||||||
|
|
||||||
RectangleActor m_rect;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -2,11 +2,17 @@
|
|||||||
// Microsoft Developer Studio generated include file.
|
// Microsoft Developer Studio generated include file.
|
||||||
// Used by StepMania.RC
|
// Used by StepMania.RC
|
||||||
//
|
//
|
||||||
|
#define IDD_ERROR_DIALOG 111
|
||||||
|
#define BITMAP_ERROR 129
|
||||||
#define IDR_MAIN_ACCEL 1001
|
#define IDR_MAIN_ACCEL 1001
|
||||||
|
#define IDC_BUTTON_RESTART 1001
|
||||||
#define IDM_TOGGLEFULLSCREEN 1002
|
#define IDM_TOGGLEFULLSCREEN 1002
|
||||||
|
#define IDC_BUTTON_REPORT 1002
|
||||||
#define IDM_CHANGERESOLUTION 1003
|
#define IDM_CHANGERESOLUTION 1003
|
||||||
|
#define IDC_BUTTON_VIEW_LOG 1003
|
||||||
#define IDM_CHANGEDISPLAYCOLOR 1004
|
#define IDM_CHANGEDISPLAYCOLOR 1004
|
||||||
#define IDM_CHANGETEXTURECOLOR 1005
|
#define IDM_CHANGETEXTURECOLOR 1005
|
||||||
|
#define IDC_EDIT_ERROR 1005
|
||||||
#define IDM_TOGGLESTATISTICS 1006
|
#define IDM_TOGGLESTATISTICS 1006
|
||||||
#define IDI_ICON 1007
|
#define IDI_ICON 1007
|
||||||
#define IDC_CURSOR 1008
|
#define IDC_CURSOR 1008
|
||||||
@@ -16,7 +22,7 @@
|
|||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#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_COMMAND_VALUE 40009
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1009
|
#define _APS_NEXT_CONTROL_VALUE 1009
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
|||||||
Reference in New Issue
Block a user