fix tools.exe build, runtime errors

This commit is contained in:
Chris Danford
2005-12-18 01:27:54 +00:00
parent 46f5a33ae0
commit 572576021c
10 changed files with 50 additions and 53 deletions
-10
View File
@@ -1,8 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepMania-net2003.vcproj", "{670745A6-106B-420D-A2A9-D4F89A23986E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug Debug = Debug
@@ -10,12 +6,6 @@ Global
Release = Release Release = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.Build.0 = Debug|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.FastDebug.ActiveCfg = FastDebug|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.FastDebug.Build.0 = FastDebug|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
DPBuild = 5 DPBuild = 5
+1
View File
@@ -1,6 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smpackage", "smpackage-net2003.vcproj", "{6B369A92-8DDF-487C-A589-614987544197}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smpackage", "smpackage-net2003.vcproj", "{6B369A92-8DDF-487C-A589-614987544197}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{F8FE2773-87CB-402F-8DC8-A80837C3E24C} = {F8FE2773-87CB-402F-8DC8-A80837C3E24C}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZipArchive", "smpackage\ZipArchive\ZipArchive-net2003.vcproj", "{F8FE2773-87CB-402F-8DC8-A80837C3E24C}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZipArchive", "smpackage\ZipArchive\ZipArchive-net2003.vcproj", "{F8FE2773-87CB-402F-8DC8-A80837C3E24C}"
+4 -7
View File
@@ -41,7 +41,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="smpackage\ZipArchive\Release\ZipArchive.lib" AdditionalDependencies="smpackage\ZipArchive\Debug\ZipArchive.lib"
OutputFile="./../Program/tools-debug.exe" OutputFile="./../Program/tools-debug.exe"
LinkIncremental="0" LinkIncremental="0"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
@@ -250,10 +250,10 @@
RelativePath="menu.bmp"> RelativePath="menu.bmp">
</File> </File>
<File <File
RelativePath="res\smpackage.ico"> RelativePath="smpackage.ICO">
</File> </File>
<File <File
RelativePath="smpackage.ICO"> RelativePath="res\smpackage.ico">
</File> </File>
<File <File
RelativePath=".\smpackage\smpackage.rc"> RelativePath=".\smpackage\smpackage.rc">
@@ -490,13 +490,10 @@
<File <File
RelativePath=".\smpackage\smpackage.ICO"> RelativePath=".\smpackage\smpackage.ICO">
</File> </File>
<File
RelativePath=".\smpackage\ZipArchive\Release\ZipArchive.lib">
</File>
</Files> </Files>
<Globals> <Globals>
<Global <Global
Name="RESOURCE_FILE" Name="RESOURCE_FILE"
Value="smpackage.rc"/> Value="smpackage\smpackage.rc"/>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>
+10 -2
View File
@@ -15,6 +15,7 @@
#include "archutils/Win32/SpecialDirs.h" #include "archutils/Win32/SpecialDirs.h"
#include "SpecialFiles.h" #include "SpecialFiles.h"
#include "ProductInfo.h" #include "ProductInfo.h"
#include ".\mainmenudlg.h"
#ifdef _DEBUG #ifdef _DEBUG
#define new DEBUG_NEW #define new DEBUG_NEW
@@ -56,6 +57,7 @@ BEGIN_MESSAGE_MAP(MainMenuDlg, CDialog)
//}}AFX_MSG_MAP //}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_BUTTON_LAUNCH_GAME, OnBnClickedButtonLaunchGame) ON_BN_CLICKED(IDC_BUTTON_LAUNCH_GAME, OnBnClickedButtonLaunchGame)
ON_BN_CLICKED(IDC_VIEW_STATISTICS, OnBnClickedViewStatistics) ON_BN_CLICKED(IDC_VIEW_STATISTICS, OnBnClickedViewStatistics)
ON_BN_CLICKED(IDC_CLEAR_CACHE, OnBnClickedClearCache)
END_MESSAGE_MAP() END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -236,8 +238,8 @@ void MainMenuDlg::OnBnClickedClearPreferences()
void MainMenuDlg::OnBnClickedButtonLaunchGame() void MainMenuDlg::OnBnClickedButtonLaunchGame()
{ {
// TODO: Add your control notification handler code here // TODO: Add your control notification handler code here
SMPackageUtil::LaunchGame(); if( SMPackageUtil::LaunchGame() )
exit(0); exit(0);
} }
void MainMenuDlg::OnBnClickedViewStatistics() void MainMenuDlg::OnBnClickedViewStatistics()
@@ -248,3 +250,9 @@ void MainMenuDlg::OnBnClickedViewStatistics()
if( NULL == ::ShellExecute( this->m_hWnd, "open", sFile, "", "", SW_SHOWNORMAL ) ) if( NULL == ::ShellExecute( this->m_hWnd, "open", sFile, "", "", SW_SHOWNORMAL ) )
MessageBox( "Failed to open '" + sFile + "': " + GetLastErrorString() ); MessageBox( "Failed to open '" + sFile + "': " + GetLastErrorString() );
} }
void MainMenuDlg::OnBnClickedClearCache()
{
// TODO: Add your control notification handler code here
ASSERT(0);
}
+1
View File
@@ -50,6 +50,7 @@ protected:
public: public:
afx_msg void OnBnClickedButtonLaunchGame(); afx_msg void OnBnClickedButtonLaunchGame();
afx_msg void OnBnClickedViewStatistics(); afx_msg void OnBnClickedViewStatistics();
afx_msg void OnBnClickedClearCache();
}; };
//{{AFX_INSERT_LOCATION}} //{{AFX_INSERT_LOCATION}}
+4 -3
View File
@@ -161,7 +161,7 @@ bool SMPackageUtil::IsValidPackageDirectory( RString path )
return true; return true;
} }
void SMPackageUtil::LaunchGame() bool SMPackageUtil::LaunchGame()
{ {
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
STARTUPINFO si; STARTUPINFO si;
@@ -173,8 +173,8 @@ void SMPackageUtil::LaunchGame()
sFile = "Program\\" + sFile; sFile = "Program\\" + sFile;
if( !DoesFileExist(sFile) ) if( !DoesFileExist(sFile) )
{ {
MessageBox( NULL, "Error", "Could not find " PRODUCT_NAME ".exe", MB_ICONEXCLAMATION ); MessageBox( NULL, "Could not find " PRODUCT_NAME ".exe", "Error", MB_ICONEXCLAMATION );
return; return false;
} }
} }
@@ -190,4 +190,5 @@ void SMPackageUtil::LaunchGame()
&si, // pointer to STARTUPINFO &si, // pointer to STARTUPINFO
&pi // pointer to PROCESS_INFORMATION &pi // pointer to PROCESS_INFORMATION
); );
return true;
} }
+2
View File
@@ -52,6 +52,8 @@
#define IDC_EDIT_DEFAULT 1029 #define IDC_EDIT_DEFAULT 1029
#define IDC_CLEAR_KEYMAPS 1029 #define IDC_CLEAR_KEYMAPS 1029
#define IDC_VIEW_STATISTICS 1030 #define IDC_VIEW_STATISTICS 1030
#define IDC_CLEAR_KEYMAPS2 1031
#define IDC_CLEAR_CACHE 1031
#define IDC_BUTTON_REFRESH 1035 #define IDC_BUTTON_REFRESH 1035
#define IDC_BUTTON_SAVE 1036 #define IDC_BUTTON_SAVE 1036
#define IDC_BUTTON_OVERRIDE 1037 #define IDC_BUTTON_OVERRIDE 1037
+9 -15
View File
@@ -11,6 +11,7 @@
#include "smpackageUtil.h" #include "smpackageUtil.h"
#include "MainMenuDlg.h" #include "MainMenuDlg.h"
#include "RageFileManager.h" #include "RageFileManager.h"
#include "arch/arch.h"
#ifdef _DEBUG #ifdef _DEBUG
@@ -44,27 +45,20 @@ CSmpackageApp theApp;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CSmpackageApp initialization // CSmpackageApp initialization
#include "RageLog.h"
#include "RageFileManager.h"
BOOL CSmpackageApp::InitInstance() BOOL CSmpackageApp::InitInstance()
{ {
// Make sure the current directory is the root program directory /* Almost everything uses this to read and write files. Load this early. */
FILEMAN = new RageFileManager( "" );
FILEMAN->MountInitialFilesystems();
// change dir to path of the execuctable /* Set this up next. Do this early, since it's needed for RageException::Throw. */
TCHAR szFullAppPath[MAX_PATH]; LOG = new RageLog();
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
// strip off executable name
LPSTR pLastBackslash = strrchr(szFullAppPath, '\\');
*pLastBackslash = '\0'; // terminate the string
/* If "Program" is the top-level directory, strip it off. */ if( DoesFileExist("Songs") ) // this is a SM program directory
pLastBackslash = strrchr( szFullAppPath, '\\' );
if( pLastBackslash && !stricmp(pLastBackslash, "\\Program") )
*pLastBackslash = '\0';
SetCurrentDirectory(szFullAppPath);
if( DoesFileExist("Songs") ) // this is a SM or DWI program directory
{ {
// make sure it's in the list of install directories // make sure it's in the list of install directories
TCHAR szCurrentDirectory[MAX_PATH]; TCHAR szCurrentDirectory[MAX_PATH];
+18 -15
View File
@@ -155,23 +155,23 @@ BEGIN
IDC_STATIC,18,144,196,17 IDC_STATIC,18,144,196,17
END END
IDD_MENU DIALOGEX 0, 0, 332, 310 IDD_MENU DIALOGEX 0, 0, 334, 303
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "StepMania Tools Main Menu" CAPTION "StepMania Tools Main Menu"
FONT 8, "MS Sans Serif", 0, 0, 0x1 FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Exit",IDOK,275,289,50,14 DEFPUSHBUTTON "Exit",IDOK,277,282,50,14
CONTROL 140,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38 CONTROL 140,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38
GROUPBOX "Installation",IDC_STATIC,7,41,318,28 GROUPBOX "Installation",IDC_STATIC,7,41,320,28
PUSHBUTTON "Edit Installations",IDC_EDIT_INSTALLATIONS,241,49,75,15 PUSHBUTTON "Edit Installations",IDC_EDIT_INSTALLATIONS,241,49,75,15
GROUPBOX "Create and Share",IDC_STATIC,7,198,318,86 GROUPBOX "Create and Share",IDC_STATIC,7,219,320,57
PUSHBUTTON "Export Packages",IDC_EXPORT_PACKAGES,15,213,75,15 PUSHBUTTON "Export Packages",IDC_EXPORT_PACKAGES,15,234,75,15
LTEXT "Create .smzip package files to share with other users. Packages can contain songs, courses, themes, backgrounds, and more.", LTEXT "Create .smzip package files to share with other users. Packages can contain songs, courses, themes, backgrounds, and more.",
IDC_STATIC,104,212,215,18 IDC_STATIC,104,233,215,18
PUSHBUTTON "Create Song",IDC_CREATE_SONG,15,260,75,15 PUSHBUTTON "Create Song",IDC_CREATE_SONG,15,255,75,15
LTEXT "Choose this option to create a new song in StepMania from your favorite mp3 or ogg music file.", LTEXT "Create a new song in StepMania from your favorite mp3 or ogg music file.",
IDC_STATIC,103,259,215,20 IDC_STATIC,103,254,215,20
GROUPBOX "Game Settings",IDC_STATIC,7,109,318,87 GROUPBOX "Troubleshooting",IDC_STATIC,7,109,320,109
PUSHBUTTON "Change Preferences",IDC_CHANGE_PREFERENCES,16,120,75,15 PUSHBUTTON "Change Preferences",IDC_CHANGE_PREFERENCES,16,120,75,15
PUSHBUTTON "Open Preferences",IDC_OPEN_PREFERENCES,16,152,75,15 PUSHBUTTON "Open Preferences",IDC_OPEN_PREFERENCES,16,152,75,15
LTEXT "Using this feature, you can:\n - Change the graphics API that the game will use.\n - Change the sound API that the game will use.\n - Clear all preferences if the game won't start.\n - Open the preferences file to make changes by hand.", LTEXT "Using this feature, you can:\n - Change the graphics API that the game will use.\n - Change the sound API that the game will use.\n - Clear all preferences if the game won't start.\n - Open the preferences file to make changes by hand.",
@@ -182,11 +182,14 @@ BEGIN
ES_READONLY ES_READONLY
LTEXT "Erase all of your keyboard and joystick mappings if you've made a mistake.", LTEXT "Erase all of your keyboard and joystick mappings if you've made a mistake.",
IDC_STATIC,104,174,214,18 IDC_STATIC,104,174,214,18
PUSHBUTTON "Launch Game",IDC_BUTTON_LAUNCH_GAME,189,289,70,14 PUSHBUTTON "Launch Game",IDC_BUTTON_LAUNCH_GAME,189,282,70,14
PUSHBUTTON "View Statistics",IDC_VIEW_STATISTICS,16,85,75,15 PUSHBUTTON "View Statistics",IDC_VIEW_STATISTICS,16,85,75,15
LTEXT "View high scores and usage statistics and other saved from your play.", LTEXT "View high scores and usage statistics and other data saved from your play.",
IDC_STATIC,103,84,215,20 IDC_STATIC,103,84,215,20
GROUPBOX "Statistics",IDC_STATIC,7,72,318,35 GROUPBOX "Statistics",IDC_STATIC,7,72,320,35
PUSHBUTTON "Clear Cache",IDC_CLEAR_CACHE,16,196,75,15
LTEXT "Erase the song and course cache. Use this if you change a song file and the change isn't showing in-game.",
IDC_STATIC,104,196,214,18
END END
IDD_ENTER_COMMENT DIALOGEX 0, 0, 312, 202 IDD_ENTER_COMMENT DIALOGEX 0, 0, 312, 202
@@ -350,9 +353,9 @@ BEGIN
IDD_MENU, DIALOG IDD_MENU, DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 325 RIGHTMARGIN, 327
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 303 BOTTOMMARGIN, 296
END END
IDD_ENTER_COMMENT, DIALOG IDD_ENTER_COMMENT, DIALOG
+1 -1
View File
@@ -15,7 +15,7 @@ namespace SMPackageUtil
RString GetPackageDirectory(RString path); RString GetPackageDirectory(RString path);
bool IsValidPackageDirectory(RString path); bool IsValidPackageDirectory(RString path);
void LaunchGame(); bool LaunchGame();
} }
#endif #endif