aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 23:18:12 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 23:18:12 +0000
commitfba9a67e3718a65594dc7969dac952ce5cca99d8 (patch)
treef31b8182266ae3b918f64d956e29dbc1ed703824 /Game
parentfad9bf088ffa01246ca1ada66a0c1ab81f07108b (diff)
downloadusdx-fba9a67e3718a65594dc7969dac952ce5cca99d8.tar.gz
usdx-fba9a67e3718a65594dc7969dac952ce5cca99d8.tar.xz
usdx-fba9a67e3718a65594dc7969dac952ce5cca99d8.zip
Fixed song loading on Windows.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@601 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UPlatformWindows.pas33
1 files changed, 17 insertions, 16 deletions
diff --git a/Game/Code/Classes/UPlatformWindows.pas b/Game/Code/Classes/UPlatformWindows.pas
index f78b87ec..7e65d700 100644
--- a/Game/Code/Classes/UPlatformWindows.pas
+++ b/Game/Code/Classes/UPlatformWindows.pas
@@ -103,32 +103,33 @@ Function TPlatform.DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs
var
i : Integer;
SR : TSearchRecW;
+ lAttrib : Integer;
begin
i := 0;
Filter := LowerCase(Filter);
- if ReturnAllSubDirs then begin
- if FindFirstW(Dir + '*', faDirectory, SR) = 0 then
- repeat
- if (SR.Name <> '.') and (SR.Name <> '..') then
+ if FindFirstW(Dir + '*', faAnyFile or faDirectory, SR) = 0 then
+ repeat
+ if (SR.Name <> '.') and (SR.Name <> '..') then
+ begin
+ lAttrib := FileGetAttr(Dir + SR.name);
+ if ReturnAllSubDirs and ((lAttrib and faDirectory) <> 0) then
begin
SetLength( Result, i + 1);
- Result[i].Name := SR.Name;
+ Result[i].Name := SR.name;
Result[i].IsDirectory := true;
Result[i].IsFile := false;
i := i + 1;
+ end
+ else if (Length(Filter) = 0) or (Pos( Filter, LowerCase(SR.Name)) > 0) then
+ begin
+ SetLength( Result, i + 1);
+ Result[i].Name := SR.Name;
+ Result[i].IsDirectory := false;
+ Result[i].IsFile := true;
+ i := i + 1;
end;
- until FindNextW(SR) <> 0;
- FindCloseW(SR);
- end;
-
- if FindFirstW(Dir + '*' + Filter, 0, SR) = 0 then
- repeat
- SetLength( Result, i + 1);
- Result[i].Name := SR.Name;
- Result[i].IsDirectory := true;
- Result[i].IsFile := false;
- i := i + 1;
+ end;
until FindNextW(SR) <> 0;
FindCloseW(SR);
end;