Skip to content

Commit c901390

Browse files
committed
changed slashes to PathDelim
1 parent 8718665 commit c901390

17 files changed

+489
-276
lines changed

Computer.pas

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ procedure ShowError(sMsg: string);
4949
mrYes: begin
5050
// dump memory if required
5151
sMsg := StrTran(sMsg, #13#10, '\n');
52-
if not SysUtils.DirectoryExists(sG_AppPath + '\Dump') then begin
53-
if not CreateDir(sG_AppPath + '\Dump') then
54-
raise Exception.Create('Cannot create ' + sG_AppPath + '\Dump');
52+
if not SysUtils.DirectoryExists(sG_AppPath + PathDelim + 'Dump') then begin
53+
if not CreateDir(sG_AppPath + PathDelim + 'Dump') then
54+
raise Exception.Create('Cannot create ' + sG_AppPath + PathDelim + 'Dump');
5555
end;
56-
SaveGame(sG_AppPath + 'Dump\trdump_' + FormatDateTime
56+
SaveGame(sG_AppPath + 'Dump' + PathDelim + 'trdump_' + FormatDateTime
5757
('yyyymmdd_hhmmss', Now) + '.trd', sMsg);
5858
end;
5959
mrAbort: begin
@@ -66,11 +66,11 @@ procedure ShowError(sMsg: string);
6666
if fSim.chkErrorDump.Checked then begin
6767
// dump memory if required
6868
sMsg := StrTran(sMsg, #13#10, '\n');
69-
if not SysUtils.DirectoryExists(sG_AppPath + '\Dump') then begin
70-
if not CreateDir(sG_AppPath + '\Dump') then
71-
raise Exception.Create('Cannot create ' + sG_AppPath + '\Dump');
69+
if not SysUtils.DirectoryExists(sG_AppPath + PathDelim +'Dump') then begin
70+
if not CreateDir(sG_AppPath + PathDelim + 'Dump') then
71+
raise Exception.Create('Cannot create ' + sG_AppPath + PathDelim + 'Dump');
7272
end;
73-
SaveGame(sG_AppPath + 'Dump\trdump_' + FormatDateTime('yyyymmdd_hhmmss',
73+
SaveGame(sG_AppPath + 'Dump'+PathDelim+'trdump_' + FormatDateTime('yyyymmdd_hhmmss',
7474
Now) + '.trd', sMsg);
7575
end;
7676
if fSim.chkErrorAbort.Checked then begin

ExpSubr.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,16 +1161,16 @@ procedure UTakeSnapshot(M: string);
11611161
begin
11621162
if arPlayer[iTurn].USnapShotEnabled then begin
11631163
// create dump folder, if not existing
1164-
if not SysUtils.DirectoryExists(sG_AppPath + '\Dump') then begin
1165-
if not CreateDir(sG_AppPath + '\Dump') then
1166-
raise Exception.Create('Cannot create ' + sG_AppPath + '\Dump');
1164+
if not SysUtils.DirectoryExists(sG_AppPath + PathDelim + 'Dump') then begin
1165+
if not CreateDir(sG_AppPath + PathDelim+'Dump') then
1166+
raise Exception.Create('Cannot create ' + sG_AppPath + PathDelim + 'Dump');
11671167
end;
11681168
if bG_TRSim then begin
1169-
SaveGame(sG_AppPath + 'Dump\trdump_' + FormatDateTime('yyyymmdd_hhmmss',
1169+
SaveGame(sG_AppPath + 'Dump' + PathDelim + 'trdump_' + FormatDateTime('yyyymmdd_hhmmss',
11701170
Now) + '_simgame_' + FormatFloat('000', iSimCurr) + '.trd', M);
11711171
end
11721172
else begin
1173-
SaveGame(sG_AppPath + 'Dump\trdump_' + FormatDateTime('yyyymmdd_hhmmss',
1173+
SaveGame(sG_AppPath + 'Dump' + PathDelim +'trdump_' + FormatDateTime('yyyymmdd_hhmmss',
11741174
Now) + '.trd', M)
11751175
end;
11761176
end;

Globals.pas

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,11 @@ procedure NewGameSetup;
10061006
Rank := 0;
10071007
if Computer then begin
10081008
// Load TRPs
1009-
if FileExists(sG_AppPath + 'players/' + PrgFile) then
1010-
PrgTemp.LoadFromFile(sG_AppPath + 'players/' + PrgFile)
1009+
if FileExists(sG_AppPath + 'players'+ PathDelim + PrgFile) then
1010+
PrgTemp.LoadFromFile(sG_AppPath + 'players' + PathDelim + PrgFile)
10111011
else begin
10121012
MessageDlg
1013-
(sG_AppPath + 'players/' +
1013+
(sG_AppPath + 'players' + PathDelim +
10141014
PrgFile + ': File not found.', mtError, [mbOk], 0);
10151015
PrgTemp.Clear;
10161016
bCompErrors := True;
@@ -1022,7 +1022,7 @@ procedure NewGameSetup;
10221022
bAttackFound := False;
10231023
bOccupationFound := False;
10241024
bFortificationFound := False;
1025-
Preproc.MainFileName := sG_AppPath + 'players/' + PrgFile;
1025+
Preproc.MainFileName := sG_AppPath + 'players' + PathDelim + PrgFile;
10261026
Preproc.MainFile := PrgTemp.Text;
10271027
Preproc.PreProcess(Preproc.MainFileName, sPPout);
10281028
if CompileTRP(Compiler, PrgFile, sPPout) then begin
@@ -1900,11 +1900,11 @@ procedure RestoreGame(sFileName: string);
19001900
FlMove := False;
19011901
if Computer then begin
19021902
// Load TRPs
1903-
if FileExists(sG_AppPath + 'players/' + PrgFile) then
1904-
PrgTemp.LoadFromFile(sG_AppPath + 'players/' + PrgFile)
1903+
if FileExists(sG_AppPath + 'players' + PathDelim + PrgFile) then
1904+
PrgTemp.LoadFromFile(sG_AppPath + 'players' + PathDelim + PrgFile)
19051905
else begin
19061906
MessageDlg
1907-
(sG_AppPath + 'players/' +
1907+
(sG_AppPath + 'players' + PathDelim +
19081908
PrgFile + ': File not found.', mtError, [mbOk], 0);
19091909
PrgTemp.Clear;
19101910
bCompErrors := True;

Main.lfm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ object fMain: TfMain
195195
object Label1: TLabel
196196
Left = 8
197197
Height = 13
198-
Top = 4
198+
Top = 10
199199
Width = 28
200200
Caption = 'Turn:'
201201
ParentColor = False
202202
end
203203
object panTurn: TPanel
204204
Left = 39
205-
Height = 23
206-
Top = 1
205+
Height = 24
206+
Top = 5
207207
Width = 98
208208
BevelOuter = bvLowered
209209
TabOrder = 0

Map.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ procedure TfMap.FormShow(Sender: TObject);
5454
bLoading := true;
5555
// load list of map
5656
lstMap.Clear;
57-
if FindFirst(sG_AppPath+'maps/*.trm', 0, SearchRec) = 0 then begin
57+
if FindFirst(sG_AppPath+'maps'+PathDelim+'*.trm', 0, SearchRec) = 0 then begin
5858
repeat
5959
with lstMap.Items.Add do begin
6060
Caption := SearchRec.Name;
6161
if SameText(SearchRec.Name,sMapFile) then begin
6262
Checked := true;
6363
lstMap.ItemIndex := lstMap.Items.Count-1;
6464
end;
65-
IniFile := TIniFile.Create(sG_AppPath+'maps/'+SearchRec.Name);
65+
IniFile := TIniFile.Create(sG_AppPath+'maps'+PathDelim+SearchRec.Name);
6666
try
6767
SubItems.Add(IniFile.ReadString('Map','Desc',''));
6868
SubItems.Add(IniFile.ReadString('Map','Author',''));
@@ -120,7 +120,7 @@ procedure TfMap.lstMapSelectItem(Sender: TObject; Item: TListItem;
120120
begin
121121
if bLoading then exit;
122122
if lstMap.ItemIndex<0 then exit;
123-
sBmpFile := ChangeFileExt(sG_AppPath+'maps/'+Item.Caption,'.bmp');
123+
sBmpFile := ChangeFileExt(sG_AppPath+'maps'+PathDelim+Item.Caption,'.bmp');
124124
if FileExists(sBmpFile) then begin
125125
bmp := TBitmap.Create;
126126
try

NewGame.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ procedure TfNewGame.cmdOKClick(Sender: TObject);
288288
if Active then begin
289289
inc(iAttivi);
290290
if Computer then begin
291-
if not FileExists(sG_AppPath + 'players/' + PrgFile) then begin
292-
MessageDlg(Name + ':' + sG_AppPath + 'players/' + PrgFile +
291+
if not FileExists(sG_AppPath + 'players' + PathDelim + PrgFile) then begin
292+
MessageDlg(Name + ':' + sG_AppPath + 'players' +PathDelim + PrgFile +
293293
' not found.', mtError, [mbOK], 0);
294294
ModalResult := mrNone;
295295
end;

Sim.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ procedure TfSim.txtGameLogFileCustomDlg(Sender: TObject);
129129
dlgOpenLogFile.DefaultExt := '.sgl';
130130
dlgOpenLogFile.FileName := '*.sgl';
131131
dlgOpenLogFile.Filter := 'TRSim Game Log (*.sgl)|*.sgl';
132-
if dlgOpenLogFile.Execute then begin //TEdisComboDialog)
132+
if dlgOpenLogFile.Execute then begin
133133
if Sender is TEdit then begin
134134
TEdit(Sender).Text := ExtractFileName(dlgOpenLogFile.FileName);
135135
end;
@@ -150,7 +150,7 @@ procedure TfSim.txtCPULogFileCustomDlg(Sender: TObject);
150150
dlgOpenLogFile.DefaultExt := '.scl';
151151
dlgOpenLogFile.FileName := '*.scl';
152152
dlgOpenLogFile.Filter := 'TRSim CPU Log (*.scl)|*.scl';
153-
if dlgOpenLogFile.Execute then begin //TEdisComboDialog)
153+
if dlgOpenLogFile.Execute then begin
154154
if Sender is TEdit then begin
155155
TEdit(Sender).Text := ExtractFileName(dlgOpenLogFile.FileName);
156156
end;
@@ -280,7 +280,7 @@ procedure TfSim.PopulateTRPList;
280280
sTRP: string;
281281
begin
282282
// load program list
283-
if FindFirst(sG_AppPath + 'players/*.trp', faAnyFile, rFileDesc) = 0 then
283+
if FindFirst(sG_AppPath + 'players' + PathDelim + '*.trp', faAnyFile, rFileDesc) = 0 then
284284
begin
285285
repeat
286286
// get TRP name from file system
@@ -303,7 +303,7 @@ procedure TfSim.PopulateMapList;
303303
begin
304304
cboMap.Items.Clear;
305305
// load map list
306-
if FindFirst(sG_AppPath + 'maps/*.trm', faAnyFile, rFileDesc) = 0 then begin
306+
if FindFirst(sG_AppPath + 'maps'+ PathDelim + '*.trm', faAnyFile, rFileDesc) = 0 then begin
307307
repeat
308308
// get TRP name from file system
309309
sMap := lowercase(rFileDesc.Name);

TRSim.compiled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<CONFIG>
33
<Compiler Value="/usr/bin/fpc" Date="1540814642"/>
4-
<Params Value=" -Mdelphi -Scghi -Cg -O1 -g -gl -l -vewnhibq -Fu/home/nathan/TurboRisk/Risk/PascalScript/Source/lib/x86_64-linux -Fu/usr/share/lazarus/2.0.2/components/chmhelp/packages/help/lib/x86_64-linux/gtk2 -Fu/usr/share/lazarus/2.0.2/lcl/units/x86_64-linux/gtk2 -Fu/usr/share/lazarus/2.0.2/lcl/units/x86_64-linux -Fu/usr/share/lazarus/2.0.2/components/lazutils/lib/x86_64-linux -Fu/usr/share/lazarus/2.0.2/packager/units/x86_64-linux -Fu/home/nathan/TurboRisk/Risk/ -o/home/nathan/TurboRisk/Risk/TRSim -dLCL -dLCLgtk2 -dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL TRSim.lpr"/>
4+
<Params Value=" -MDelphi -Scghi -Cg -O1 -g -gl -l -vewnhibq -Fu/home/nathan/TurboRisk/Risk/PascalScript/Source/lib/x86_64-linux -Fu/usr/share/lazarus/2.0.2/components/chmhelp/packages/help/lib/x86_64-linux/gtk2 -Fu/usr/share/lazarus/2.0.2/lcl/units/x86_64-linux/gtk2 -Fu/usr/share/lazarus/2.0.2/lcl/units/x86_64-linux -Fu/usr/share/lazarus/2.0.2/components/lazutils/lib/x86_64-linux -Fu/usr/share/lazarus/2.0.2/packager/units/x86_64-linux -Fu/home/nathan/TurboRisk/Risk/ -o/home/nathan/TurboRisk/Risk/TRSim -dLCL -dLCLgtk2 -dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL TRSim.lpr"/>
55
</CONFIG>

TRSim.lpi

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,35 @@
1717
<i18n>
1818
<EnableI18N LFM="False"/>
1919
</i18n>
20-
<BuildModes Count="1">
20+
<BuildModes Count="2">
2121
<Item1 Name="Default" Default="True"/>
22+
<Item2 Name="win32">
23+
<CompilerOptions>
24+
<Version Value="11"/>
25+
<SearchPaths>
26+
<IncludeFiles Value="$(ProjOutDir)"/>
27+
</SearchPaths>
28+
<Parsing>
29+
<SyntaxOptions>
30+
<SyntaxMode Value="Delphi"/>
31+
</SyntaxOptions>
32+
</Parsing>
33+
<CodeGeneration>
34+
<TargetCPU Value="i386"/>
35+
<TargetOS Value="win32"/>
36+
</CodeGeneration>
37+
<Linking>
38+
<Options>
39+
<Win32>
40+
<GraphicApplication Value="True"/>
41+
</Win32>
42+
</Options>
43+
</Linking>
44+
<Other>
45+
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
46+
</Other>
47+
</CompilerOptions>
48+
</Item2>
2249
</BuildModes>
2350
<PublishOptions>
2451
<Version Value="2"/>
@@ -190,9 +217,12 @@
190217
</ProjectOptions>
191218
<CompilerOptions>
192219
<Version Value="11"/>
220+
<SearchPaths>
221+
<IncludeFiles Value="$(ProjOutDir)"/>
222+
</SearchPaths>
193223
<Parsing>
194224
<SyntaxOptions>
195-
<SyntaxMode Value="delphi"/>
225+
<SyntaxMode Value="Delphi"/>
196226
</SyntaxOptions>
197227
</Parsing>
198228
<Linking>

0 commit comments

Comments
 (0)