hedgewars/uVariables.pas
changeset 9300 e5dafb5843c6
parent 9249 7b8c82785145
child 9367 d7bcadc4c380
equal deleted inserted replaced
9299:d64f80504749 9300:e5dafb5843c6
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uVariables;
    21 unit uVariables;
    22 interface
    22 interface
    23 
    23 
    24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils;
    24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math;
    25 
    25 
    26 var
    26 var
    27 /////// init flags ///////
    27 /////// init flags ///////
    28     cMinScreenWidth    : LongInt;
    28     cMinScreenWidth    : LongInt;
    29     cMinScreenHeight   : LongInt;
    29     cMinScreenHeight   : LongInt;
  2322 procedure preInitModule;
  2322 procedure preInitModule;
  2323 procedure initModule;
  2323 procedure initModule;
  2324 procedure freeModule;
  2324 procedure freeModule;
  2325 
  2325 
  2326 implementation
  2326 implementation
  2327 
  2327 uses strutils;
  2328 
  2328 
  2329 procedure preInitModule;
  2329 procedure preInitModule;
  2330 begin
  2330 begin
  2331     // initialisation flags - they are going to be overwritten by program args
  2331     // initialisation flags - they are going to be overwritten by program args
  2332 
  2332 
  2364     cAudioCodec        := '';
  2364     cAudioCodec        := '';
  2365 {$ENDIF}
  2365 {$ENDIF}
  2366 end;
  2366 end;
  2367 
  2367 
  2368 procedure initModule;
  2368 procedure initModule;
  2369 var s: ShortString;
       
  2370 begin
  2369 begin
  2371     cLocale:= cLocaleFName;
  2370     // TODO: we could just have one cLocale variables and drop strutils
  2372     SplitByChar(cLocale, s, '.');
  2371     cLocale:= ExtractDelimited(0, cLocaleFName, StdWordDelims);
  2373 
  2372 
  2374     cFlattenFlakes      := false;
  2373     cFlattenFlakes      := false;
  2375     cFlattenClouds      := false;
  2374     cFlattenClouds      := false;
  2376     lastVisualGearByUID := nil;
  2375     lastVisualGearByUID := nil;
  2377     lastGearByUID       := nil;
  2376     lastGearByUID       := nil;
  2413     IceColor:= ($44 shl RShift) or ($97 shl GShift) or ($A9 shl BShift) or ($A0 shl AShift);
  2412     IceColor:= ($44 shl RShift) or ($97 shl GShift) or ($A9 shl BShift) or ($A0 shl AShift);
  2414     IceEdgeColor:= ($8A shl RShift) or ($AF shl GShift) or ($B2 shl BShift) or ($FF shl AShift);
  2413     IceEdgeColor:= ($8A shl RShift) or ($AF shl GShift) or ($B2 shl BShift) or ($FF shl AShift);
  2415 
  2414 
  2416     WaterOpacity:= $80;
  2415     WaterOpacity:= $80;
  2417 
  2416 
  2418     cDrownSpeed.QWordValue  := 257698038;       // 0.06
  2417     cDrownSpeed.QWordValue  := 257698038;   // 0.06
  2419     cDrownSpeedf            := 0.06;
  2418     cDrownSpeedf            := 0.06;
  2420     cMaxWindSpeed.QWordValue:= 1073742;     // 0.00025
  2419     cMaxWindSpeed.QWordValue:= 1073742;     // 0.00025
  2421     cWindSpeed.QWordValue   := 0;      // 0.0
  2420     cWindSpeed.QWordValue   := 0;           // 0.0
  2422     cWindSpeedf             := 0.0;
  2421     cWindSpeedf             := 0.0;
  2423     cGravity                := cMaxWindSpeed * 2;
  2422     cGravity                := cMaxWindSpeed * 2;
  2424     cGravityf               := 0.00025 * 2;
  2423     cGravityf               := 0.00025 * 2;
  2425     cDamageModifier         := _1;
  2424     cDamageModifier         := _1;
  2426     TargetPoint             := cTargetPointRef;
  2425     TargetPoint             := cTargetPointRef;
  2535 
  2534 
  2536     LuaGoals:= '';
  2535     LuaGoals:= '';
  2537     cMapName:= '';
  2536     cMapName:= '';
  2538 
  2537 
  2539     LuaTemplateNumber:= 0;
  2538     LuaTemplateNumber:= 0;
  2540 
       
  2541     mobileRecord.getScreenDPI:= @getScreenDPI; //TODO: define external function.
       
  2542     {$IFDEF IPHONEOS}
       
  2543     mobileRecord.PerformRumble:= @AudioServicesPlaySystemSound;
       
  2544     mobileRecord.GameLoading:= @startLoadingIndicator;
       
  2545     mobileRecord.GameLoaded:= @stopLoadingIndicator;
       
  2546     mobileRecord.SaveLoadingEnded:= @saveFinishedSynching;
       
  2547     {$ELSE}
       
  2548     mobileRecord.PerformRumble:= nil;
       
  2549     mobileRecord.GameLoading:= nil;
       
  2550     mobileRecord.GameLoaded:= nil;
       
  2551     mobileRecord.SaveLoadingEnded:= nil;
       
  2552     {$ENDIF}
       
  2553 end;
  2539 end;
  2554 
  2540 
  2555 procedure freeModule;
  2541 procedure freeModule;
  2556 begin
  2542 begin
  2557 end;
  2543 end;