hedgewars/uVariables.pas
author unC0Rr
Wed, 17 Nov 2010 17:45:55 +0300
changeset 4359 83ef50815535
child 4361 64ea345ab655
permissions -rw-r--r--
Move variables from uMisc to uVariables
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4359
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     1
{$INCLUDE options.inc}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     2
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     3
unit uVariables;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     4
interface
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     5
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     6
uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uMobile;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     7
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     8
var
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
     9
/////// init flags ///////
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    10
    cScreenWidth    : LongInt     = 1024;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    11
    cScreenHeight   : LongInt     = 768;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    12
    cBits           : LongInt     = 32;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    13
    //ipcPort is in uIO
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    14
    cFullScreen     : boolean     = false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    15
    isSoundEnabled  : boolean     = true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    16
    isMusicEnabled  : boolean     = false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    17
    cLocaleFName    : shortstring = 'en.txt';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    18
    cInitVolume     : LongInt     = 100;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    19
    cTimerInterval  : LongInt     = 8;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    20
    PathPrefix      : shortstring = './';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    21
    cShowFPS        : boolean     = false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    22
    cAltDamage      : boolean     = true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    23
    cReducedQuality : LongWord    = rqNone;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    24
    //userNick is in uChat
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    25
    recordFileName  : shortstring = '';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    26
    cReadyDelay     : Longword    = 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    27
    cLogfileBase    : shortstring = 'debug';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    28
