uvariables comes before uutils
authorkoda
Sat, 29 Jun 2013 01:56:16 +0200
changeset 9300 e5dafb5843c6
parent 9299 d64f80504749
child 9301 c5d1c8259ef4
uvariables comes before uutils
hedgewars/CMakeLists.txt
hedgewars/uUtils.pas
hedgewars/uVariables.pas
--- a/hedgewars/CMakeLists.txt	Sat Jun 29 01:26:05 2013 +0200
+++ b/hedgewars/CMakeLists.txt	Sat Jun 29 01:56:16 2013 +0200
@@ -20,8 +20,8 @@
     uConsts.pas
     LuaPas.pas
     uTypes.pas
+    uVariables.pas
     uUtils.pas
-    uVariables.pas
     uMisc.pas
     uConsole.pas
     uDebug.pas
--- a/hedgewars/uUtils.pas	Sat Jun 29 01:26:05 2013 +0200
+++ b/hedgewars/uUtils.pas	Sat Jun 29 01:56:16 2013 +0200
@@ -505,6 +505,20 @@
 {$I+}
 {$ENDIF}
 
+    //mobile stuff
+    mobileRecord.getScreenDPI:= @getScreenDPI; //TODO: define external function.
+{$IFDEF IPHONEOS}
+    mobileRecord.PerformRumble:= @AudioServicesPlaySystemSound;
+    mobileRecord.GameLoading:= @startLoadingIndicator;
+    mobileRecord.GameLoaded:= @stopLoadingIndicator;
+    mobileRecord.SaveLoadingEnded:= @saveFinishedSynching;
+{$ELSE}
+    mobileRecord.PerformRumble:= nil;
+    mobileRecord.GameLoading:= nil;
+    mobileRecord.GameLoaded:= nil;
+    mobileRecord.SaveLoadingEnded:= nil;
+{$ENDIF}
+
 end;
 
 procedure freeModule;
--- a/hedgewars/uVariables.pas	Sat Jun 29 01:26:05 2013 +0200
+++ b/hedgewars/uVariables.pas	Sat Jun 29 01:56:16 2013 +0200
@@ -21,7 +21,7 @@
 unit uVariables;
 interface
 
-uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils;
+uses SDLh, uTypes, uFloat, GLunit, uConsts, Math;
 
 var
 /////// init flags ///////
@@ -2324,7 +2324,7 @@
 procedure freeModule;
 
 implementation
-
+uses strutils;
 
 procedure preInitModule;
 begin
@@ -2366,10 +2366,9 @@
 end;
 
 procedure initModule;
-var s: ShortString;
 begin
-    cLocale:= cLocaleFName;
-    SplitByChar(cLocale, s, '.');
+    // TODO: we could just have one cLocale variables and drop strutils
+    cLocale:= ExtractDelimited(0, cLocaleFName, StdWordDelims);
 
     cFlattenFlakes      := false;
     cFlattenClouds      := false;
@@ -2415,10 +2414,10 @@
 
     WaterOpacity:= $80;
 
-    cDrownSpeed.QWordValue  := 257698038;       // 0.06
+    cDrownSpeed.QWordValue  := 257698038;   // 0.06
     cDrownSpeedf            := 0.06;
     cMaxWindSpeed.QWordValue:= 1073742;     // 0.00025
-    cWindSpeed.QWordValue   := 0;      // 0.0
+    cWindSpeed.QWordValue   := 0;           // 0.0
     cWindSpeedf             := 0.0;
     cGravity                := cMaxWindSpeed * 2;
     cGravityf               := 0.00025 * 2;
@@ -2537,19 +2536,6 @@
     cMapName:= '';
 
     LuaTemplateNumber:= 0;
-
-    mobileRecord.getScreenDPI:= @getScreenDPI; //TODO: define external function.
-    {$IFDEF IPHONEOS}
-    mobileRecord.PerformRumble:= @AudioServicesPlaySystemSound;
-    mobileRecord.GameLoading:= @startLoadingIndicator;
-    mobileRecord.GameLoaded:= @stopLoadingIndicator;
-    mobileRecord.SaveLoadingEnded:= @saveFinishedSynching;
-    {$ELSE}
-    mobileRecord.PerformRumble:= nil;
-    mobileRecord.GameLoading:= nil;
-    mobileRecord.GameLoaded:= nil;
-    mobileRecord.SaveLoadingEnded:= nil;
-    {$ENDIF}
 end;
 
 procedure freeModule;