[loading window -> default] I can't stand the previous loading window, and nobody else should see it either.
This commit is contained in:
@@ -108,7 +108,7 @@ static void Version()
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
void CommandLineActions::Handle(LoadingWindow* pLW)
|
||||
void CommandLineActions::Handle()
|
||||
{
|
||||
CommandLineArgs args;
|
||||
for(int i=0; i<g_argc; ++i)
|
||||
|
||||
@@ -7,9 +7,8 @@ class LoadingWindow;
|
||||
namespace CommandLineActions
|
||||
{
|
||||
/**
|
||||
* @brief Perform a utility function, then exit.
|
||||
* @param pLW the LoadingWindow that is presently not used? */
|
||||
void Handle(LoadingWindow* pLW);
|
||||
* @brief Perform a utility function, then exit. */
|
||||
void Handle();
|
||||
|
||||
/** @brief The housing for the command line arguments. */
|
||||
class CommandLineArgs
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "global.h"
|
||||
#include "InGameLoadingWindow.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
//REGISTER_ACTOR_CLASS( InGameLoadingWindow );
|
||||
|
||||
InGameLoadingWindow::InGameLoadingWindow() {
|
||||
SetName("InGameLoadingWindow");
|
||||
m_Text.SetName("LoadingText");
|
||||
m_Text.LoadFromFont( THEME->GetPathF(m_sName, "LoadingText") );
|
||||
m_Text.SetXY(0,0);
|
||||
AddChild(&m_Text);
|
||||
}
|
||||
|
||||
InGameLoadingWindow::~InGameLoadingWindow() {
|
||||
RemoveChild(&m_Text);
|
||||
}
|
||||
|
||||
void InGameLoadingWindow::SetText( RString str ) {
|
||||
textChanged=true;
|
||||
currentText=str;
|
||||
}
|
||||
|
||||
void InGameLoadingWindow::Update(float delta) {
|
||||
if(textChanged) {
|
||||
m_Text.SetText( currentText );
|
||||
textChanged=false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "arch/LoadingWindow/LoadingWindow.h"
|
||||
#include "BitmapText.h"
|
||||
#include "RageTimer.h"
|
||||
#include "global.h"
|
||||
#include "ActorFrame.h"
|
||||
|
||||
class InGameLoadingWindow: public LoadingWindow, public ActorFrame {
|
||||
|
||||
public:
|
||||
InGameLoadingWindow();
|
||||
~InGameLoadingWindow();
|
||||
|
||||
void SetText( RString str );
|
||||
void Update ( float delta );
|
||||
|
||||
private:
|
||||
bool textChanged;
|
||||
RString currentText;
|
||||
BitmapText m_Text;
|
||||
};
|
||||
|
||||
@@ -322,6 +322,17 @@ int RageThread::Wait()
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RageThread::Halt(bool Kill) {
|
||||
ASSERT( m_pSlot != NULL );
|
||||
ASSERT( m_pSlot->m_pImpl != NULL );
|
||||
m_pSlot->m_pImpl->Halt(Kill);
|
||||
}
|
||||
|
||||
void RageThread::Resume() {
|
||||
ASSERT( m_pSlot != NULL );
|
||||
ASSERT( m_pSlot->m_pImpl != NULL );
|
||||
m_pSlot->m_pImpl->Resume();
|
||||
}
|
||||
|
||||
void RageThread::HaltAllThreads( bool Kill )
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ public:
|
||||
RString GetName() const { return m_sName; }
|
||||
void Create( int (*fn)(void *), void *data );
|
||||
|
||||
void Halt( bool Kill=false);
|
||||
void Resume();
|
||||
|
||||
/* For crash handlers: kill or suspend all threads (except for
|
||||
* the running one) immediately. */
|
||||
static void HaltAllThreads( bool Kill=false );
|
||||
|
||||
@@ -360,7 +360,7 @@ void ScreenInstallOverlay::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
if( playAfterLaunchInfo.bAnySongChanged )
|
||||
SONGMAN->Reload( false, NULL );
|
||||
SONGMAN->Reload( false );
|
||||
|
||||
if( !playAfterLaunchInfo.sSongDir.empty() )
|
||||
{
|
||||
|
||||
+19
-48
@@ -6,38 +6,8 @@
|
||||
#include "RageLog.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "ScreenDimensions.h"
|
||||
|
||||
#include "arch/LoadingWindow/LoadingWindow.h"
|
||||
|
||||
static const int DrawFrameRate = 20;
|
||||
class ScreenReloadSongsLoadingWindow: public LoadingWindow
|
||||
{
|
||||
RageTimer m_LastDraw;
|
||||
BitmapText &m_BitmapText;
|
||||
|
||||
public:
|
||||
ScreenReloadSongsLoadingWindow( BitmapText &bt ):
|
||||
m_BitmapText(bt)
|
||||
{
|
||||
}
|
||||
|
||||
void SetText( RString str )
|
||||
{
|
||||
m_BitmapText.SetText( str );
|
||||
Paint();
|
||||
}
|
||||
|
||||
void Paint()
|
||||
{
|
||||
/* We load songs much faster than we draw frames. Cap the draw rate,
|
||||
* so we don't slow down the reload. */
|
||||
if( m_LastDraw.PeekDeltaTime() < 1.0f/DrawFrameRate )
|
||||
return;
|
||||
m_LastDraw.GetDeltaTime();
|
||||
|
||||
SCREENMAN->Draw();
|
||||
}
|
||||
};
|
||||
#include "InGameLoadingWindow.h"
|
||||
|
||||
/* This could be cleaned up: show progress, for example. Let's not use
|
||||
* this for the initial load, since we don't want to start up the display
|
||||
@@ -45,39 +15,40 @@ public:
|
||||
* computer while songs load. */
|
||||
REGISTER_SCREEN_CLASS( ScreenReloadSongs );
|
||||
|
||||
ScreenReloadSongs::ScreenReloadSongs() {}
|
||||
|
||||
void ScreenReloadSongs::Init()
|
||||
{
|
||||
Screen::Init();
|
||||
|
||||
m_iUpdates = 0;
|
||||
loadWin=new InGameLoadingWindow( );
|
||||
|
||||
m_Loading.SetName("LoadingText");
|
||||
m_Loading.LoadFromFont( THEME->GetPathF(m_sName, "LoadingText") );
|
||||
m_Loading.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y );
|
||||
this->AddChild( &m_Loading );
|
||||
AddChild( loadWin );
|
||||
|
||||
m_LoadingWindow = new ScreenReloadSongsLoadingWindow( m_Loading );
|
||||
loadWin->SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y );
|
||||
|
||||
pLoadingWindow=loadWin;
|
||||
|
||||
m_loadingThread.SetName("Song reload work thread");
|
||||
m_loadingThread.Create(loadingThreadProc,this);
|
||||
}
|
||||
|
||||
ScreenReloadSongs::~ScreenReloadSongs()
|
||||
{
|
||||
delete m_LoadingWindow;
|
||||
m_loadingThread.Wait();
|
||||
RemoveChild(loadWin);
|
||||
delete loadWin;
|
||||
}
|
||||
|
||||
int ScreenReloadSongs::loadingThreadProc(void *thisAsVoidPtr) {
|
||||
|
||||
void ScreenReloadSongs::Update( float fDeltaTime )
|
||||
{
|
||||
Screen::Update( fDeltaTime );
|
||||
ScreenReloadSongs *self=(ScreenReloadSongs *)thisAsVoidPtr;
|
||||
|
||||
/* Start the reload on the second update. On the first (0), SCREENMAN->Draw won't draw. */
|
||||
++m_iUpdates;
|
||||
if( m_iUpdates != 2 )
|
||||
return;
|
||||
ASSERT( !IsFirstUpdate() );
|
||||
|
||||
SONGMAN->Reload( false, m_LoadingWindow );
|
||||
SONGMAN->Reload( false );
|
||||
|
||||
SCREENMAN->PostMessageToTopScreen( SM_GoToNextScreen, 0 );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
#define SCREEN_RELOAD_SONGS_H
|
||||
|
||||
#include "Screen.h"
|
||||
#include "BitmapText.h"
|
||||
class LoadingWindow;
|
||||
#include "RageThreads.h"
|
||||
|
||||
class InGameLoadingWindow;
|
||||
|
||||
class ScreenReloadSongs: public Screen
|
||||
{
|
||||
public:
|
||||
ScreenReloadSongs();
|
||||
virtual void Init();
|
||||
~ScreenReloadSongs();
|
||||
void Update( float fDeltaTime );
|
||||
|
||||
private:
|
||||
int m_iUpdates;
|
||||
LoadingWindow *m_LoadingWindow;
|
||||
BitmapText m_Loading;
|
||||
InGameLoadingWindow *loadWin;
|
||||
RageThread m_loadingThread;
|
||||
static int loadingThreadProc(void *thisAsVoidPtr);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+57
-20
@@ -88,16 +88,19 @@ SongManager::~SongManager()
|
||||
FreeSongs();
|
||||
}
|
||||
|
||||
void SongManager::InitAll( LoadingWindow *ld )
|
||||
void SongManager::InitAll()
|
||||
{
|
||||
InitSongsFromDisk( ld );
|
||||
InitCoursesFromDisk( ld );
|
||||
InitSongsFromDisk();
|
||||
|
||||
InitCoursesFromDisk();
|
||||
InitAutogenCourses();
|
||||
InitRandomAttacks();
|
||||
}
|
||||
|
||||
static LocalizedString RELOADING ( "SongManager", "Reloading..." );
|
||||
void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld )
|
||||
static LocalizedString UNLOADING_SONGS ( "SongManager", "Unloading songs..." );
|
||||
static LocalizedString UNLOADING_COURSES ( "SongManager", "Unloading courses..." );
|
||||
void SongManager::Reload( bool bAllowFastLoad )
|
||||
{
|
||||
FILEMAN->FlushDirCache( SpecialFiles::SONGS_DIR );
|
||||
FILEMAN->FlushDirCache( ADDITIONAL_SONGS_DIR );
|
||||
@@ -105,20 +108,26 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld )
|
||||
FILEMAN->FlushDirCache( ADDITIONAL_COURSES_DIR );
|
||||
FILEMAN->FlushDirCache( EDIT_SUBDIR );
|
||||
|
||||
if( ld )
|
||||
ld->SetText( RELOADING );
|
||||
if( pLoadingWindow )
|
||||
pLoadingWindow->SetText( RELOADING );
|
||||
|
||||
// save scores before unloading songs, of the scores will be lost
|
||||
PROFILEMAN->SaveMachineProfile();
|
||||
|
||||
if( pLoadingWindow )
|
||||
pLoadingWindow->SetText( UNLOADING_COURSES );
|
||||
|
||||
FreeCourses();
|
||||
|
||||
if( pLoadingWindow )
|
||||
pLoadingWindow->SetText( UNLOADING_SONGS );
|
||||
FreeSongs();
|
||||
|
||||
const bool OldVal = PREFSMAN->m_bFastLoad;
|
||||
if( !bAllowFastLoad )
|
||||
PREFSMAN->m_bFastLoad.Set( false );
|
||||
|
||||
InitAll( ld );
|
||||
InitAll();
|
||||
|
||||
// reload scores and unlocks afterward
|
||||
PROFILEMAN->LoadMachineProfile();
|
||||
@@ -130,14 +139,14 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld )
|
||||
UpdatePreferredSort();
|
||||
}
|
||||
|
||||
void SongManager::InitSongsFromDisk( LoadingWindow *ld )
|
||||
void SongManager::InitSongsFromDisk()
|
||||
{
|
||||
RageTimer tm;
|
||||
LoadStepManiaSongDir( SpecialFiles::SONGS_DIR, ld );
|
||||
LoadStepManiaSongDir( SpecialFiles::SONGS_DIR);
|
||||
|
||||
const bool bOldVal = PREFSMAN->m_bFastLoad;
|
||||
PREFSMAN->m_bFastLoad.Set( PREFSMAN->m_bFastLoadAdditionalSongs );
|
||||
LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR, ld );
|
||||
LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR );
|
||||
PREFSMAN->m_bFastLoad.Set( bOldVal );
|
||||
|
||||
LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() );
|
||||
@@ -224,7 +233,7 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName )
|
||||
}
|
||||
|
||||
static LocalizedString LOADING_SONGS ( "SongManager", "Loading songs..." );
|
||||
void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
void SongManager::LoadStepManiaSongDir( RString sDir )
|
||||
{
|
||||
// Make sure sDir has a trailing slash.
|
||||
if( sDir.Right(1) != "/" )
|
||||
@@ -236,11 +245,16 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
SortRStringArray( arrayGroupDirs );
|
||||
StripCvsAndSvn( arrayGroupDirs );
|
||||
StripMacResourceForks( arrayGroupDirs );
|
||||
|
||||
|
||||
vector< vector<RString> > arrayGroupSongDirs;
|
||||
int groupIndex, songCount, songIndex;
|
||||
|
||||
groupIndex = 0;
|
||||
songCount = 0;
|
||||
FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/
|
||||
{
|
||||
|
||||
RString sGroupDirName = *s;
|
||||
|
||||
SanityCheckGroupDir(sDir+sGroupDirName);
|
||||
|
||||
// Find all Song folders in this group directory
|
||||
@@ -249,6 +263,25 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
StripCvsAndSvn( arraySongDirs );
|
||||
StripMacResourceForks( arraySongDirs );
|
||||
SortRStringArray( arraySongDirs );
|
||||
|
||||
arrayGroupSongDirs.push_back(arraySongDirs);
|
||||
songCount += arraySongDirs.size();
|
||||
|
||||
}
|
||||
|
||||
if( songCount==0 ) return;
|
||||
|
||||
if( pLoadingWindow ) {
|
||||
pLoadingWindow->SetIndeterminate( false );
|
||||
pLoadingWindow->SetTotalWork( songCount );
|
||||
}
|
||||
|
||||
groupIndex = 0;
|
||||
songIndex = 0;
|
||||
FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/
|
||||
{
|
||||
RString sGroupDirName = *s;
|
||||
vector<RString> &arraySongDirs = arrayGroupSongDirs[groupIndex++];
|
||||
|
||||
LOG->Trace("Attempting to load %i songs from \"%s\"", int(arraySongDirs.size()),
|
||||
(sDir+sGroupDirName).c_str() );
|
||||
@@ -261,12 +294,12 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
RString sSongDirName = arraySongDirs[j];
|
||||
|
||||
// this is a song directory. Load a new song.
|
||||
if( ld )
|
||||
if( pLoadingWindow )
|
||||
{
|
||||
ld->SetText( LOADING_SONGS.GetValue()+ssprintf("\n%s\n%s",
|
||||
pLoadingWindow->SetProgress(songIndex);
|
||||
pLoadingWindow->SetText( LOADING_SONGS.GetValue()+ssprintf("\n%s\n%s",
|
||||
Basename(sGroupDirName).c_str(),
|
||||
Basename(sSongDirName).c_str()));
|
||||
ld->Paint();
|
||||
}
|
||||
Song* pNewSong = new Song;
|
||||
if( !pNewSong->LoadFromSongDir( sSongDirName ) )
|
||||
@@ -279,6 +312,7 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
m_pSongs.push_back( pNewSong );
|
||||
index_entry.push_back( pNewSong );
|
||||
loaded++;
|
||||
songIndex++;
|
||||
}
|
||||
|
||||
LOG->Trace("Loaded %i songs from \"%s\"", loaded, (sDir+sGroupDirName).c_str() );
|
||||
@@ -296,6 +330,10 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
LoadGroupSymLinks(sDir, sGroupDirName);
|
||||
}
|
||||
|
||||
if( pLoadingWindow ) {
|
||||
pLoadingWindow->SetIndeterminate( true );
|
||||
}
|
||||
|
||||
LoadEnabledSongsFromPref();
|
||||
}
|
||||
|
||||
@@ -720,7 +758,7 @@ RString SongManager::ShortenGroupName( RString sLongGroupName )
|
||||
}
|
||||
|
||||
static LocalizedString LOADING_COURSES ( "SongManager", "Loading courses..." );
|
||||
void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
|
||||
void SongManager::InitCoursesFromDisk()
|
||||
{
|
||||
LOG->Trace( "Loading courses." );
|
||||
|
||||
@@ -750,12 +788,11 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
|
||||
|
||||
FOREACH_CONST( RString, vsCoursePaths, sCoursePath )
|
||||
{
|
||||
if( ld )
|
||||
if( pLoadingWindow )
|
||||
{
|
||||
ld->SetText( LOADING_COURSES.GetValue()+ssprintf("\n%s\n%s",
|
||||
pLoadingWindow->SetText( LOADING_COURSES.GetValue()+ssprintf("\n%s\n%s",
|
||||
Basename(*sCourseGroup).c_str(),
|
||||
Basename(*sCoursePath).c_str()));
|
||||
ld->Paint();
|
||||
}
|
||||
|
||||
Course* pCourse = new Course;
|
||||
|
||||
+5
-6
@@ -1,7 +1,6 @@
|
||||
#ifndef SONGMANAGER_H
|
||||
#define SONGMANAGER_H
|
||||
|
||||
class LoadingWindow;
|
||||
class Song;
|
||||
class Style;
|
||||
class Steps;
|
||||
@@ -31,7 +30,7 @@ public:
|
||||
SongManager();
|
||||
~SongManager();
|
||||
|
||||
void InitSongsFromDisk( LoadingWindow *ld );
|
||||
void InitSongsFromDisk();
|
||||
void FreeSongs();
|
||||
void Cleanup();
|
||||
|
||||
@@ -49,7 +48,7 @@ public:
|
||||
|
||||
void LoadGroupSymLinks( RString sDir, RString sGroupFolder );
|
||||
|
||||
void InitCoursesFromDisk( LoadingWindow *ld );
|
||||
void InitCoursesFromDisk();
|
||||
void InitAutogenCourses();
|
||||
void InitRandomAttacks();
|
||||
void FreeCourses();
|
||||
@@ -59,8 +58,8 @@ public:
|
||||
void DeleteAutogenCourses();
|
||||
void InvalidateCachedTrails();
|
||||
|
||||
void InitAll( LoadingWindow *ld ); // songs, courses, groups - everything.
|
||||
void Reload( bool bAllowFastLoad, LoadingWindow *ld=NULL ); // songs, courses, groups - everything.
|
||||
void InitAll(); // songs, courses, groups - everything.
|
||||
void Reload( bool bAllowFastLoad); // songs, courses, groups - everything.
|
||||
void PreloadSongImages();
|
||||
|
||||
RString GetSongGroupBannerPath( RString sSongGroup ) const;
|
||||
@@ -166,7 +165,7 @@ public:
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
protected:
|
||||
void LoadStepManiaSongDir( RString sDir, LoadingWindow *ld );
|
||||
void LoadStepManiaSongDir( RString sDir );
|
||||
void LoadDWISongDir( RString sDir );
|
||||
bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut );
|
||||
void SanityCheckGroupDir( RString sDir ) const;
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj""
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/modern_working/lib/avformat.lib ffmpeg/modern_working/lib/avutil.lib ffmpeg/modern_working/lib/swscale.lib"
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib Comctl32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/modern_working/lib/avformat.lib ffmpeg/modern_working/lib/avutil.lib ffmpeg/modern_working/lib/swscale.lib"
|
||||
OutputFile="../Program/StepMania-debug.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
@@ -192,7 +192,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj""
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/modern_working/lib/avformat.lib ffmpeg/modern_working/lib/avutil.lib ffmpeg/modern_working/lib/swscale.lib"
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib Comctl32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/modern_working/lib/avformat.lib ffmpeg/modern_working/lib/avutil.lib ffmpeg/modern_working/lib/swscale.lib"
|
||||
OutputFile="../Program/StepMania.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@@ -294,7 +294,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj""
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/lib/avformat.lib ffmpeg/lib/avutil.lib ffmpeg/lib/swscale.lib"
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib Comctl32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/lib/avformat.lib ffmpeg/lib/avutil.lib ffmpeg/lib/swscale.lib"
|
||||
OutputFile="../Program/StepMania-fastdebug.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
@@ -406,7 +406,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj""
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/modern_working/lib/avformat.lib ffmpeg/modern_working/lib/avutil.lib ffmpeg/modern_working/lib/swscale.lib"
|
||||
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib Comctl32.lib ffmpeg/modern_working/lib/avcodec.lib ffmpeg/modern_working/lib/avformat.lib ffmpeg/modern_working/lib/avutil.lib ffmpeg/modern_working/lib/swscale.lib"
|
||||
OutputFile="..\Program/StepMania-SSE2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@@ -2810,6 +2810,8 @@
|
||||
RelativePath="HelpDisplay.h"
|
||||
>
|
||||
</File>
|
||||
<File RelativePath="InGameLoadingWindow.cpp"></File>
|
||||
<File RelativePath="InGameLoadingWindow.h"></File>
|
||||
<File
|
||||
RelativePath="MemoryCardDisplay.cpp"
|
||||
>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='FastDebug|Win32'">$(TargetDir)</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='FastDebug|Win32'">$(SolutionDir)/build-$(SolutionName)/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='FastDebug|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='FastDebug|Win32'">true</LinkIncremental>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='FastDebug|Win32'">true</GenerateManifest>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release-SSE2|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release-SSE2|Win32'">$(Configuration)\</IntDir>
|
||||
@@ -149,7 +149,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../Program/StepMania-debug.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
@@ -216,7 +216,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../Program/StepMania.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
@@ -268,7 +268,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4063;4100;4127;4201;4244;4275;4355;4505;4512;4702;4786;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
@@ -280,7 +280,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;avcodec.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../Program/StepMania-fastdebug.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\extern\libpng\lib;ffmpeg\modern_working\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
@@ -295,7 +295,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<LinkErrorReporting>SendErrorReport</LinkErrorReporting>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>archutils\Win32\mapconv "$(IntDir)$(TargetName).map" "$(TargetDir)\StepMania-fastdebug.vdi"</Command>
|
||||
@@ -349,7 +349,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\Program/StepMania-SSE2.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
@@ -643,6 +643,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
<ClCompile Include="GraphDisplay.cpp" />
|
||||
<ClCompile Include="GrooveRadar.cpp" />
|
||||
<ClCompile Include="HelpDisplay.cpp" />
|
||||
<ClCompile Include="InGameLoadingWindow.cpp" />
|
||||
<ClCompile Include="MemoryCardDisplay.cpp" />
|
||||
<ClCompile Include="MenuTimer.cpp" />
|
||||
<ClCompile Include="ModIcon.cpp" />
|
||||
@@ -1689,6 +1690,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="InGameLoadingWindow.h" />
|
||||
<ClInclude Include="Screen.h" />
|
||||
<ClInclude Include="ScreenAttract.h" />
|
||||
<ClInclude Include="ScreenBookkeeping.h" />
|
||||
@@ -2395,4 +2397,4 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)</Command>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -1629,6 +1629,9 @@
|
||||
<ClCompile Include="SongPosition.cpp">
|
||||
<Filter>Data Structures</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="InGameLoadingWindow.cpp">
|
||||
<Filter>Actors used in Menus</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Screen.h">
|
||||
@@ -3026,6 +3029,9 @@
|
||||
<ClInclude Include="SongPosition.h">
|
||||
<Filter>Data Structures</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="InGameLoadingWindow.h">
|
||||
<Filter>Actors used in Menus</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="archutils\Win32\smzip.ico">
|
||||
@@ -3154,4 +3160,4 @@
|
||||
<Filter>BaseClasses</Filter>
|
||||
</CustomBuildStep>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
+20
-6
@@ -1011,7 +1011,7 @@ int main(int argc, char* argv[])
|
||||
GAMESTATE = new GameState;
|
||||
|
||||
// This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow.
|
||||
LoadingWindow *pLoadingWindow = LoadingWindow::Create();
|
||||
pLoadingWindow = LoadingWindow::Create();
|
||||
if(pLoadingWindow == NULL)
|
||||
RageException::Throw("%s", COULDNT_OPEN_LOADING_WINDOW.GetValue().c_str());
|
||||
|
||||
@@ -1037,7 +1037,7 @@ int main(int argc, char* argv[])
|
||||
// Switch to the last used game type, and set up the theme and announcer.
|
||||
SwitchToLastPlayedGame();
|
||||
|
||||
CommandLineActions::Handle(pLoadingWindow);
|
||||
CommandLineActions::Handle();
|
||||
|
||||
if( GetCommandlineArgument("dopefish") )
|
||||
GAMESTATE->m_bDopefish = true;
|
||||
@@ -1054,40 +1054,57 @@ int main(int argc, char* argv[])
|
||||
|
||||
if( PREFSMAN->m_iSoundWriteAhead )
|
||||
LOG->Info( "Sound writeahead has been overridden to %i", PREFSMAN->m_iSoundWriteAhead.Get() );
|
||||
|
||||
pLoadingWindow->SetText("Starting sound subsystem...");
|
||||
SOUNDMAN = new RageSoundManager;
|
||||
SOUNDMAN->Init();
|
||||
SOUNDMAN->SetMixVolume();
|
||||
SOUND = new GameSoundManager;
|
||||
pLoadingWindow->SetText("Initializing bookkeeper...");
|
||||
BOOKKEEPER = new Bookkeeper;
|
||||
pLoadingWindow->SetText("Starting lights subsystem...");
|
||||
LIGHTSMAN = new LightsManager;
|
||||
INPUTFILTER = new InputFilter;
|
||||
INPUTMAPPER = new InputMapper;
|
||||
|
||||
pLoadingWindow->SetText("Loading game type...");
|
||||
StepMania::ChangeCurrentGame( GAMESTATE->GetCurrentGame() );
|
||||
|
||||
INPUTQUEUE = new InputQueue;
|
||||
pLoadingWindow->SetText("Building song cache index...");
|
||||
SONGINDEX = new SongCacheIndex;
|
||||
pLoadingWindow->SetText("Loading banner cache...");
|
||||
BANNERCACHE = new BannerCache;
|
||||
//BACKGROUNDCACHE = new BackgroundCache;
|
||||
|
||||
// depends on SONGINDEX:
|
||||
SONGMAN = new SongManager;
|
||||
SONGMAN->InitAll( pLoadingWindow ); // this takes a long time
|
||||
SONGMAN->InitAll(); // this takes a long time
|
||||
CRYPTMAN = new CryptManager; // need to do this before ProfileMan
|
||||
if( PREFSMAN->m_bSignProfileData )
|
||||
CRYPTMAN->GenerateGlobalKeys();
|
||||
pLoadingWindow->SetText("Initializing memory card system...");
|
||||
MEMCARDMAN = new MemoryCardManager;
|
||||
pLoadingWindow->SetText("Initializing character system...");
|
||||
CHARMAN = new CharacterManager;
|
||||
pLoadingWindow->SetText("Initializing profile system...");
|
||||
PROFILEMAN = new ProfileManager;
|
||||
PROFILEMAN->Init(); // must load after SONGMAN
|
||||
UNLOCKMAN = new UnlockManager;
|
||||
pLoadingWindow->SetText("Updating popular song list...");
|
||||
SONGMAN->UpdatePopular();
|
||||
SONGMAN->UpdatePreferredSort();
|
||||
|
||||
NSMAN = new NetworkSyncManager( pLoadingWindow );
|
||||
pLoadingWindow->SetText("Initializing message system...");
|
||||
MESSAGEMAN = new MessageManager;
|
||||
pLoadingWindow->SetText("Initializing statics manager...");
|
||||
STATSMAN = new StatsManager;
|
||||
|
||||
// Initialize which courses are ranking courses here.
|
||||
pLoadingWindow->SetText("Updating cource rankings...");
|
||||
SONGMAN->UpdateRankingCourses();
|
||||
|
||||
SAFE_DELETE( pLoadingWindow ); // destroy this before init'ing Display
|
||||
|
||||
/* If the user has tried to quit during the loading, do it before creating
|
||||
@@ -1127,9 +1144,6 @@ int main(int argc, char* argv[])
|
||||
|
||||
CodeDetector::RefreshCacheItems();
|
||||
|
||||
// Initialize which courses are ranking courses here.
|
||||
SONGMAN->UpdateRankingCourses();
|
||||
|
||||
if( GetCommandlineArgument("netip") )
|
||||
NSMAN->DisplayStartupStatus(); // If we're using networking show what happened
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "RageTimer.h"
|
||||
#include "FontCharAliases.h"
|
||||
#include "arch/ArchHooks/ArchHooks.h"
|
||||
#include "arch/LoadingWindow/LoadingWindow.h"
|
||||
#include "arch/Dialog/Dialog.h"
|
||||
#include "RageFile.h"
|
||||
#if !defined(SMPACKAGE)
|
||||
@@ -397,6 +398,8 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt
|
||||
if( bNothingChanging && !bForceThemeReload )
|
||||
return;
|
||||
|
||||
if(pLoadingWindow) pLoadingWindow->SetText("Loading theme & language...");
|
||||
|
||||
m_bPseudoLocalize = bPseudoLocalize;
|
||||
|
||||
// Load theme metrics. If only the language is changing, this is all
|
||||
|
||||
@@ -47,12 +47,17 @@ LoadingWindow *LoadingWindow::Create()
|
||||
}
|
||||
}
|
||||
|
||||
if( ret )
|
||||
if( ret ) {
|
||||
LOG->Info( "Loading window: %s", Driver.c_str() );
|
||||
|
||||
ret->SetIndeterminate(true);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
LoadingWindow *pLoadingWindow;
|
||||
|
||||
/*
|
||||
* (c) 2002-2005 Glenn Maynard
|
||||
* All rights reserved.
|
||||
|
||||
@@ -11,11 +11,20 @@ public:
|
||||
virtual RString Init() { return RString(); }
|
||||
virtual ~LoadingWindow() { }
|
||||
|
||||
virtual void Paint() { }
|
||||
virtual void SetText( RString str ) = 0;
|
||||
virtual void SetIcon( const RageSurface *pIcon ) { }
|
||||
virtual void SetProgress( const int progress ) { m_progress=progress; }
|
||||
virtual void SetTotalWork( const int totalWork ) { m_totalWork=totalWork; }
|
||||
virtual void SetIndeterminate( bool indeterminate ) { m_indeterminate=indeterminate; }
|
||||
|
||||
protected:
|
||||
int m_progress;
|
||||
int m_totalWork;
|
||||
bool m_indeterminate;
|
||||
};
|
||||
|
||||
extern LoadingWindow *pLoadingWindow;
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,9 @@ public:
|
||||
LoadingWindow_MacOSX();
|
||||
~LoadingWindow_MacOSX();
|
||||
void SetText( RString str );
|
||||
void SetProgress( const int progress );
|
||||
void SetTotalWork( const int totalWork );
|
||||
void SetIndeterminate( bool indeterminate );
|
||||
};
|
||||
#define USE_LOADING_WINDOW_MACOSX
|
||||
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
NSWindow *m_Window;
|
||||
NSTextView *m_Text;
|
||||
NSAutoreleasePool *m_Pool;
|
||||
NSProgressIndicator *m_ProgressIndicator;
|
||||
}
|
||||
- (void) setupWindow:(NSImage *)image;
|
||||
- (void) setProgress:(NSNumber *)progress;
|
||||
- (void) setTotalWork:(NSNumber *)totalWork;
|
||||
- (void) setIndeterminate:(NSNumber *)indeterminate;
|
||||
@end
|
||||
|
||||
@implementation LoadingWindowHelper
|
||||
@@ -21,14 +25,25 @@
|
||||
NSRect viewRect, windowRect;
|
||||
float height = 0.0f;
|
||||
|
||||
NSRect progressIndicatorRect;
|
||||
progressIndicatorRect = NSMakeRect(0, 0, size.width, 0);
|
||||
m_ProgressIndicator = [[NSProgressIndicator alloc] initWithFrame:progressIndicatorRect];
|
||||
[m_ProgressIndicator sizeToFit];
|
||||
[m_ProgressIndicator setIndeterminate:YES];
|
||||
[m_ProgressIndicator setMinValue:0];
|
||||
[m_ProgressIndicator setMaxValue:1];
|
||||
[m_ProgressIndicator setDoubleValue:0];
|
||||
progressIndicatorRect = [m_ProgressIndicator frame];
|
||||
float progressHeight = progressIndicatorRect.size.height;
|
||||
|
||||
NSFont *font = [NSFont systemFontOfSize:0.0f];
|
||||
NSRect textRect;
|
||||
// Just give it a size until it is created.
|
||||
textRect = NSMakeRect( 0, 0, size.width, size.height );
|
||||
textRect = NSMakeRect( 0, progressHeight, size.width, size.height );
|
||||
m_Text = [[NSTextView alloc] initWithFrame:textRect];
|
||||
[m_Text setFont:font];
|
||||
height = [[m_Text layoutManager] defaultLineHeightForFont:font]*3 + 4;
|
||||
textRect = NSMakeRect( 0, 0, size.width, height );
|
||||
textRect = NSMakeRect( 0, progressHeight, size.width, height );
|
||||
|
||||
[m_Text setFrame:textRect];
|
||||
[m_Text setEditable:NO];
|
||||
@@ -40,12 +55,12 @@
|
||||
[m_Text setVerticallyResizable:NO];
|
||||
[m_Text setString:@"Initializing Hardware..."];
|
||||
|
||||
viewRect = NSMakeRect( 0, height, size.width, size.height );
|
||||
viewRect = NSMakeRect( 0, height + progressHeight, size.width, size.height );
|
||||
NSImageView *iView = [[NSImageView alloc] initWithFrame:viewRect];
|
||||
[iView setImage:image];
|
||||
[iView setImageFrameStyle:NSImageFrameNone];
|
||||
|
||||
windowRect = NSMakeRect( 0, 0, size.width, size.height + height );
|
||||
windowRect = NSMakeRect( 0, 0, size.width, size.height + height + progressHeight);
|
||||
m_Window = [[NSWindow alloc] initWithContentRect:windowRect
|
||||
styleMask:NSTitledWindowMask
|
||||
backing:NSBackingStoreBuffered
|
||||
@@ -66,10 +81,27 @@
|
||||
[view addSubview:iView];
|
||||
[m_Text release];
|
||||
[iView release];
|
||||
[view addSubview:m_ProgressIndicator];
|
||||
|
||||
// Display the window.
|
||||
[m_Window makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (void) setProgress:(NSNumber *)progress
|
||||
{
|
||||
[m_ProgressIndicator setDoubleValue:[progress doubleValue]];
|
||||
}
|
||||
|
||||
- (void) setTotalWork:(NSNumber *)totalWork
|
||||
{
|
||||
[m_ProgressIndicator setMaxValue:[totalWork doubleValue]];
|
||||
}
|
||||
|
||||
- (void) setIndeterminate:(NSNumber *)indeterminate
|
||||
{
|
||||
[m_ProgressIndicator setIndeterminate:([indeterminate doubleValue] > 0 ? YES : NO)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
static LoadingWindowHelper *g_Helper = nil;
|
||||
@@ -124,6 +156,22 @@ void LoadingWindow_MacOSX::SetText( RString str )
|
||||
[s release];
|
||||
}
|
||||
|
||||
void LoadingWindow_MacOSX::SetProgress( const int progress )
|
||||
{
|
||||
[g_Helper performSelectorOnMainThread:@selector(setProgress:) withObject:[NSNumber numberWithDouble:(double)progress] waitUntilDone:NO];
|
||||
}
|
||||
|
||||
void LoadingWindow_MacOSX::SetTotalWork( const int totalWork )
|
||||
{
|
||||
[g_Helper performSelectorOnMainThread:@selector(setTotalWork:) withObject:[NSNumber numberWithDouble:(double)totalWork] waitUntilDone:NO];
|
||||
}
|
||||
|
||||
void LoadingWindow_MacOSX::SetIndeterminate( bool indeterminate )
|
||||
{
|
||||
double tmp = indeterminate ? 1 : 0;
|
||||
[g_Helper performSelectorOnMainThread:@selector(setIndeterminate:) withObject:[NSNumber numberWithDouble:tmp] waitUntilDone:NO];
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2003-2006, 2008 Steve Checkoway
|
||||
* All rights reserved.
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "archutils/win32/WindowIcon.h"
|
||||
#include "archutils/win32/ErrorStrings.h"
|
||||
#include <windows.h>
|
||||
#include "CommCtrl.h"
|
||||
#include "RageSurface_Load.h"
|
||||
#include "RageSurface.h"
|
||||
#include "RageSurfaceUtils.h"
|
||||
@@ -17,6 +18,9 @@
|
||||
#include "RageSurfaceUtils_Zoom.h"
|
||||
static HBITMAP g_hBitmap = NULL;
|
||||
|
||||
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
|
||||
|
||||
/* Load a RageSurface into a GDI surface. */
|
||||
static HBITMAP LoadWin32Surface( RageSurface *&s )
|
||||
{
|
||||
@@ -76,8 +80,18 @@ static HBITMAP LoadWin32Surface( RString sFile, HWND hWnd )
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
INT_PTR CALLBACK LoadingWindow_Win32::DlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
|
||||
LoadingWindow_Win32 *self;
|
||||
|
||||
if(msg==WM_INITDIALOG) {
|
||||
self=(LoadingWindow_Win32 *)lParam;
|
||||
SetWindowLong(hWnd,DWL_USER,(LONG)self);
|
||||
} else {
|
||||
self=(LoadingWindow_Win32 *)GetWindowLong(hWnd,DWL_USER);
|
||||
}
|
||||
|
||||
switch( msg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
@@ -95,11 +109,25 @@ BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam,
|
||||
(WPARAM) IMAGE_BITMAP,
|
||||
(LPARAM) (HANDLE) g_hBitmap );
|
||||
SetWindowTextA( hWnd, PRODUCT_ID );
|
||||
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
return FALSE;
|
||||
|
||||
case WM_DESTROY:
|
||||
DeleteObject( g_hBitmap );
|
||||
g_hBitmap = NULL;
|
||||
self->runMessageLoop=false;
|
||||
self->hwnd=NULL;
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case WM_APP:
|
||||
DestroyWindow(hWnd);
|
||||
self->runMessageLoop=false;
|
||||
ExitThread(0);
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -118,34 +146,54 @@ void LoadingWindow_Win32::SetIcon( const RageSurface *pIcon )
|
||||
|
||||
LoadingWindow_Win32::LoadingWindow_Win32()
|
||||
{
|
||||
INITCOMMONCONTROLSEX cceData;
|
||||
cceData.dwSize=sizeof(INITCOMMONCONTROLSEX);
|
||||
cceData.dwICC=ICC_PROGRESS_CLASS;
|
||||
InitCommonControlsEx(&cceData);
|
||||
|
||||
m_hIcon = NULL;
|
||||
hwnd = CreateDialog( handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, WndProc );
|
||||
|
||||
runMessageLoop=true;
|
||||
|
||||
guiReadyEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
|
||||
|
||||
pumpThread=CreateThread(NULL, NULL, MessagePump, (void *)this, 0, &pumpThreadId);
|
||||
|
||||
WaitForSingleObject(guiReadyEvent,INFINITE);
|
||||
|
||||
for( unsigned i = 0; i < 3; ++i )
|
||||
text[i] = "ABC"; /* always set on first call */
|
||||
SetText( "" );
|
||||
Paint();
|
||||
}
|
||||
|
||||
LoadingWindow_Win32::~LoadingWindow_Win32()
|
||||
{
|
||||
if( hwnd )
|
||||
DestroyWindow( hwnd );
|
||||
SendMessage(hwnd,WM_APP,0,0);
|
||||
//SendMessage(hwnd,WM_NULL,0,0);
|
||||
WaitForSingleObject(pumpThread,INFINITE);
|
||||
if(guiReadyEvent)
|
||||
CloseHandle(guiReadyEvent);
|
||||
if( m_hIcon != NULL )
|
||||
DestroyIcon( m_hIcon );
|
||||
}
|
||||
|
||||
void LoadingWindow_Win32::Paint()
|
||||
DWORD WINAPI LoadingWindow_Win32::MessagePump(LPVOID thisAsVoidPtr)
|
||||
{
|
||||
SendMessage( hwnd, WM_PAINT, 0, 0 );
|
||||
LoadingWindow_Win32 *self=(LoadingWindow_Win32 *)thisAsVoidPtr;
|
||||
|
||||
/* Process all queued messages since the last paint. This allows the window to
|
||||
* come back if it loses focus during load. */
|
||||
self->hwnd = CreateDialogParam( self->handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, DlgProc, (LPARAM)thisAsVoidPtr);
|
||||
|
||||
SetEvent(self->guiReadyEvent);
|
||||
|
||||
// Run the message loop in a separate thread to keep the gui responsive during the loading
|
||||
MSG msg;
|
||||
while( PeekMessage( &msg, hwnd, 0, 0, PM_NOREMOVE ) )
|
||||
while(self->runMessageLoop && GetMessage(&msg, self->hwnd, 0, 0 ) )
|
||||
{
|
||||
GetMessage(&msg, hwnd, 0, 0 );
|
||||
if(IsDialogMessage(self->hwnd,&msg)) continue;
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
|
||||
return msg.wParam;
|
||||
}
|
||||
|
||||
void LoadingWindow_Win32::SetText( RString sText )
|
||||
@@ -168,6 +216,35 @@ void LoadingWindow_Win32::SetText( RString sText )
|
||||
}
|
||||
}
|
||||
|
||||
void LoadingWindow_Win32::SetProgress(const int progress)
|
||||
{
|
||||
m_progress=progress;
|
||||
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
||||
::SendMessage(hwndItem,PBM_SETPOS,progress,0);
|
||||
}
|
||||
|
||||
void LoadingWindow_Win32::SetTotalWork(const int totalWork)
|
||||
{
|
||||
m_totalWork=totalWork;
|
||||
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
||||
SendMessage(hwndItem,PBM_SETRANGE32,0,totalWork);
|
||||
}
|
||||
|
||||
void LoadingWindow_Win32::SetIndeterminate(bool indeterminate) {
|
||||
m_indeterminate=indeterminate;
|
||||
|
||||
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
||||
|
||||
if(indeterminate) {
|
||||
SetWindowLong(hwndItem,GWL_STYLE, PBS_MARQUEE | GetWindowLong(hwndItem,GWL_STYLE));
|
||||
SendMessage(hwndItem,PBM_SETMARQUEE,1,0);
|
||||
} else {
|
||||
SendMessage(hwndItem,PBM_SETMARQUEE,0,0);
|
||||
SetWindowLong(hwndItem,GWL_STYLE, (~PBS_MARQUEE) & GetWindowLong(hwndItem,GWL_STYLE));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||
* All rights reserved.
|
||||
|
||||
@@ -14,16 +14,25 @@ public:
|
||||
~LoadingWindow_Win32();
|
||||
|
||||
void SetText( RString sText );
|
||||
void Paint();
|
||||
void SetIcon( const RageSurface *pIcon );
|
||||
void SetProgress( const int progress );
|
||||
void SetTotalWork( const int totalWork );
|
||||
void SetIndeterminate( bool indeterminate );
|
||||
|
||||
private:
|
||||
AppInstance handle;
|
||||
HWND hwnd;
|
||||
RString text[3];
|
||||
HICON m_hIcon;
|
||||
HANDLE pumpThread;
|
||||
DWORD pumpThreadId;
|
||||
HANDLE guiReadyEvent;
|
||||
|
||||
static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||
volatile bool runMessageLoop;
|
||||
|
||||
static DWORD WINAPI MessagePump(LPVOID thisAsVoidPtr);
|
||||
|
||||
static INT_PTR CALLBACK DlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||
};
|
||||
#define USE_LOADING_WINDOW_WIN32
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#define IDC_BUTTON_CLOSE 1011
|
||||
#define IDC_VIEW_LOG 1012
|
||||
#define IDC_STATIC_MESSAGE3 1013
|
||||
#define IDC_PROGRESS1 1014
|
||||
#define IDC_PROGRESS 1014
|
||||
#define IDC_HUSH 1016
|
||||
#define IDC_MESSAGE 1017
|
||||
|
||||
@@ -13,13 +13,11 @@
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
// English (United States) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -43,14 +41,17 @@ BEGIN
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,0,34,332,1
|
||||
END
|
||||
|
||||
IDD_LOADING_DIALOG DIALOG 0, 0, 312, 82
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif"
|
||||
IDD_LOADING_DIALOG DIALOGEX 0, 0, 317, 94
|
||||
STYLE DS_SETFONT | DS_CENTER | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "Stepmania"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
CTEXT "line1",IDC_STATIC_MESSAGE1,0,41,310,10,SS_NOPREFIX | SS_CENTERIMAGE
|
||||
CTEXT "line2",IDC_STATIC_MESSAGE2,0,54,310,10,SS_NOPREFIX | SS_CENTERIMAGE
|
||||
CTEXT "line3",IDC_STATIC_MESSAGE3,0,65,310,10,SS_NOPREFIX | SS_CENTERIMAGE
|
||||
CTEXT "line1",IDC_STATIC_MESSAGE1,0,67,310,10,SS_NOPREFIX | SS_CENTERIMAGE
|
||||
CTEXT "line2",IDC_STATIC_MESSAGE2,0,76,310,10,SS_NOPREFIX | SS_CENTERIMAGE
|
||||
CTEXT "line3",IDC_STATIC_MESSAGE3,0,84,310,10,SS_NOPREFIX | SS_CENTERIMAGE
|
||||
CONTROL "",IDC_SPLASH,"Static",SS_BITMAP,0,0,310,25
|
||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",0x0,7,51,298,14
|
||||
END
|
||||
|
||||
IDD_DISASM_CRASH DIALOGEX 0, 0, 332, 114
|
||||
@@ -102,14 +103,14 @@ END
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_LOADING_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 305
|
||||
RIGHTMARGIN, 310
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 75
|
||||
BOTTOMMARGIN, 87
|
||||
END
|
||||
|
||||
IDD_DISASM_CRASH, DIALOG
|
||||
@@ -212,7 +213,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ C4355: 'this' : used in base member initializer list
|
||||
|
||||
/* Pull in NT-only definitions. Note that we support Win98 and WinME; you can
|
||||
* make NT calls, but be sure to fall back on 9x if they're not supported. */
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define _WIN32_IE 0x0400
|
||||
|
||||
// If this isn't defined to 0, VC fails to define things like stat and alloca.
|
||||
|
||||
Reference in New Issue
Block a user