break up arch stuff into smaller .cpp files to fix smpackage build and not pull in unnecessary stuff

This commit is contained in:
Chris Danford
2005-12-16 04:16:09 +00:00
parent ddce0cc239
commit 353e0c5b6e
55 changed files with 647 additions and 327 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
#include "RageUtil_AutoPtr.h" #include "RageUtil_AutoPtr.h"
#include "ActorCommands.h" #include "ActorCommands.h"
#include <map> #include <map>
struct XNode; class XNode;
struct lua_State; struct lua_State;
class LuaReference; class LuaReference;
class LuaClass; class LuaClass;
+1 -1
View File
@@ -5,7 +5,7 @@
#include "ActorFrame.h" #include "ActorFrame.h"
#include "Quad.h" #include "Quad.h"
struct XNode; class XNode;
#include "LuaExpressionTransform.h" #include "LuaExpressionTransform.h"
class ActorScroller : public ActorFrame class ActorScroller : public ActorFrame
+2 -1
View File
@@ -9,6 +9,7 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "EnumHelper.h" #include "EnumHelper.h"
#include "XmlFile.h" #include "XmlFile.h"
#include "XmlFileUtil.h"
#include "LuaManager.h" #include "LuaManager.h"
#include "Foreach.h" #include "Foreach.h"
@@ -368,7 +369,7 @@ Actor* ActorUtil::MakeActor( const CString &sPath_, const XNode *pParent )
case FT_Xml: case FT_Xml:
{ {
XNode xml; XNode xml;
if( !xml.LoadFromFile(sPath) ) if( !XmlFileUtil::LoadFromFileShowErrors(xml, sPath) )
{ {
// XNode will warn about the error // XNode will warn about the error
return new Actor; return new Actor;
+1 -1
View File
@@ -6,7 +6,7 @@
#include "Actor.h" #include "Actor.h"
#include "RageTexture.h" #include "RageTexture.h"
struct XNode; class XNode;
typedef Actor* (*CreateActorFn)(const CString& sDir, const XNode* pNode); typedef Actor* (*CreateActorFn)(const CString& sDir, const XNode* pNode);
+1 -1
View File
@@ -4,7 +4,7 @@
#define AutoActor_H #define AutoActor_H
class Actor; class Actor;
struct XNode; class XNode;
// creates the appropriate Actor derivitive on load and // creates the appropriate Actor derivitive on load and
// automatically deletes Actor on deconstruction. // automatically deletes Actor on deconstruction.
+1 -1
View File
@@ -5,7 +5,7 @@
#include "ActorFrame.h" #include "ActorFrame.h"
struct XNode; class XNode;
class BGAnimation : public ActorFrameAutoDeleteChildren class BGAnimation : public ActorFrameAutoDeleteChildren
{ {
+1 -1
View File
@@ -7,7 +7,7 @@
#include "ActorFrame.h" #include "ActorFrame.h"
#include <map> #include <map>
struct XNode; class XNode;
class BGAnimationLayer : public ActorFrame class BGAnimationLayer : public ActorFrame
{ {
+2 -1
View File
@@ -21,6 +21,7 @@
#include <set> #include <set>
#include <float.h> #include <float.h>
#include "XmlFile.h" #include "XmlFile.h"
#include "XmlFileUtil.h"
#include "BackgroundUtil.h" #include "BackgroundUtil.h"
#include "song.h" #include "song.h"
#include "AutoActor.h" #include "AutoActor.h"
@@ -181,7 +182,7 @@ void BackgroundImpl::Init()
const CString &sName = vsNames[i]; const CString &sName = vsNames[i];
XNode xml; XNode xml;
xml.LoadFromFile( sPath ); XmlFileUtil::LoadFromFileShowErrors(xml, sPath);
ASSERT( xml.m_sName == "BackgroundTransition" ); ASSERT( xml.m_sName == "BackgroundTransition" );
BackgroundTransition &bgt = m_mapNameToTransition[sName]; BackgroundTransition &bgt = m_mapNameToTransition[sName];
+1 -1
View File
@@ -4,7 +4,7 @@
#define BackgroundUtil_H #define BackgroundUtil_H
class Song; class Song;
struct XNode; class XNode;
extern const CString RANDOM_BACKGROUND_FILE; extern const CString RANDOM_BACKGROUND_FILE;
extern const CString NO_SONG_BG_FILE; extern const CString NO_SONG_BG_FILE;
+2 -1
View File
@@ -8,6 +8,7 @@
#include "SongManager.h" #include "SongManager.h"
#include "RageFile.h" #include "RageFile.h"
#include "XmlFile.h" #include "XmlFile.h"
#include "XmlFileUtil.h"
#include <ctime> #include <ctime>
@@ -122,7 +123,7 @@ void Bookkeeper::ReadFromDisk()
return; return;
XNode xml; XNode xml;
if( !xml.LoadFromFile(COINS_DAT) ) if( !XmlFileUtil::LoadFromFileShowErrors(xml, COINS_DAT) )
return; return;
LoadFromNode( &xml ); LoadFromNode( &xml );
+1 -1
View File
@@ -5,7 +5,7 @@
#include "DateTime.h" #include "DateTime.h"
#include <map> #include <map>
struct XNode; class XNode;
class Bookkeeper class Bookkeeper
{ {
+1 -1
View File
@@ -7,7 +7,7 @@
class Course; class Course;
class Profile; class Profile;
struct XNode; class XNode;
class CourseEntry; class CourseEntry;
namespace CourseUtil namespace CourseUtil
-11
View File
@@ -1,7 +1,6 @@
#include "global.h" #include "global.h"
#include "DateTime.h" #include "DateTime.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "LuaFunctions.h"
DateTime::DateTime() DateTime::DateTime()
@@ -200,7 +199,6 @@ CString MonthToString( int iMonthIndex )
return CString(); return CString();
return MONTH_TO_NAME[iMonthIndex]; return MONTH_TO_NAME[iMonthIndex];
} }
LuaFunction( MonthToString, MonthToString( IArg(1) ) );
CString LastWeekToString( int iLastWeekIndex ) CString LastWeekToString( int iLastWeekIndex )
{ {
@@ -308,15 +306,6 @@ tm GetDayInYearAndYear( int iDayInYearIndex, int iYear )
return when; return when;
} }
LuaFunction( MonthOfYear, GetLocalTime().tm_mon );
LuaFunction( DayOfMonth, GetLocalTime().tm_mday );
LuaFunction( Hour, GetLocalTime().tm_hour );
LuaFunction( Minute, GetLocalTime().tm_min );
LuaFunction( Second, GetLocalTime().tm_sec );
LuaFunction( Year, GetLocalTime().tm_year+1900 );
LuaFunction( Weekday, GetLocalTime().tm_wday );
LuaFunction( DayOfYear, GetLocalTime().tm_yday );
/* /*
* (c) 2001-2004 Chris Danford * (c) 2001-2004 Chris Danford
* All rights reserved. * All rights reserved.
+39
View File
@@ -0,0 +1,39 @@
#include "global.h"
#include "DateTime.h"
#include "LuaFunctions.h"
#include "RageUtil.h"
LuaFunction( MonthToString, MonthToString( IArg(1) ) );
LuaFunction( MonthOfYear, GetLocalTime().tm_mon );
LuaFunction( DayOfMonth, GetLocalTime().tm_mday );
LuaFunction( Hour, GetLocalTime().tm_hour );
LuaFunction( Minute, GetLocalTime().tm_min );
LuaFunction( Second, GetLocalTime().tm_sec );
LuaFunction( Year, GetLocalTime().tm_year+1900 );
LuaFunction( Weekday, GetLocalTime().tm_wday );
LuaFunction( DayOfYear, GetLocalTime().tm_yday );
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+1 -1
View File
@@ -9,7 +9,7 @@
#include "DateTime.h" #include "DateTime.h"
#include "RageUtil_AutoPtr.h" #include "RageUtil_AutoPtr.h"
struct XNode; class XNode;
struct HighScoreImpl; struct HighScoreImpl;
struct HighScore struct HighScore
+4 -2
View File
@@ -128,7 +128,8 @@ Trail.cpp Trail.h TrailUtil.cpp TrailUtil.h TitleSubstitution.cpp TitleSubstitut
FileTypes = IniFile.cpp IniFile.h \ FileTypes = IniFile.cpp IniFile.h \
MsdFile.cpp MsdFile.h \ MsdFile.cpp MsdFile.h \
XmlFile.cpp XmlFile.h XmlFile.cpp XmlFile.h \
XmlFileUtil.cpp XmlFileUtil.h
StepMania = StdString.h \ StepMania = StdString.h \
StepMania.cpp StepMania.h \ StepMania.cpp StepMania.h \
@@ -163,7 +164,8 @@ Sound += arch/Sound/ALSA9Dynamic.cpp arch/Sound/ALSA9Dynamic.h arch/Sound/ALSA9F
AM_CXXFLAGS += $(ALSA_CFLAGS) AM_CXXFLAGS += $(ALSA_CFLAGS)
endif endif
ArchHooks = arch/ArchHooks/ArchHooks.cpp arch/ArchHooks/ArchHooks.h ArchHooks = arch/ArchHooks/ArchHooks.cpp arch/ArchHooks/ArchHooks.h \
arch/ArchHooks/ArchHooksUtil.cpp
InputHandler = arch/InputHandler/InputHandler.cpp arch/InputHandler/InputHandler.h \ InputHandler = arch/InputHandler/InputHandler.cpp arch/InputHandler/InputHandler.h \
arch/InputHandler/InputHandler_MonkeyKeyboard.cpp arch/InputHandler/InputHandler_MonkeyKeyboard.h arch/InputHandler/InputHandler_MonkeyKeyboard.cpp arch/InputHandler/InputHandler_MonkeyKeyboard.h
+1 -1
View File
@@ -4,7 +4,7 @@
#define NOTE_TYPES_H #define NOTE_TYPES_H
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
struct XNode; class XNode;
struct TapNoteResult struct TapNoteResult
{ {
+1 -1
View File
@@ -10,7 +10,7 @@
#include "AutoActor.h" #include "AutoActor.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "ThemeMetric.h" #include "ThemeMetric.h"
struct XNode; class XNode;
enum PaneTypes enum PaneTypes
{ {
+24
View File
@@ -11,6 +11,7 @@
#include "Preference.h" #include "Preference.h"
#include "RageLog.h" #include "RageLog.h"
const CString DEFAULTS_INI_PATH = "Data/Defaults.ini"; // these can be overridden const CString DEFAULTS_INI_PATH = "Data/Defaults.ini"; // these can be overridden
//PREFERENCES_INI_PATH // overlay on Defaults.ini, contains the user's choices //PREFERENCES_INI_PATH // overlay on Defaults.ini, contains the user's choices
#include "SpecialFiles.h" #include "SpecialFiles.h"
@@ -615,6 +616,29 @@ CString PrefsManager::GetLightsDriver()
return m_sLightsDriver; return m_sLightsDriver;
} }
bool PrefsManager::MessageIsIgnored( const CString &ID )
{
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
for( unsigned i = 0; i < list.size(); ++i )
if( !ID.CompareNoCase(list[i]) )
return true;
return false;
}
void PrefsManager::IgnoreMessage( const CString &ID )
{
if( ID == "" )
if( MessageIsIgnored(ID) )
return;
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
list.push_back( ID );
PREFSMAN->m_sIgnoredMessageWindows.Set( join(",",list) );
PREFSMAN->SavePrefsToDisk();
}
// lua start // lua start
#include "LuaBinding.h" #include "LuaBinding.h"
+3
View File
@@ -292,6 +292,9 @@ public:
CString GetPreferencesSection() const; CString GetPreferencesSection() const;
bool MessageIsIgnored( const CString &ID );
void IgnoreMessage( const CString &ID );
// //
// For self-registering prefs // For self-registering prefs
// //
+2 -1
View File
@@ -18,6 +18,7 @@
#include "crypto/CryptRand.h" #include "crypto/CryptRand.h"
#include "UnlockManager.h" #include "UnlockManager.h"
#include "XmlFile.h" #include "XmlFile.h"
#include "XmlFileUtil.h"
#include "Foreach.h" #include "Foreach.h"
#include "CatalogXml.h" #include "CatalogXml.h"
#include "Bookkeeper.h" #include "Bookkeeper.h"
@@ -861,7 +862,7 @@ ProfileLoadResult Profile::LoadAllFromDir( CString sDir, bool bRequireSignature
LOG->Trace( "Loading %s", fn.c_str() ); LOG->Trace( "Loading %s", fn.c_str() );
XNode xml; XNode xml;
if( !xml.LoadFromFile(fn) ) if( !XmlFileUtil::LoadFromFileShowErrors(xml, fn) )
return ProfileLoadResult_FailedTampered; return ProfileLoadResult_FailedTampered;
LOG->Trace( "Done." ); LOG->Trace( "Done." );
+1 -1
View File
@@ -17,7 +17,7 @@
#include "StyleUtil.h" // for StyleID #include "StyleUtil.h" // for StyleID
#include "LuaReference.h" // for LuaData #include "LuaReference.h" // for LuaData
struct XNode; class XNode;
struct lua_State; struct lua_State;
class Character; class Character;
+1 -1
View File
@@ -7,7 +7,7 @@
#define RADAR_VAL_UNKNOWN -1 #define RADAR_VAL_UNKNOWN -1
struct XNode; class XNode;
struct RadarValues struct RadarValues
{ {
+3 -2
View File
@@ -31,7 +31,8 @@
#endif #endif
/* Assume TLS doesn't work until told otherwise. It's ArchHooks's job to set this. */ /* Assume TLS doesn't work until told otherwise. It's ArchHooks's job to set this. */
bool RageThread::m_bSystemSupportsTLS = false; bool RageThread::s_bSystemSupportsTLS = false;
bool RageThread::s_bIsShowingDialog = false;
#define MAX_THREADS 128 #define MAX_THREADS 128
//static vector<RageMutex*> *g_MutexList = NULL; /* watch out for static initialization order problems */ //static vector<RageMutex*> *g_MutexList = NULL; /* watch out for static initialization order problems */
@@ -743,7 +744,7 @@ retry:
if( m_pSema->Wait() ) if( m_pSema->Wait() )
return; return;
if( !bFailOnTimeout || Dialog::IsShowingDialog() ) if( !bFailOnTimeout || RageThread::GetIsShowingDialog() )
goto retry; goto retry;
/* We waited too long. We're probably deadlocked, though unlike mutexes, we can't /* We waited too long. We're probably deadlocked, though unlike mutexes, we can't
+6 -3
View File
@@ -10,7 +10,8 @@ class RageThread
ThreadSlot *m_pSlot; ThreadSlot *m_pSlot;
CString name; CString name;
static bool m_bSystemSupportsTLS; static bool s_bSystemSupportsTLS;
static bool s_bIsShowingDialog;
public: public:
RageThread(); RageThread();
@@ -39,9 +40,11 @@ public:
/* A system can define HAVE_TLS, indicating that it can compile thread_local /* A system can define HAVE_TLS, indicating that it can compile thread_local
* code, but an individual environment may not actually have functional TLS. * code, but an individual environment may not actually have functional TLS.
* If this returns false, thread_local variables are considered undefined. */ * If this returns false, thread_local variables are considered undefined. */
static bool GetSupportsTLS() { return m_bSystemSupportsTLS; } static bool GetSupportsTLS() { return s_bSystemSupportsTLS; }
static void SetSupportsTLS( bool b ) { s_bSystemSupportsTLS = b; }
static void SetSupportsTLS( bool b ) { m_bSystemSupportsTLS = b; } static bool GetIsShowingDialog() { return s_bIsShowingDialog; }
static void SetIsShowingDialog( bool b ) { s_bIsShowingDialog = b; }
}; };
namespace Checkpoints namespace Checkpoints
+1 -1
View File
@@ -8,7 +8,7 @@
class Song; class Song;
class Profile; class Profile;
struct XNode; class XNode;
namespace SongUtil namespace SongUtil
{ {
+20 -2
View File
@@ -818,6 +818,9 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="DateTime.h"> RelativePath="DateTime.h">
</File> </File>
<File
RelativePath=".\DateTimeLua.cpp">
</File>
<File <File
RelativePath="Difficulty.cpp"> RelativePath="Difficulty.cpp">
</File> </File>
@@ -1185,6 +1188,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="XmlFile.h"> RelativePath="XmlFile.h">
</File> </File>
<File
RelativePath=".\XmlFileUtil.cpp">
</File>
<File
RelativePath=".\XmlFileUtil.h">
</File>
</Filter> </Filter>
<Filter <Filter
Name="StepMania" Name="StepMania"
@@ -1305,6 +1314,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="arch\ArchHooks\ArchHooks_Win32.h"> RelativePath="arch\ArchHooks\ArchHooks_Win32.h">
</File> </File>
<File
RelativePath=".\arch\ArchHooks\ArchHooks_Win32Static.cpp">
</File>
<File
RelativePath=".\arch\ArchHooks\ArchHooksUtil.cpp">
</File>
</Filter> </Filter>
<Filter <Filter
Name="InputHandler" Name="InputHandler"
@@ -1536,6 +1551,9 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="archutils\Win32\arch_setup.h"> RelativePath="archutils\Win32\arch_setup.h">
</File> </File>
<File
RelativePath=".\archutils\Win32\arch_time.cpp">
</File>
<File <File
RelativePath="archutils\Win32\Crash.cpp"> RelativePath="archutils\Win32\Crash.cpp">
</File> </File>
@@ -1543,10 +1561,10 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
RelativePath="archutils\Win32\Crash.h"> RelativePath="archutils\Win32\Crash.h">
</File> </File>
<File <File
RelativePath="archutils\Win32\DebugInfoHunt.cpp"> RelativePath=".\archutils\Win32\DebugInfoHunt.cpp">
</File> </File>
<File <File
RelativePath="archutils\Win32\DebugInfoHunt.h"> RelativePath=".\archutils\Win32\DebugInfoHunt.h">
</File> </File>
<File <File
RelativePath="archutils\Win32\GetFileInformation.cpp"> RelativePath="archutils\Win32\GetFileInformation.cpp">
+1 -1
View File
@@ -261,7 +261,7 @@ void ShutdownGame()
/* Cleanly shut down, show a dialog and exit the game. We don't go back /* Cleanly shut down, show a dialog and exit the game. We don't go back
* up the call stack, to avoid having to use exceptions. */ * up the call stack, to avoid having to use exceptions. */
void StepMania::HandleException( CString error ) void NORETURN StepMania::HandleException( RString error )
{ {
if( g_bAutoRestart ) if( g_bAutoRestart )
HOOKS->RestartProgram(); HOOKS->RestartProgram();
+31 -3
View File
@@ -1,5 +1,5 @@
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 60000 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Application" 0x0101
@@ -62,7 +62,7 @@ IntDir=.\../Debug6
TargetDir=\cvs\stepmania\Program TargetDir=\cvs\stepmania\Program
TargetName=StepMania-debug TargetName=StepMania-debug
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool # End Special Build Tool
@@ -99,7 +99,7 @@ IntDir=.\../Release6
TargetDir=\cvs\stepmania\Program TargetDir=\cvs\stepmania\Program
TargetName=StepMania TargetName=StepMania
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool # End Special Build Tool
@@ -1266,6 +1266,14 @@ SOURCE=.\XmlFile.cpp
SOURCE=.\XmlFile.h SOURCE=.\XmlFile.h
# End Source File # End Source File
# Begin Source File
SOURCE=.\XmlFileUtil.cpp
# End Source File
# Begin Source File
SOURCE=.\XmlFileUtil.h
# End Source File
# End Group # End Group
# Begin Group "StepMania" # Begin Group "StepMania"
@@ -1372,6 +1380,14 @@ SOURCE=.\arch\ArchHooks\ArchHooks_Win32.cpp
SOURCE=.\arch\ArchHooks\ArchHooks_Win32.h SOURCE=.\arch\ArchHooks\ArchHooks_Win32.h
# End Source File # End Source File
# Begin Source File
SOURCE=.\arch\ArchHooks\ArchHooks_Win32Static.cpp
# End Source File
# Begin Source File
SOURCE=.\arch\ArchHooks\ArchHooksUtil.cpp
# End Source File
# End Group # End Group
# Begin Group "InputHandler" # Begin Group "InputHandler"
@@ -1647,6 +1663,10 @@ SOURCE=.\archutils\Win32\arch_setup.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\archutils\Win32\arch_time.cpp
# End Source File
# Begin Source File
SOURCE=.\archutils\Win32\Crash.cpp SOURCE=.\archutils\Win32\Crash.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -1770,6 +1790,14 @@ SOURCE=.\ScreenDimensions.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\SpecialFiles.cpp
# End Source File
# Begin Source File
SOURCE=.\SpecialFiles.h
# End Source File
# Begin Source File
SOURCE=.\StdString.h SOURCE=.\StdString.h
# End Source File # End Source File
# Begin Source File # Begin Source File
+1 -1
View File
@@ -7,7 +7,7 @@
class Steps; class Steps;
class Song; class Song;
class Profile; class Profile;
struct XNode; class XNode;
namespace StepsUtil namespace StepsUtil
{ {
+1 -1
View File
@@ -3,7 +3,7 @@
class Style; class Style;
class Song; class Song;
struct XNode; class XNode;
class StyleID class StyleID
{ {
+2 -1
View File
@@ -7,6 +7,7 @@
#include "RageFile.h" #include "RageFile.h"
#include "Foreach.h" #include "Foreach.h"
#include "XmlFile.h" #include "XmlFile.h"
#include "XmlFileUtil.h"
static const CString TRANSLATIONS_PATH = "Data/Translations.xml"; static const CString TRANSLATIONS_PATH = "Data/Translations.xml";
static const CString ERASE_MARKER = "-erase-"; static const CString ERASE_MARKER = "-erase-";
@@ -137,7 +138,7 @@ TitleSubst::TitleSubst(const CString &section)
void TitleSubst::Load(const CString &filename, const CString &section) void TitleSubst::Load(const CString &filename, const CString &section)
{ {
XNode xml; XNode xml;
if( !xml.LoadFromFile(filename) ) if( !XmlFileUtil::LoadFromFileShowErrors(xml,filename) )
{ {
// LoadFromFile will show its own error // LoadFromFile will show its own error
//LOG->Trace("Error opening %s: %s", filename.c_str(), f.GetError().c_str() ); //LOG->Trace("Error opening %s: %s", filename.c_str(), f.GetError().c_str() );
+1 -1
View File
@@ -7,7 +7,7 @@
class Song; class Song;
class Trail; class Trail;
class Course; class Course;
struct XNode; class XNode;
class TrailID class TrailID
{ {
-45
View File
@@ -12,7 +12,6 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "DateTime.h" #include "DateTime.h"
#include "Foreach.h" #include "Foreach.h"
#include "arch/Dialog/Dialog.h"
#include "RageFileDriverMemory.h" #include "RageFileDriverMemory.h"
static inline long XStr2Int( const char* str, long default_value = 0 ) static inline long XStr2Int( const char* str, long default_value = 0 )
@@ -654,50 +653,6 @@ void XNode::AppendAttr( const CString &sName, float value ){ AppendAttr(sName,ss
void XNode::AppendAttr( const CString &sName, int value ) { AppendAttr(sName,ssprintf("%d",value)); } void XNode::AppendAttr( const CString &sName, int value ) { AppendAttr(sName,ssprintf("%d",value)); }
void XNode::AppendAttr( const CString &sName, unsigned value ) { AppendAttr(sName,ssprintf("%u",value)); } void XNode::AppendAttr( const CString &sName, unsigned value ) { AppendAttr(sName,ssprintf("%u",value)); }
bool XNode::LoadFromFile( const CString &sFile )
{
RageFile f;
if( !f.Open(sFile, RageFile::READ) )
{
LOG->Warn("Couldn't open %s for reading: %s", sFile.c_str(), f.GetError().c_str() );
return false;
}
bool bSuccess = LoadFromFile( f );
if( !bSuccess )
{
CString sWarning = ssprintf( "XML: LoadFromFile failed for file: %s", sFile.c_str() );
LOG->Warn( sWarning );
Dialog::OK( sWarning, "XML_PARSE_ERROR" );
}
return bSuccess;
}
bool XNode::LoadFromFile( RageFileBasic &f )
{
PARSEINFO pi;
CString s;
if( f.Read( s ) == -1 )
{
pi.error_occur = true;
pi.error_pointer = NULL;
pi.error_code = PIE_READ_ERROR;
pi.error_string = f.GetError();
goto error;
}
this->Load( s, &pi );
if( pi.error_occur )
goto error;
return true;
error:
CString sWarning = ssprintf( "XML: LoadFromFile failed: %s", pi.error_string.c_str() );
LOG->Warn( sWarning );
Dialog::OK( sWarning, "XML_PARSE_ERROR" );
return false;
}
bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const
{ {
f.PutLine( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" ); f.PutLine( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" );
+3 -4
View File
@@ -8,7 +8,7 @@ struct DateTime;
class RageFileBasic; class RageFileBasic;
typedef map<CString,CString> XAttrs; typedef map<CString,CString> XAttrs;
struct XNode; class XNode;
typedef multimap<CString,XNode*> XNodes; typedef multimap<CString,XNode*> XNodes;
#define FOREACH_Attr( pNode, Var ) \ #define FOREACH_Attr( pNode, Var ) \
@@ -80,8 +80,9 @@ struct DISP_OPT
}; };
// XMLNode structure // XMLNode structure
struct XNode class XNode
{ {
public:
CString m_sName; // a duplicate of the m_sName in the parent's map CString m_sName; // a duplicate of the m_sName in the parent's map
CString m_sValue; CString m_sValue;
XNodes m_childs; // child node XNodes m_childs; // child node
@@ -106,8 +107,6 @@ struct XNode
bool GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const CString &sName, const CString &sValue ) const; bool GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const CString &sName, const CString &sValue ) const;
CString GetXML() const; CString GetXML() const;
bool LoadFromFile( const CString &sFile );
bool LoadFromFile( RageFileBasic &f );
bool SaveToFile( const CString &sFile, DISP_OPT &opt ) const; bool SaveToFile( const CString &sFile, DISP_OPT &opt ) const;
bool SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const; bool SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const;
+78
View File
@@ -0,0 +1,78 @@
#include "global.h"
#include "XmlFileUtil.h"
#include "XmlFile.h"
#include "RageFile.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "arch/Dialog/Dialog.h"
bool XmlFileUtil::LoadFromFileShowErrors( XNode &xml, RageFileBasic &f )
{
PARSEINFO pi;
RString s;
if( f.Read( s ) == -1 )
{
pi.error_occur = true;
pi.error_pointer = NULL;
pi.error_code = PIE_READ_ERROR;
pi.error_string = f.GetError();
goto error;
}
xml.Load( s, &pi );
if( pi.error_occur )
goto error;
return true;
error:
RString sWarning = ssprintf( "XML: LoadFromFile failed: %s", pi.error_string.c_str() );
LOG->Warn( sWarning );
Dialog::OK( sWarning, "XML_PARSE_ERROR" );
return false;
}
bool XmlFileUtil::LoadFromFileShowErrors( XNode &xml, const RString &sFile )
{
RageFile f;
if( !f.Open(sFile, RageFile::READ) )
{
LOG->Warn("Couldn't open %s for reading: %s", sFile.c_str(), f.GetError().c_str() );
return false;
}
bool bSuccess = LoadFromFileShowErrors( xml, f );
if( !bSuccess )
{
RString sWarning = ssprintf( "XML: LoadFromFile failed for file: %s", sFile.c_str() );
LOG->Warn( sWarning );
Dialog::OK( sWarning, "XML_PARSE_ERROR" );
}
return bSuccess;
}
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+40
View File
@@ -0,0 +1,40 @@
/* XmlFileUtil - A little graphic to the left of the song's text banner in the MusicWheel. */
#ifndef XmlFileUtil_H
#define XmlFileUtil_H
class RageFileBasic;
class XNode;
namespace XmlFileUtil
{
bool LoadFromFileShowErrors( XNode &xml, const RString &sFile );
bool LoadFromFileShowErrors( XNode &xml, RageFileBasic &f );
}
#endif
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
@@ -9,63 +9,6 @@ ArchHooks *MakeArchHooks()
return new ARCH_HOOKS; return new ARCH_HOOKS;
} }
/*
* This is a helper for GetMicrosecondsSinceStart on systems with a system
* timer that may loop or move backwards.
*
* The time may decrease last for at least two reasons:
*
* 1. The underlying timer may be 32-bit and use millisecs internally, in which case
* the timer will loop every 2^32 ms.
*
* 2. The underlying clock may have moved backwards (eg. system clock and ntpd).
*
* If the system clock moves backwards, we can't just clamp the time; if it moved back
* an hour, we'd sit around for an hour until it catches up.
*
* Keep track of an offset: the amount of time to add to the result. If we move back
* by 100ms, the offset will be increased by 100ms. If we loop, the offset will be
* increased by the duration 2^32 ms.
*
* This helper only needs to be used if one or both of the above conditions can occur.
* If the underlying timer is reliable, this doesn't need to be used (for a small
* efficiency bonus). Also, you may omit this for GetMicrosecondsSinceStart() when
* bAccurate == false.
*/
int64_t ArchHooks::FixupTimeIfLooped( int64_t usecs )
{
static int64_t last = 0;
static int64_t offset_us = 0;
/* The time has wrapped if the last time was very high and the current time is very low. */
const int64_t i32BitMaxMs = uint64_t(1) << 32;
const int64_t i32BitMaxUs = i32BitMaxMs*1000;
const int64_t one_day = uint64_t(24*60*60)*1000000;
if( last > (i32BitMaxUs-one_day) && usecs < one_day )
offset_us += i32BitMaxUs;
last = usecs;
return usecs + offset_us;
}
int64_t ArchHooks::FixupTimeIfBackwards( int64_t usecs )
{
static int64_t last = 0;
static int64_t offset_us = 0;
if( usecs < last )
{
/* The time has moved backwards. Increase the offset by the amount we moved. */
offset_us += last - usecs;
}
last = usecs;
return usecs + offset_us;
}
/* /*
* (c) 2003-2004 Glenn Maynard, Chris Danford * (c) 2003-2004 Glenn Maynard, Chris Danford
* All rights reserved. * All rights reserved.
+6 -6
View File
@@ -44,6 +44,11 @@ public:
*/ */
virtual void SetupConcurrentRenderingThread() { } virtual void SetupConcurrentRenderingThread() { }
/*
* Returns true if the user wants to quit (eg. ^C, or clicked a "close window" button).
*/
virtual bool UserQuit() { return false; }
/* /*
* Return the amount of time since the program started. (This may actually be * Return the amount of time since the program started. (This may actually be
* since the initialization of HOOKS. * since the initialization of HOOKS.
@@ -73,12 +78,7 @@ public:
/* /*
* Add file search paths, higher priority first. * Add file search paths, higher priority first.
*/ */
virtual void MountInitialFilesystems( const CString &sDirOfExecutable ) = 0; static void MountInitialFilesystems( const CString &sDirOfExecutable );
/*
* Returns true if the user wants to quit (eg. ^C, or clicked a "close window" button).
*/
virtual bool UserQuit() { return false; }
private: private:
/* This are helpers for GetMicrosecondsSinceStart on systems with a timer /* This are helpers for GetMicrosecondsSinceStart on systems with a timer
@@ -0,0 +1,84 @@
#include "global.h"
#include "ArchHooks.h"
/*
* This is a helper for GetMicrosecondsSinceStart on systems with a system
* timer that may loop or move backwards.
*
* The time may decrease last for at least two reasons:
*
* 1. The underlying timer may be 32-bit and use millisecs internally, in which case
* the timer will loop every 2^32 ms.
*
* 2. The underlying clock may have moved backwards (eg. system clock and ntpd).
*
* If the system clock moves backwards, we can't just clamp the time; if it moved back
* an hour, we'd sit around for an hour until it catches up.
*
* Keep track of an offset: the amount of time to add to the result. If we move back
* by 100ms, the offset will be increased by 100ms. If we loop, the offset will be
* increased by the duration 2^32 ms.
*
* This helper only needs to be used if one or both of the above conditions can occur.
* If the underlying timer is reliable, this doesn't need to be used (for a small
* efficiency bonus). Also, you may omit this for GetMicrosecondsSinceStart() when
* bAccurate == false.
*/
int64_t ArchHooks::FixupTimeIfLooped( int64_t usecs )
{
static int64_t last = 0;
static int64_t offset_us = 0;
/* The time has wrapped if the last time was very high and the current time is very low. */
const int64_t i32BitMaxMs = uint64_t(1) << 32;
const int64_t i32BitMaxUs = i32BitMaxMs*1000;
const int64_t one_day = uint64_t(24*60*60)*1000000;
if( last > (i32BitMaxUs-one_day) && usecs < one_day )
offset_us += i32BitMaxUs;
last = usecs;
return usecs + offset_us;
}
int64_t ArchHooks::FixupTimeIfBackwards( int64_t usecs )
{
static int64_t last = 0;
static int64_t offset_us = 0;
if( usecs < last )
{
/* The time has moved backwards. Increase the offset by the amount we moved. */
offset_us += last - usecs;
}
last = usecs;
return usecs + offset_us;
}
/*
* (c) 2003-2004 Glenn Maynard, Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
@@ -3,9 +3,8 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageThreads.h" #include "RageThreads.h"
#include "PrefsManager.h"
#include "ProductInfo.h" #include "ProductInfo.h"
#include "PrefsManager.h"
#include "archutils/win32/AppInstance.h" #include "archutils/win32/AppInstance.h"
#include "archutils/win32/crash.h" #include "archutils/win32/crash.h"
#include "archutils/win32/DebugInfoHunt.h" #include "archutils/win32/DebugInfoHunt.h"
@@ -14,11 +13,6 @@
#include "archutils/win32/VideoDriverInfo.h" #include "archutils/win32/VideoDriverInfo.h"
#include "archutils/win32/WindowsResources.h" #include "archutils/win32/WindowsResources.h"
#include <mmsystem.h>
#if defined(_MSC_VER)
#pragma comment(lib, "winmm.lib") // for timeGetTime
#endif
static HANDLE g_hInstanceMutex; static HANDLE g_hInstanceMutex;
static bool g_bIsMultipleInstance = false; static bool g_bIsMultipleInstance = false;
bool g_bQuitting = false; bool g_bQuitting = false;
@@ -150,30 +144,6 @@ static BOOL CALLBACK DriverWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
return FALSE; return FALSE;
} }
static bool MessageIsIgnored( CString ID )
{
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
for( unsigned i = 0; i < list.size(); ++i )
if( !ID.CompareNoCase(list[i]) )
return true;
return false;
}
static void IgnoreMessage( CString ID )
{
if( ID == "" )
if( MessageIsIgnored(ID) )
return;
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
list.push_back( ID );
PREFSMAN->m_sIgnoredMessageWindows.Set( join(",",list) );
PREFSMAN->SavePrefsToDisk();
}
/* /*
* This simply does a few manual checks for known bad driver versions. Only nag the * This simply does a few manual checks for known bad driver versions. Only nag the
* user if it's a driver that we receive many complaints about--we don't want to * user if it's a driver that we receive many complaints about--we don't want to
@@ -181,7 +151,7 @@ static void IgnoreMessage( CString ID )
*/ */
void ArchHooks_Win32::CheckVideoDriver() void ArchHooks_Win32::CheckVideoDriver()
{ {
if( MessageIsIgnored( "OLD_DRIVER_WARNING" ) ) if( PREFSMAN->MessageIsIgnored( "OLD_DRIVER_WARNING" ) )
return; return;
CString sPrimaryDeviceName = GetPrimaryVideoName(); CString sPrimaryDeviceName = GetPrimaryVideoName();
@@ -213,7 +183,7 @@ void ArchHooks_Win32::CheckVideoDriver()
bool bExit = !!DialogBox( AppInstance(), MAKEINTRESOURCE(IDD_DRIVER), NULL, DriverWndProc ); bool bExit = !!DialogBox( AppInstance(), MAKEINTRESOURCE(IDD_DRIVER), NULL, DriverWndProc );
if( g_Hush ) if( g_Hush )
IgnoreMessage( "OLD_DRIVER_WARNING" ); PREFSMAN->IgnoreMessage( "OLD_DRIVER_WARNING" );
if( bExit ) if( bExit )
ExitProcess(0); ExitProcess(0);
} }
@@ -383,71 +353,6 @@ void ArchHooks_Win32::SetupConcurrentRenderingThread()
SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL ); SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL );
} }
static bool g_bTimerInitialized;
static void InitTimer()
{
if( g_bTimerInitialized )
return;
g_bTimerInitialized = true;
timeBeginPeriod( 1 );
}
int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate )
{
if( !g_bTimerInitialized )
InitTimer();
int64_t ret = timeGetTime() * int64_t(1000);
if( bAccurate )
{
ret = FixupTimeIfLooped( ret );
ret = FixupTimeIfBackwards( ret );
}
return ret;
}
#include "archutils/Win32/RegistryAccess.h"
#include "ProductInfo.h"
#include "RageFileManager.h"
#include <shlobj.h>
void ArchHooks_Win32::MountInitialFilesystems( const CString &sDirOfExecutable )
{
/* All Windows data goes in the directory one level above the executable. */
CHECKPOINT_M( ssprintf( "DOE \"%s\"", sDirOfExecutable.c_str()) );
vector<CString> parts;
split( sDirOfExecutable, "/", parts );
CHECKPOINT_M( ssprintf( "... %i parts", parts.size()) );
ASSERT_M( parts.size() > 1, ssprintf("Strange sDirOfExecutable: %s", sDirOfExecutable.c_str()) );
CString Dir = join( "/", parts.begin(), parts.end()-1 );
FILEMAN->Mount( "dir", Dir, "/" );
CString sMyDocumentsDir;
{
bool bSuccess = RegistryAccess::GetRegValue( "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", sMyDocumentsDir );
ASSERT( bSuccess );
sMyDocumentsDir.Replace( '\\', '/' );
sMyDocumentsDir += "/";
}
CString sApplicationDataDir;
{
TCHAR szDir[MAX_PATH] = "";
BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_APPDATA, FALSE );
ASSERT( bResult );
sApplicationDataDir = szDir;
sApplicationDataDir += "/";
}
// Mount everything game-writable (not counting the editor) to the user's directory.
FILEMAN->Mount( "dir", sApplicationDataDir + PRODUCT_ID + "/Cache", "/Cache" );
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Save", "/Save" );
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Screenshots", "/Screenshots" );
}
void ArchHooks_Win32::SetUserQuit() void ArchHooks_Win32::SetUserQuit()
{ {
g_bQuitting = true; g_bQuitting = true;
@@ -23,7 +23,6 @@ public:
void BoostPriority(); void BoostPriority();
void UnBoostPriority(); void UnBoostPriority();
void SetupConcurrentRenderingThread(); void SetupConcurrentRenderingThread();
void MountInitialFilesystems( const CString &sDirOfExecutable );
bool UserQuit(); bool UserQuit();
// Called by ArchHooks: // Called by ArchHooks:
@@ -0,0 +1,99 @@
#include "global.h"
#include "ArchHooks.h"
#include "RageUtil.h"
#include "archutils/Win32/RegistryAccess.h"
#include "ProductInfo.h"
#include "RageFileManager.h"
#include <shlobj.h>
// for timeGetTime
#include <mmsystem.h>
#if defined(_MSC_VER)
#pragma comment(lib, "winmm.lib")
#endif
static bool g_bTimerInitialized;
static void InitTimer()
{
if( g_bTimerInitialized )
return;
g_bTimerInitialized = true;
timeBeginPeriod( 1 );
}
int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate )
{
if( !g_bTimerInitialized )
InitTimer();
int64_t ret = timeGetTime() * int64_t(1000);
if( bAccurate )
{
ret = FixupTimeIfLooped( ret );
ret = FixupTimeIfBackwards( ret );
}
return ret;
}
void ArchHooks::MountInitialFilesystems( const CString &sDirOfExecutable )
{
/* All Windows data goes in the directory one level above the executable. */
CHECKPOINT_M( ssprintf( "DOE \"%s\"", sDirOfExecutable.c_str()) );
vector<CString> parts;
split( sDirOfExecutable, "/", parts );
CHECKPOINT_M( ssprintf( "... %i parts", parts.size()) );
ASSERT_M( parts.size() > 1, ssprintf("Strange sDirOfExecutable: %s", sDirOfExecutable.c_str()) );
CString Dir = join( "/", parts.begin(), parts.end()-1 );
FILEMAN->Mount( "dir", Dir, "/" );
CString sMyDocumentsDir;
{
bool bSuccess = RegistryAccess::GetRegValue( "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", sMyDocumentsDir );
ASSERT( bSuccess );
sMyDocumentsDir.Replace( '\\', '/' );
sMyDocumentsDir += "/";
}
CString sApplicationDataDir;
{
TCHAR szDir[MAX_PATH] = "";
BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_APPDATA, FALSE );
ASSERT( bResult );
sApplicationDataDir = szDir;
sApplicationDataDir += "/";
}
// Mount everything game-writable (not counting the editor) to the user's directory.
FILEMAN->Mount( "dir", sApplicationDataDir + PRODUCT_ID + "/Cache", "/Cache" );
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Save", "/Save" );
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Screenshots", "/Screenshots" );
}
/*
* (c) 2003-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+9 -15
View File
@@ -4,8 +4,8 @@
#include "PrefsManager.h" #include "PrefsManager.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "RageLog.h" #include "RageLog.h"
#include "arch/arch.h" #include "arch/arch.h"
#include "RageThreads.h"
#include "Selector_Dialog.h" #include "Selector_Dialog.h"
DialogDriver *MakeDialogDriver() DialogDriver *MakeDialogDriver()
@@ -53,7 +53,6 @@ DialogDriver *MakeDialogDriver()
static DialogDriver *g_pImpl = NULL; static DialogDriver *g_pImpl = NULL;
static DialogDriver_Null g_NullDriver; static DialogDriver_Null g_NullDriver;
static bool g_bWindowed = true; // Start out true so that we'll show errors before DISPLAY is init'd. static bool g_bWindowed = true; // Start out true so that we'll show errors before DISPLAY is init'd.
static bool g_bIsShowingDialog = false;
void Dialog::Init() void Dialog::Init()
{ {
@@ -72,11 +71,6 @@ void Dialog::Shutdown()
g_pImpl = NULL; g_pImpl = NULL;
} }
bool Dialog::IsShowingDialog()
{
return g_bIsShowingDialog;
}
static bool MessageIsIgnored( CString sID ) static bool MessageIsIgnored( CString sID )
{ {
vector<CString> asList; vector<CString> asList;
@@ -121,11 +115,11 @@ void Dialog::Error( CString sMessage, CString sID )
if( sID != "" && MessageIsIgnored(sID) ) if( sID != "" && MessageIsIgnored(sID) )
return; return;
g_bIsShowingDialog = true; RageThread::SetIsShowingDialog( true );
g_pImpl->Error( sMessage, sID ); g_pImpl->Error( sMessage, sID );
g_bIsShowingDialog = false; RageThread::SetIsShowingDialog( false );
} }
void Dialog::SetWindowed( bool bWindowed ) void Dialog::SetWindowed( bool bWindowed )
@@ -143,7 +137,7 @@ void Dialog::OK( CString sMessage, CString sID )
if( sID != "" && MessageIsIgnored(sID) ) if( sID != "" && MessageIsIgnored(sID) )
return; return;
g_bIsShowingDialog = true; RageThread::SetIsShowingDialog( true );
// only show Dialog if windowed // only show Dialog if windowed
if( !g_bWindowed ) if( !g_bWindowed )
@@ -151,7 +145,7 @@ void Dialog::OK( CString sMessage, CString sID )
else else
g_pImpl->OK( sMessage, sID ); // call derived version g_pImpl->OK( sMessage, sID ); // call derived version
g_bIsShowingDialog = false; RageThread::SetIsShowingDialog( false );
} }
Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString sID ) Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString sID )
@@ -164,7 +158,7 @@ Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString sID )
if( sID != "" && MessageIsIgnored(sID) ) if( sID != "" && MessageIsIgnored(sID) )
return g_NullDriver.AbortRetryIgnore( sMessage, sID ); return g_NullDriver.AbortRetryIgnore( sMessage, sID );
g_bIsShowingDialog = true; RageThread::SetIsShowingDialog( true );
// only show Dialog if windowed // only show Dialog if windowed
Dialog::Result ret; Dialog::Result ret;
@@ -173,7 +167,7 @@ Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString sID )
else else
ret = g_pImpl->AbortRetryIgnore( sMessage, sID ); // call derived version ret = g_pImpl->AbortRetryIgnore( sMessage, sID ); // call derived version
g_bIsShowingDialog = false; RageThread::SetIsShowingDialog( false );
return ret; return ret;
} }
@@ -188,7 +182,7 @@ Dialog::Result Dialog::AbortRetry( CString sMessage, CString sID )
if( sID != "" && MessageIsIgnored(sID) ) if( sID != "" && MessageIsIgnored(sID) )
return g_NullDriver.AbortRetry( sMessage, sID ); return g_NullDriver.AbortRetry( sMessage, sID );
g_bIsShowingDialog = true; RageThread::SetIsShowingDialog( true );
// only show Dialog if windowed // only show Dialog if windowed
Dialog::Result ret; Dialog::Result ret;
@@ -197,7 +191,7 @@ Dialog::Result Dialog::AbortRetry( CString sMessage, CString sID )
else else
ret = g_pImpl->AbortRetry( sMessage, sID ); // call derived version ret = g_pImpl->AbortRetry( sMessage, sID ); // call derived version
g_bIsShowingDialog = false; RageThread::SetIsShowingDialog( false );
return ret; return ret;
} }
-1
View File
@@ -9,7 +9,6 @@ namespace Dialog
void Shutdown(); void Shutdown();
void SetWindowed( bool bWindowed ); void SetWindowed( bool bWindowed );
bool IsShowingDialog();
enum Result { abort, retry, ignore }; enum Result { abort, retry, ignore };
void Error( CString sError, CString sID = "" ); void Error( CString sError, CString sID = "" );
@@ -11,7 +11,7 @@
extern "C" void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) throw() extern "C" void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) throw()
{ {
const CString error = ssprintf( "Assertion failure: %s: %s", function, assertion ); const RString error = ssprintf( "Assertion failure: %s: %s", function, assertion );
#if defined(CRASH_HANDLER) #if defined(CRASH_HANDLER)
Checkpoints::SetCheckpoint( file, line, error ); Checkpoints::SetCheckpoint( file, line, error );
@@ -30,7 +30,7 @@ extern "C" void __assert_fail( const char *assertion, const char *file, unsigned
extern "C" void __assert_perror_fail( int errnum, const char *file, unsigned int line, const char *function ) throw() extern "C" void __assert_perror_fail( int errnum, const char *file, unsigned int line, const char *function ) throw()
{ {
const CString error = ssprintf( "Assertion failure: %s: %s", function, strerror(errnum) ); const RString error = ssprintf( "Assertion failure: %s: %s", function, strerror(errnum) );
#if defined(CRASH_HANDLER) #if defined(CRASH_HANDLER)
Checkpoints::SetCheckpoint( file, line, error ); Checkpoints::SetCheckpoint( file, line, error );
@@ -1,35 +1,10 @@
#include "global.h" #include "global.h"
#include "arch_setup.h" #include "arch_setup.h"
#include "RageThreads.h"
#include <time.h>
#ifdef _WINDOWS #ifdef _WINDOWS
# include <windows.h> # include <windows.h>
#endif #endif
#include "StepMania.h" #include "StepMania.h"
struct tm *my_localtime_r( const time_t *timep, struct tm *result )
{
static RageMutex mut("my_localtime_r");
LockMut(mut);
*result = *localtime( timep );
return result;
}
struct tm *my_gmtime_r( const time_t *timep, struct tm *result )
{
static RageMutex mut("my_gmtime_r");
LockMut(mut);
*result = *gmtime( timep );
return result;
}
void my_usleep( unsigned long usec )
{
Sleep( usec/1000 );
}
#if defined(WINDOWS) #if defined(WINDOWS)
/* Ugh. Windows doesn't give us the argv[] parser; all it gives is CommandLineToArgvW, /* Ugh. Windows doesn't give us the argv[] parser; all it gives is CommandLineToArgvW,
* which is NT-only, so we have to do this ourself. Don't be fancy; only handle double * which is NT-only, so we have to do this ourself. Don't be fancy; only handle double
+1 -1
View File
@@ -141,7 +141,7 @@ inline int lrintf( float f )
/* We implement the crash handler interface (though that interface isn't completely /* We implement the crash handler interface (though that interface isn't completely
* uniform across platforms yet). */ * uniform across platforms yet). */
#if !defined(_XBOX) #if !defined(_XBOX) && !defined(SMPACKAGE)
#define CRASH_HANDLER #define CRASH_HANDLER
#endif #endif
@@ -0,0 +1,56 @@
#include "global.h"
#include "arch_setup.h"
#include "RageThreads.h"
#include <time.h>
#ifdef _WINDOWS
# include <windows.h>
#endif
#include "StepMania.h"
struct tm *my_localtime_r( const time_t *timep, struct tm *result )
{
static RageMutex mut("my_localtime_r");
LockMut(mut);
*result = *localtime( timep );
return result;
}
struct tm *my_gmtime_r( const time_t *timep, struct tm *result )
{
static RageMutex mut("my_gmtime_r");
LockMut(mut);
*result = *gmtime( timep );
return result;
}
void my_usleep( unsigned long usec )
{
Sleep( usec/1000 );
}
/*
* (c) 2004 Glenn Maynard
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+6 -4
View File
@@ -1,9 +1,11 @@
#include "global.h" #include "global.h"
#if defined(_WINDOWS) #if defined(_WINDOWS)
# define _WIN32_WINDOWS 0x0410 // include Win98 stuff # if defined(CRASH_HANDLER)
# include "windows.h" # define _WIN32_WINDOWS 0x0410 // include Win98 stuff
# include "archutils/Win32/Crash.h" # include "windows.h"
# include "archutils/Win32/Crash.h"
# endif
#elif defined(_XBOX) #elif defined(_XBOX)
#else #else
# include <unistd.h> # include <unistd.h>
@@ -15,7 +17,7 @@
void NORETURN sm_crash( const char *reason ) void NORETURN sm_crash( const char *reason )
{ {
#if defined(_WINDOWS) #if defined(_WINDOWS) && defined(CRASH_HANDLER)
/* If we're being debugged, throw a debug break so it'll suspend the process. */ /* If we're being debugged, throw a debug break so it'll suspend the process. */
if( IsDebuggerPresent() ) if( IsDebuggerPresent() )
{ {
+89 -16
View File
@@ -15,7 +15,7 @@
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory="../Program" OutputDirectory="../Program"
IntermediateDirectory=".\Debug" IntermediateDirectory=".\Debug-smpackage"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="FALSE"
@@ -24,7 +24,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".;" AdditionalIncludeDirectories=".;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_WINDOWS;WINDOWS;SMPACKAGE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
@@ -42,8 +42,8 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="smpackage\ZipArchive\Release\ZipArchive.lib" AdditionalDependencies="smpackage\ZipArchive\Release\ZipArchive.lib"
OutputFile="../../Program/tools-debug.exe" OutputFile="./../Program/tools-debug.exe"
LinkIncremental="1" LinkIncremental="0"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../../Program/smpackage-debug.pdb" ProgramDatabaseFile=".\../../Program/smpackage-debug.pdb"
@@ -81,7 +81,7 @@
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory="../Program" OutputDirectory="../Program"
IntermediateDirectory=".\Release" IntermediateDirectory=".\Release-smpackage"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="FALSE"
@@ -90,8 +90,8 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories=";" AdditionalIncludeDirectories=".;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINDOWS;SMPACKAGE"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
@@ -103,13 +103,14 @@
ProgramDataBaseFileName=".\../Release-smpackage/" ProgramDataBaseFileName=".\../Release-smpackage/"
BrowseInformation="1" BrowseInformation="1"
WarningLevel="4" WarningLevel="4"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"
DebugInformationFormat="0"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="smpackage\ZipArchive\Release\ZipArchive.lib" AdditionalDependencies="smpackage\ZipArchive\Release\ZipArchive.lib"
OutputFile=".\../../Program/tools.exe" OutputFile="./../Program/tools.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../../Program/smpackage.pdb" ProgramDatabaseFile=".\../../Program/smpackage.pdb"
@@ -214,9 +215,6 @@
<File <File
RelativePath=".\smpackage\smpackageUtil.h"> RelativePath=".\smpackage\smpackageUtil.h">
</File> </File>
<File
RelativePath=".\smpackage\StdAfx.cpp">
</File>
<File <File
RelativePath=".\smpackage\StdAfx.h"> RelativePath=".\smpackage\StdAfx.h">
</File> </File>
@@ -252,10 +250,10 @@
RelativePath="menu.bmp"> RelativePath="menu.bmp">
</File> </File>
<File <File
RelativePath="smpackage.ICO"> RelativePath="res\smpackage.ico">
</File> </File>
<File <File
RelativePath="res\smpackage.ico"> RelativePath="smpackage.ICO">
</File> </File>
<File <File
RelativePath=".\smpackage\smpackage.rc"> RelativePath=".\smpackage\smpackage.rc">
@@ -288,10 +286,10 @@
<Filter <Filter
Name="system"> Name="system">
<File <File
RelativePath=".\archutils\Win32\Crash.cpp"> RelativePath=".\archutils\Win32\arch_setup.h">
</File> </File>
<File <File
RelativePath=".\archutils\Win32\Crash.h"> RelativePath=".\archutils\Win32\arch_time.cpp">
</File> </File>
<File <File
RelativePath=".\archutils\Win32\RegistryAccess.cpp"> RelativePath=".\archutils\Win32\RegistryAccess.cpp">
@@ -306,10 +304,49 @@
RelativePath=".\archutils\Win32\SpecialDirs.h"> RelativePath=".\archutils\Win32\SpecialDirs.h">
</File> </File>
</Filter> </Filter>
<Filter
Name="arch"
Filter="">
<Filter
Name="Threads"
Filter="">
<File
RelativePath=".\arch\Threads\Threads.h">
</File>
<File
RelativePath=".\arch\Threads\Threads_Win32.cpp">
</File>
<File
RelativePath=".\arch\Threads\Threads_Win32.h">
</File>
</Filter>
<Filter
Name="ArchHooks"
Filter="">
<File
RelativePath=".\arch\ArchHooks\ArchHooks.h">
</File>
<File
RelativePath=".\arch\ArchHooks\ArchHooks_Win32.h">
</File>
<File
RelativePath=".\arch\ArchHooks\ArchHooks_Win32Static.cpp">
</File>
<File
RelativePath=".\arch\ArchHooks\ArchHooksUtil.cpp">
</File>
</Filter>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="Rage" Name="Rage"
Filter=""> Filter="">
<File
RelativePath=".\RageException.cpp">
</File>
<File
RelativePath=".\RageException.h">
</File>
<File <File
RelativePath=".\RageFile.cpp"> RelativePath=".\RageFile.cpp">
</File> </File>
@@ -388,6 +425,32 @@
<File <File
RelativePath=".\RageUtil_FileDB.h"> RelativePath=".\RageUtil_FileDB.h">
</File> </File>
<Filter
Name="Helpers"
Filter="">
<Filter
Name="pcre"
Filter="">
<File
RelativePath=".\pcre\get.c">
</File>
<File
RelativePath=".\pcre\internal.h">
</File>
<File
RelativePath=".\pcre\maketables.c">
</File>
<File
RelativePath=".\pcre\pcre.c">
</File>
<File
RelativePath=".\pcre\pcre.h">
</File>
<File
RelativePath=".\pcre\study.c">
</File>
</Filter>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="File Types" Name="File Types"
@@ -405,6 +468,16 @@
RelativePath=".\XmlFile.h"> RelativePath=".\XmlFile.h">
</File> </File>
</Filter> </Filter>
<Filter
Name="Data Structures"
Filter="">
<File
RelativePath=".\DateTime.cpp">
</File>
<File
RelativePath=".\DateTime.h">
</File>
</Filter>
<File <File
RelativePath=".\smpackage\install.bmp"> RelativePath=".\smpackage\install.bmp">
</File> </File>
@@ -302,7 +302,7 @@ void CSMPackageInstallDlg::OnOK()
//Initialize the progress bar and update the window 1 time (it's enough) //Initialize the progress bar and update the window 1 time (it's enough)
if(!ProgressInit) if(!ProgressInit)
{ {
pProgress1->SetRange( 0, vs.size() ); pProgress1->SetRange( 0, (short)vs.size() );
pProgress1->SetStep(1); pProgress1->SetStep(1);
pProgress1->SetPos(0); pProgress1->SetPos(0);
SendMessage( WM_PAINT ); SendMessage( WM_PAINT );
-2
View File
@@ -4,5 +4,3 @@
#include "stdafx.h" #include "stdafx.h"
+9
View File
@@ -128,3 +128,12 @@ BOOL CSmpackageApp::InitInstance()
// application, rather than start the application's message pump. // application, rather than start the application's message pump.
return FALSE; return FALSE;
} }
namespace StepMania
{
void NORETURN HandleException( RString sErr )
{
MessageBox( NULL, "exception", sErr, MB_ICONERROR );
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ CString argv0;
namespace StepMania namespace StepMania
{ {
void HandleException( CString sErr ) { } void HandleException( RString sErr ) { }
} }
void test_handle_args( int argc, char *argv[] ) void test_handle_args( int argc, char *argv[] )