# HG changeset patch # User Wuzzy # Date 1556641504 -7200 # Node ID acb0526bf458449822af7250c0e154d5d562400b # Parent 259840ca77e36ec221dbacde9a3bb4f50c260f57 Refactor decimal separator to make Pas2C happy diff -r 259840ca77e3 -r acb0526bf458 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Apr 30 17:00:23 2019 +0200 +++ b/hedgewars/uGears.pas Tue Apr 30 18:25:04 2019 +0200 @@ -52,7 +52,7 @@ function IsClockRunning() : boolean; implementation -uses SysUtils, uStore, uSound, uTeams, uRandom, uIO, uLandGraphics, +uses uStore, uSound, uTeams, uRandom, uIO, uLandGraphics, {$IFDEF USE_TOUCH_INTERFACE}uTouch,{$ENDIF} uLocale, uAmmos, uStats, uVisualGears, uScript, uVariables, uCommands, uUtils, uTextures, uRenderUtils, uGearsRender, uCaptions, @@ -292,7 +292,7 @@ if j = 0 then curHandledGear^.Tex:= RenderStringTex(ansistring(inttostr(i)), $ff808080, fntSmall) else - curHandledGear^.Tex:= RenderStringTex(ansistring(inttostr(i) + FormatSettings.DecimalSeparator + inttostr(j)), $ff808080, fntSmall); + curHandledGear^.Tex:= RenderStringTex(ansistring(inttostr(i) + lDecimalSeparator + inttostr(j)), $ff808080, fntSmall); end end // Timer of other gears diff -r 259840ca77e3 -r acb0526bf458 hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Tue Apr 30 17:00:23 2019 +0200 +++ b/hedgewars/uLocale.pas Tue Apr 30 18:25:04 2019 +0200 @@ -53,7 +53,7 @@ {$ENDIF} implementation -uses uRandom, uUtils, uVariables, uDebug, uPhysFSLayer; +uses SysUtils, uRandom, uUtils, uVariables, uDebug, uPhysFSLayer; var trevt: array[TEventId] of array [0..Pred(MAX_EVENT_STRINGS)] of ansistring; trevt_n: array[TEventId] of integer; @@ -65,6 +65,11 @@ first: array[TEventId] of boolean; e: TEventId; begin +{- TODO: Add support for localized decimal separator in Pas2C -} +{$IFNDEF PAS2C} +lDecimalSeparator:= FormatSettings.DecimalSeparator; +{$ENDIF} + for e:= Low(TEventId) to High(TEventId) do first[e]:= true; diff -r 259840ca77e3 -r acb0526bf458 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Tue Apr 30 17:00:23 2019 +0200 +++ b/hedgewars/uVariables.pas Tue Apr 30 18:25:04 2019 +0200 @@ -2593,6 +2593,8 @@ aTexCoord: GLint; aColor: GLint; + lDecimalSeparator: Char; + var trammo: array[TAmmoStrId] of ansistring; // name of the weapon trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon trammod: array[TAmmoStrId] of ansistring; // description of the weapon @@ -2817,6 +2819,8 @@ aTexCoord:= 1; aColor:= 2; + lDecimalSeparator := '.'; + cMinMaxZoomLevelDelta:= cMaxZoomLevel - cMinZoomLevel;