aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/USongs.pas
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 18:51:40 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 18:51:40 +0000
commit6ca1db26350a589b5bcb3e2eac35a7965d5ab448 (patch)
tree37f4d6bef02b3bbeccefbaafa5eeb94a3942a7f8 /Game/Code/Classes/USongs.pas
parenta5ca459937cf9f08d47ca6aca16e777153821f25 (diff)
downloadusdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.gz
usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.xz
usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.zip
Mac OS X: Added PseudoThread for debugging, because debugging of threaded code causes problems with Xcode and FreePascal.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@594 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/USongs.pas25
1 files changed, 22 insertions, 3 deletions
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index a04c1032..9b9ab7bb 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -8,6 +8,12 @@ interface
{$I switches.inc}
+{$IFDEF DARWIN}
+ {$IFDEF DEBUG}
+ {$DEFINE USE_PSEUDO_THREAD}
+ {$ENDIF}
+{$ENDIF}
+
uses
{$IFDEF MSWINDOWS}
Windows,
@@ -30,6 +36,9 @@ uses
{$IFDEF DARWIN}
cthreads,
{$ENDIF}
+ {$IFDEF USE_PSEUDO_THREAD}
+ PseudoThread,
+ {$ENDIF}
UCatCovers;
type
@@ -86,8 +95,13 @@ type
OrderTyp: integer; // type of sorting for this button (0=name)
CatNumber: integer; // Count of Songs in Category for Cats and Number of Song in Category for Songs
end;
-
+
+
+ {$IFDEF USE_PSEUDO_THREAD}
+ TSongs = class( TPseudoThread )
+ {$ELSE}
TSongs = class( TThread )
+ {$ENDIF}
private
BrowsePos : Cardinal; //Actual Pos in Song Array
fNotify ,
@@ -204,7 +218,9 @@ begin
*)
{$endif}
- Setlength(Song, 0);
+{$IFNDEF USE_PSEUDO_THREAD}
+ Setlength(Song, 0);
+{$ENDIF}
end;
procedure TSongs.DoDirChanged(Sender: TObject);
@@ -216,6 +232,9 @@ procedure TSongs.Execute();
var
fChangeNotify : THandle;
begin
+{$IFDEF USE_PSEUDO_THREAD}
+ int_LoadSongList();
+{$ELSE}
fParseSongDirectory := true;
while not self.terminated do
@@ -229,7 +248,7 @@ begin
self.suspend;
end;
-
+{$ENDIF}
end;
procedure TSongs.int_LoadSongList;