//////////////////////////
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    29
    
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    30
    isCursorVisible : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    31
    isTerminated    : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    32
    isInLag         : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    33
    isPaused        : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    34
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    35
    isSEBackup      : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    36
    isInMultiShoot  : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    37
    isSpeed         : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    38
    isFirstFrame    : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    39
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    40
    fastUntilLag    : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    41
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    42
    GameState       : TGameState;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    43
    GameType        : TGameType;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    44
    GameFlags       : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    45
    TrainingFlags   : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    46
    TurnTimeLeft    : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    47
    ReadyTimeLeft   : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    48
    cSuddenDTurns   : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    49
    cDamagePercent  : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    50
    cMineDudPercent : LongWord;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    51
    cTemplateFilter : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    52
    cMapGen         : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    53
    cMazeSize       : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    54
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    55
    cHedgehogTurnTime: Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    56
    cMinesTime       : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    57
    cMaxAIThinkTime  : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    58
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    59
    cHealthCaseProb  : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    60
    cHealthCaseAmount: LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    61
    cWaterRise       : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    62
    cHealthDecrease  : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    63
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    64
    cCloudsNumber    : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    65
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    66
    cTagsMask        : byte;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    67
    zoom             : GLfloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    68
    ZoomValue        : GLfloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    69
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    70
    cWaterLine       : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    71
    cGearScrEdgesDist: LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    72
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    73
    GameTicks   : LongWord;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    74
    TrainingTimeInc : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    75
    TrainingTimeInD : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    76
    TrainingTimeInM : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    77
    TrainingTimeMax : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    78
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    79
    TimeTrialStartTime: Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    80
    TimeTrialStopTime : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    81
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    82
    // originally from uConsts
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    83
    Pathz: array[TPathType] of shortstring;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    84
    CountTexz: array[1..Pred(AMMO_INFINITE)] of PTexture;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    85
    LAND_WIDTH       : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    86
    LAND_HEIGHT      : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    87
    LAND_WIDTH_MASK  : LongWord;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    88
    LAND_HEIGHT_MASK : LongWord;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    89
    cMaxCaptions     : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    90
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    91
    cLeftScreenBorder     : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    92
    cRightScreenBorder    : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    93
    cScreenSpace          : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    94
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    95
    cCaseFactor     : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    96
    cLandMines      : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    97
    cExplosives     : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    98
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
    99
    cSeed           : shortstring;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   100
    cVolumeDelta    : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   101
    cHasFocus       : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   102
    cInactDelay     : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   103
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   104
    bBetweenTurns   : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   105
    bWaterRising    : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   106
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   107
    ShowCrosshair   : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   108
    CursorMovementX : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   109
    CursorMovementY : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   110
    cDrownSpeed     : hwFloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   111
    cDrownSpeedf    : float;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   112
    cMaxWindSpeed   : hwFloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   113
    cWindSpeed      : hwFloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   114
    cWindSpeedf     : float;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   115
    cGravity        : hwFloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   116
    cGravityf       : float;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   117
    cDamageModifier : hwFloat;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   118
    cLaserSighting  : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   119
    cVampiric       : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   120
    cArtillery      : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   121
    WeaponTooltipTex : PTexture;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   122
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   123
    flagMakeCapture : boolean;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   124
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   125
    InitStepsFlags  : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   126
    RealTicks       : Longword;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   127
    AttackBar       : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   128
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   129
    WaterColorArray : array[0..3] of HwColor4f;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   130
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   131
    CursorPoint     : TPoint;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   132
    TargetPoint     : TPoint;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   133
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   134
    TextureList     : PTexture;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   135
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   136
    ScreenFade      : TScreenFade;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   137
    ScreenFadeValue : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   138
    ScreenFadeSpeed : LongInt;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   139
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   140
{$IFDEF SDL13}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   141
    SDLwindow       : PSDL_Window;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   142
{$ENDIF}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   143
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   144
procedure initModule;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   145
procedure freeModule;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   146
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   147
implementation
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   148
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   149
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   150
procedure initModule;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   151
begin
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   152
    Pathz:= cPathz;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   153
        {*  REFERENCE
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   154
      4096 -> $FFFFF000
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   155
      2048 -> $FFFFF800
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   156
      1024 -> $FFFFFC00
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   157
       512 -> $FFFFFE00  *}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   158
    if (cReducedQuality and rqLowRes) <> 0 then
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   159
    begin
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   160
        LAND_WIDTH:= 2048;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   161
        LAND_HEIGHT:= 1024;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   162
        LAND_WIDTH_MASK:= $FFFFF800;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   163
        LAND_HEIGHT_MASK:= $FFFFFC00;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   164
    end
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   165
    else
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   166
    begin
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   167
        LAND_WIDTH:= 4096;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   168
        LAND_HEIGHT:= 2048;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   169
        LAND_WIDTH_MASK:= $FFFFF000;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   170
        LAND_HEIGHT_MASK:= $FFFFF800
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   171
    end;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   172
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   173
    cDrownSpeed.QWordValue  := 257698038;       // 0.06
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   174
    cDrownSpeedf            := 0.06;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   175
    cMaxWindSpeed.QWordValue:= 1073742;     // 0.00025
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   176
    cWindSpeed.QWordValue   := 429496;      // 0.0001
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   177
    cWindSpeedf             := 0.0001;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   178
    cGravity                := cMaxWindSpeed * 2;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   179
    cGravityf               := 0.00025 * 2;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   180
    cDamageModifier         := _1;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   181
    TargetPoint             := cTargetPointRef;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   182
    TextureList             := nil;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   183
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   184
    // int, longint longword and byte
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   185
    CursorMovementX     := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   186
    CursorMovementY     := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   187
    GameTicks           := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   188
    TrainingTimeInc     := 10000;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   189
    TrainingTimeInD     := 500;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   190
    TrainingTimeInM     := 5000;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   191
    TrainingTimeMax     := 60000;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   192
    TimeTrialStartTime  := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   193
    TimeTrialStopTime   := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   194
    cWaterLine          := LAND_HEIGHT;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   195
    cGearScrEdgesDist   := 240;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   196
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   197
    GameFlags           := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   198
    TrainingFlags       := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   199
    TurnTimeLeft        := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   200
    cSuddenDTurns       := 15;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   201
    cDamagePercent      := 100;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   202
    cMineDudPercent     := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   203
    cTemplateFilter     := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   204
    cMapGen             := 0;   // MAPGEN_REGULAR
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   205
    cMazeSize           := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   206
    cHedgehogTurnTime   := 45000;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   207
    cMinesTime          := 3;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   208
    cMaxAIThinkTime     := 9000;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   209
    cCloudsNumber       := 9;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   210
    cHealthCaseProb     := 35;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   211
    cHealthCaseAmount   := 25;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   212
    cWaterRise          := 47;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   213
    cHealthDecrease     := 5;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   214
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   215
    cTagsMask       := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   216
    InitStepsFlags  := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   217
    RealTicks       := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   218
    AttackBar       := 0; // 0 - none, 1 - just bar at the right-down corner, 2 - from weapon
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   219
    cCaseFactor     := 5;  {0..9}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   220
    cLandMines      := 4;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   221
    cExplosives     := 2;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   222
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   223
    GameState       := Low(TGameState);
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   224
    GameType        := gmtLocal;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   225
    zoom            := cDefaultZoomLevel;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   226
    ZoomValue       := cDefaultZoomLevel;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   227
    WeaponTooltipTex:= nil;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   228
    cLaserSighting  := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   229
    cVampiric       := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   230
    cArtillery      := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   231
    flagMakeCapture := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   232
    bBetweenTurns   := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   233
    bWaterRising    := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   234
    isCursorVisible := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   235
    isTerminated    := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   236
    isInLag         := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   237
    isPaused        := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   238
    isInMultiShoot  := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   239
    isSpeed         := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   240
    fastUntilLag    := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   241
    isFirstFrame    := true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   242
    isSEBackup      := true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   243
    cSeed           := '';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   244
    cVolumeDelta    := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   245
    cHasFocus       := true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   246
    cInactDelay     := 1250;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   247
    ReadyTimeLeft   := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   248
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   249
    ScreenFade      := sfNone;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   250
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   251
{$IFDEF SDL13}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   252
    SDLwindow       := nil;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   253
{$ENDIF}
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   254
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   255
    // those values still aren't perfect
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   256
    cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   257
    cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   258
    cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   259
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   260
    if isPhone() then
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   261
        cMaxCaptions:= 3
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   262
    else
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   263
        cMaxCaptions:= 4;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   264
end;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   265
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   266
procedure freeModule;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   267
begin
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   268
    // re-init flags so they will always contain safe values
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   269
    cScreenWidth    := 1024;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   270
    cScreenHeight   := 768;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   271
    cBits           := 32;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   272
    //ipcPort is in uIO
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   273
    cFullScreen     := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   274
    isSoundEnabled  := true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   275
    isMusicEnabled  := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   276
    cLocaleFName    := 'en.txt';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   277
    cInitVolume     := 100;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   278
    cTimerInterval  := 8;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   279
    PathPrefix := './';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   280
    cShowFPS        := false;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   281
    cAltDamage      := true;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   282
    cReducedQuality := rqNone;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   283
    //userNick is in uChat
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   284
    recordFileName  := '';
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   285
    cReadyDelay     := 0;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   286
end;
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   287
83ef50815535 Move variables from uMisc to uVariables
unC0Rr
parents:
diff changeset
   288
end.