diff options
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r-- | Game/Code/Classes/UMain.pas | 1 | ||||
-rw-r--r-- | Game/Code/Classes/USongs.pas | 36 |
2 files changed, 22 insertions, 15 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas index fa4c45b5..e4acf4aa 100644 --- a/Game/Code/Classes/UMain.pas +++ b/Game/Code/Classes/UMain.pas @@ -145,7 +145,6 @@ uses USongs, UJoystick, math, UCommandLine, ULanguage, SDL_ttf, const Version = 'UltraStar Deluxe V 1.10 Alpha Build'; -//{$IFDEF WIN32} Procedure Main; var WndTitle: string; diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 2eeeec87..7fd58034 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -9,19 +9,17 @@ interface {$I switches.inc} uses - {$ifndef MSWINDOWS} - {$IFDEF DARWIN} - baseunix, - {$ELSE} + {$IFDEF MSWINDOWS} + Windows, + DirWatch, + {$ELSE} + {$IFNDEF DARWIN} oldlinux, + syscall, {$ENDIF} baseunix, UnixType, - syscall, - {$else} - windows, - DirWatch, - {$endif} + {$ENDIF} SysUtils, Classes, ULog, @@ -91,7 +89,7 @@ type fWatch : longint; fParseSongDirectory : boolean; fProcessing : boolean; - {$ifdef win32} + {$ifdef MSWINDOWS} fDirWatch : TDirectoryWatch; {$endif} procedure int_LoadSongList; @@ -169,7 +167,7 @@ begin inherited create( false ); self.freeonterminate := true; - {$IFDEF Win32} + {$IFDEF MSWINDOWS} fDirWatch := TDirectoryWatch.create(nil); fDirWatch.OnChange := DoDirChanged; fDirWatch.Directory := SongPath; @@ -206,7 +204,7 @@ end; procedure TSongs.DoDirChanged(Sender: TObject); begin - LoadSongList();
+ LoadSongList(); end; procedure TSongs.Execute(); @@ -284,12 +282,22 @@ var {$ifdef MSWINDOWS} SR: TSearchRecW; // for parsing Songs Directory - {$else} // This should work on all posix systems. + {$ENDIF} + + // eddie: can we merge that? is baseunix working on linux? oldlinux is + // not available on mac os x. + {$IFDEF LINUX} TheDir : oldlinux.pdir; ADirent : oldlinux.pDirent; Entry : Longint; info : oldlinux.stat; - {$endif} + {$ENDIF} + {$IFDEF DARWIN} + TheDir : pdir; + ADirent : pDirent; + Entry : Longint; + info : stat; + {$ENDIF} begin {$ifdef MSWINDOWS} if FindFirstW(Dir + '*', faDirectory, SR) = 0 then // JB_Unicode - windows |