OSDN Git Service

相対パスで、.\でカレントディレクトリとする書き方を許容するように拡張した。
authorh677 <h677>
Sun, 27 Jul 2008 16:24:14 +0000 (16:24 +0000)
committerh677 <h677>
Sun, 27 Jul 2008 16:24:14 +0000 (16:24 +0000)
Setting.pas

index 7a98588..23c006e 100644 (file)
@@ -1218,8 +1218,16 @@ begin
                if Exists then begin
                        for i := 0 to GetSoundCount - 1 do begin
                                SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
-                               if not FileExists(SoundFileName[i]) then
-                                       SoundFileName[i] := '';
+                // \91\8a\91Î\8eQ\8fÆ\91Î\8dô
+                s := SoundFileName[i];
+                if (AnsiPos('.\', SoundFileName[i]) = 1) then begin
+                    s := GetAppDir
+                            + Copy(SoundFileName[i], 2, Length(SoundFileName[i]));
+                end;
+                // \83t\83@\83C\83\8b\82Ì\91\8dÝ\83`\83F\83b\83N
+                if not FileExists(SoundFileName[i]) then begin
+                    SoundFileName[i] := '';
+                end;
                        end;
                end else begin
                        s := GetAppDir + '\sound\';
@@ -1872,6 +1880,11 @@ begin
        for i := 0 to GetSoundCount - 1 do begin
                if SoundName[i] = Name then begin
                        Result := SoundFileName[i];
+            // \91\8a\91Î\83p\83X\91Î\8dô
+            if (AnsiPos('.\', Result) = 1) then begin
+                Result := GetAppDir
+                    + Copy(Result, 2, Length(Result));
+            end;
                        Exit;
                end;
        end;