# HG changeset patch # User sheepluva # Date 1461924679 -7200 # Node ID 68f26b6a3a7d97efaead1da83a1218c2631b7491 # Parent 8b17caab10ecd878460a68d1b80fc16b7881b57e move function diff -r 8b17caab10ec -r 68f26b6a3a7d hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Fri Apr 29 00:56:04 2016 +0200 +++ b/hedgewars/hwengine.pas Fri Apr 29 12:11:19 2016 +0200 @@ -52,20 +52,6 @@ procedure freeEverything(complete:boolean); forward; {$ENDIF} -function read1stLn(filePath: shortstring): shortstring; -var f: pfsFile; -begin - read1stLn:= ''; - if pfsExists(filePath) then - begin - f:= pfsOpenRead(filePath); - if (not pfsEOF(f)) and allOK then - pfsReadLn(f, read1stLn); - pfsClose(f); - f:= nil; - end; -end; - // TODO localization support procedure ShowCredits(); var themeCredits, mapCredits: shortstring; diff -r 8b17caab10ec -r 68f26b6a3a7d hedgewars/uUtils.pas --- a/hedgewars/uUtils.pas Fri Apr 29 00:56:04 2016 +0200 +++ b/hedgewars/uUtils.pas Fri Apr 29 12:11:19 2016 +0200 @@ -70,6 +70,8 @@ function GetLaunchX(at: TAmmoType; dir: LongInt; angle: LongInt): LongInt; function GetLaunchY(at: TAmmoType; angle: LongInt): LongInt; +function read1stLn(filePath: shortstring): shortstring; + {$IFNDEF PAS2C} procedure Write(var f: textfile; s: shortstring); procedure WriteLn(var f: textfile; s: shortstring); @@ -95,7 +97,7 @@ implementation -uses {$IFNDEF PAS2C}typinfo, {$ENDIF}Math, uConsts, uVariables, SysUtils, uPhysFSLayer; +uses {$IFNDEF PAS2C}typinfo, {$ENDIF}Math, uConsts, uVariables, SysUtils, uPhysFSLayer, uDebug; {$IFDEF DEBUGFILE} var logFile: PFSFile; @@ -511,6 +513,20 @@ sanitizeCharForLog:= r end; +function read1stLn(filePath: shortstring): shortstring; +var f: pfsFile; +begin + read1stLn:= ''; + if pfsExists(filePath) then + begin + f:= pfsOpenRead(filePath); + if (not pfsEOF(f)) and allOK then + pfsReadLn(f, read1stLn); + pfsClose(f); + f:= nil; + end; +end; + procedure initModule(isNotPreview: boolean); {$IFDEF DEBUGFILE} var logfileBase: shortstring;