hedgewars/uVariables.pas
branchwebgl
changeset 8330 aaefa587e277
parent 8096 453917e94e55
parent 8309 edcfb5e43245
child 8444 75db7bb8dce8
equal deleted inserted replaced
8116:d24257910f8d 8330:aaefa587e277
    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, uMobile, uUtils, uMatrix;
    24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils, uMatrix;
    25 
    25 
    26 var
    26 var
    27 /////// init flags ///////
    27 /////// init flags ///////
    28     cMinScreenWidth    : LongInt;
    28     cMinScreenWidth    : LongInt;
    29     cMinScreenHeight   : LongInt;
    29     cMinScreenHeight   : LongInt;
    32     cOrigScreenWidth   : LongInt;
    32     cOrigScreenWidth   : LongInt;
    33     cOrigScreenHeight  : LongInt;
    33     cOrigScreenHeight  : LongInt;
    34     cNewScreenWidth    : LongInt;
    34     cNewScreenWidth    : LongInt;
    35     cNewScreenHeight   : LongInt;
    35     cNewScreenHeight   : LongInt;
    36     cScreenResizeDelay : LongWord;
    36     cScreenResizeDelay : LongWord;
    37     cBits              : LongInt;
       
    38     ipcPort            : Word;
    37     ipcPort            : Word;
    39     cFullScreen        : boolean;
    38     cFullScreen        : boolean;
    40     cLocaleFName       : shortstring;
    39     cLocaleFName       : shortstring;
    41     cLocale            : shortstring;
    40     cLocale            : shortstring;
    42     cTimerInterval     : LongInt;
    41     cTimerInterval     : LongInt;
   155     cDamageModifier : hwFloat;
   154     cDamageModifier : hwFloat;
   156     cLaserSighting  : boolean;
   155     cLaserSighting  : boolean;
   157     cVampiric       : boolean;
   156     cVampiric       : boolean;
   158     cArtillery      : boolean;
   157     cArtillery      : boolean;
   159     WeaponTooltipTex: PTexture;
   158     WeaponTooltipTex: PTexture;
   160     AmmoMenuTex     : PTexture;
       
   161     AmmoMenuInvalidated: boolean;
   159     AmmoMenuInvalidated: boolean;
   162     AmmoRect		: TSDL_Rect;
   160     AmmoRect        : TSDL_Rect;
   163     HHTexture       : PTexture;
   161     HHTexture       : PTexture;
   164     cMaxZoomLevel   : real;
   162     cMaxZoomLevel   : real;
   165     cMinZoomLevel   : real;
   163     cMinZoomLevel   : real;
   166     cZoomDelta      : real;
   164     cZoomDelta      : real;
   167     cMinMaxZoomLevelDelta : real;
   165     cMinMaxZoomLevelDelta : real;
   194 
   192 
   195     LuaGoals        : shortstring;
   193     LuaGoals        : shortstring;
   196 
   194 
   197     LuaTemplateNumber : LongInt; {org: LongWord}
   195     LuaTemplateNumber : LongInt; {org: LongWord}
   198 
   196 
   199     VoiceList : array[0..7] of TVoice =  (
       
   200                     ( snd: sndNone; voicepack: nil),
       
   201                     ( snd: sndNone; voicepack: nil),
       
   202                     ( snd: sndNone; voicepack: nil),
       
   203                     ( snd: sndNone; voicepack: nil),
       
   204                     ( snd: sndNone; voicepack: nil),
       
   205                     ( snd: sndNone; voicepack: nil),
       
   206                     ( snd: sndNone; voicepack: nil),
       
   207                     ( snd: sndNone; voicepack: nil));
       
   208     LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
   197     LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
       
   198 
       
   199     mobileRecord: TMobileRecord;
   209 
   200 
   210 /////////////////////////////////////
   201 /////////////////////////////////////
   211 //Buttons
   202 //Buttons
   212 {$IFDEF USE_TOUCH_INTERFACE}
   203 {$IFDEF USE_TOUCH_INTERFACE}
   213     buttonScale: GLFloat;
   204     buttonScale: GLFloat;
   690             (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0),
   681             (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0),
   691             (Sprite:    sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0),
   682             (Sprite:    sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0),
   692             (Sprite:   sprJuggle; FramesCount: 49; Interval:  38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0)
   683             (Sprite:   sprJuggle; FramesCount: 49; Interval:  38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0)
   693             );
   684             );
   694 
   685 
   695     Soundz: array[TSound] of record
       
   696             FileName: string[31];
       
   697             Path    : TPathType;
       
   698             end = (
       
   699             (FileName:                         ''; Path: ptNone  ),// sndNone
       
   700             (FileName:        'grenadeimpact.ogg'; Path: ptSounds),// sndGrenadeImpact
       
   701             (FileName:            'explosion.ogg'; Path: ptSounds),// sndExplosion
       
   702             (FileName:         'throwpowerup.ogg'; Path: ptSounds),// sndThrowPowerUp
       
   703             (FileName:         'throwrelease.ogg'; Path: ptSounds),// sndThrowRelease
       
   704             (FileName:               'splash.ogg'; Path: ptSounds),// sndSplash
       
   705             (FileName:        'shotgunreload.ogg'; Path: ptSounds),// sndShotgunReload
       
   706             (FileName:          'shotgunfire.ogg'; Path: ptSounds),// sndShotgunFire
       
   707             (FileName:          'graveimpact.ogg'; Path: ptSounds),// sndGraveImpact
       
   708             (FileName:           'mineimpact.ogg'; Path: ptSounds),// sndMineImpact
       
   709             (FileName:             'minetick.ogg'; Path: ptSounds),// sndMineTicks
       
   710             (FileName:             'Droplet1.ogg'; Path: ptSounds),// sndMudballImpact
       
   711             (FileName:           'pickhammer.ogg'; Path: ptSounds),// sndPickhammer
       
   712             (FileName:                  'gun.ogg'; Path: ptSounds),// sndGun
       
   713             (FileName:                  'bee.ogg'; Path: ptSounds),// sndBee
       
   714             (FileName:                'Jump1.ogg'; Path: ptVoices),// sndJump1
       
   715             (FileName:                'Jump2.ogg'; Path: ptVoices),// sndJump2
       
   716             (FileName:                'Jump3.ogg'; Path: ptVoices),// sndJump3
       
   717             (FileName:               'Yessir.ogg'; Path: ptVoices),// sndYesSir
       
   718             (FileName:                'Laugh.ogg'; Path: ptVoices),// sndLaugh
       
   719             (FileName:            'Illgetyou.ogg'; Path: ptVoices),// sndIllGetYou
       
   720             (FileName:          'JustYouWait.ogg'; Path: ptVoices),// sndJustYouWait
       
   721             (FileName:             'Incoming.ogg'; Path: ptVoices),// sndIncoming
       
   722             (FileName:               'Missed.ogg'; Path: ptVoices),// sndMissed
       
   723             (FileName:               'Stupid.ogg'; Path: ptVoices),// sndStupid
       
   724             (FileName:           'Firstblood.ogg'; Path: ptVoices),// sndFirstBlood
       
   725             (FileName:               'Boring.ogg'; Path: ptVoices),// sndBoring
       
   726             (FileName:               'Byebye.ogg'; Path: ptVoices),// sndByeBye
       
   727             (FileName:             'Sameteam.ogg'; Path: ptVoices),// sndSameTeam
       
   728             (FileName:               'Nutter.ogg'; Path: ptVoices),// sndNutter
       
   729             (FileName:       'Reinforcements.ogg'; Path: ptVoices),// sndReinforce
       
   730             (FileName:              'Traitor.ogg'; Path: ptVoices),// sndTraitor
       
   731             (FileName:      'Youllregretthat.ogg'; Path: ptVoices),// sndRegret
       
   732             (FileName:            'Enemydown.ogg'; Path: ptVoices),// sndEnemyDown
       
   733             (FileName:               'Coward.ogg'; Path: ptVoices),// sndCoward
       
   734             (FileName:                'Hurry.ogg'; Path: ptVoices),// sndHurry
       
   735             (FileName:              'Watchit.ogg'; Path: ptVoices),// sndWatchIt
       
   736             (FileName:             'Kamikaze.ogg'; Path: ptVoices),// sndKamikaze
       
   737             (FileName:                'cake2.ogg'; Path: ptSounds),// sndCake
       
   738             (FileName:                  'Ow1.ogg'; Path: ptVoices),// sndOw1
       
   739             (FileName:                  'Ow2.ogg'; Path: ptVoices),// sndOw2
       
   740             (FileName:                  'Ow3.ogg'; Path: ptVoices),// sndOw3
       
   741             (FileName:                  'Ow4.ogg'; Path: ptVoices),// sndOw4
       
   742             (FileName:           'Firepunch1.ogg'; Path: ptVoices),// sndFirepunch1
       
   743             (FileName:           'Firepunch2.ogg'; Path: ptVoices),// sndFirepunch2
       
   744             (FileName:           'Firepunch3.ogg'; Path: ptVoices),// sndFirepunch3
       
   745             (FileName:           'Firepunch4.ogg'; Path: ptVoices),// sndFirepunch4
       
   746             (FileName:           'Firepunch5.ogg'; Path: ptVoices),// sndFirepunch5
       
   747             (FileName:           'Firepunch6.ogg'; Path: ptVoices),// sndFirepunch6
       
   748             (FileName:                'Melon.ogg'; Path: ptVoices),// sndMelon
       
   749             (FileName:              'Hellish.ogg'; Path: ptSounds),// sndHellish
       
   750             (FileName:               'Yoohoo.ogg'; Path: ptSounds),// sndYoohoo
       
   751             (FileName:              'rcplane.ogg'; Path: ptSounds),// sndRCPlane
       
   752             (FileName:            'whipcrack.ogg'; Path: ptSounds),// sndWhipCrack
       
   753             (FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds),// sndRideOfTheValkyries
       
   754             (FileName:               'denied.ogg'; Path: ptSounds),// sndDenied
       
   755             (FileName:               'placed.ogg'; Path: ptSounds),// sndPlaced
       
   756             (FileName:          'baseballbat.ogg'; Path: ptSounds),// sndBaseballBat
       
   757             (FileName:                'steam.ogg'; Path: ptSounds),// sndVaporize
       
   758             (FileName:                 'warp.ogg'; Path: ptSounds),// sndWarp
       
   759             (FileName:          'suddendeath.ogg'; Path: ptSounds),// sndSuddenDeath
       
   760             (FileName:               'mortar.ogg'; Path: ptSounds),// sndMortar
       
   761             (FileName:         'shutterclick.ogg'; Path: ptSounds),// sndShutter
       
   762             (FileName:              'homerun.ogg'; Path: ptSounds),// sndHomerun
       
   763             (FileName:              'molotov.ogg'; Path: ptSounds),// sndMolotov
       
   764             (FileName:            'Takecover.ogg'; Path: ptVoices),// sndCover
       
   765             (FileName:                'Uh-oh.ogg'; Path: ptVoices),// sndUhOh
       
   766             (FileName:                 'Oops.ogg'; Path: ptVoices),// sndOops
       
   767             (FileName:                 'Nooo.ogg'; Path: ptVoices),// sndNooo
       
   768             (FileName:                'Hello.ogg'; Path: ptVoices),// sndHello
       
   769             (FileName:             'ropeshot.ogg'; Path: ptSounds),// sndRopeShot
       
   770             (FileName:           'ropeattach.ogg'; Path: ptSounds),// sndRopeAttach
       
   771             (FileName:          'roperelease.ogg'; Path: ptSounds),// sndRopeRelease
       
   772             (FileName:            'switchhog.ogg'; Path: ptSounds),// sndSwitchHog
       
   773             (FileName:              'Victory.ogg'; Path: ptVoices),// sndVictory
       
   774             (FileName:             'Flawless.ogg'; Path: ptVoices),// sndFlawless
       
   775             (FileName:         'sniperreload.ogg'; Path: ptSounds),// sndSniperReload
       
   776             (FileName:                'steps.ogg'; Path: ptSounds),// sndSteps
       
   777             (FileName:           'lowgravity.ogg'; Path: ptSounds),// sndLowGravity
       
   778             (FileName:           'hell_growl.ogg'; Path: ptSounds),// sndHellishImpact1
       
   779             (FileName:            'hell_ooff.ogg'; Path: ptSounds),// sndHellishImpact2
       
   780             (FileName:              'hell_ow.ogg'; Path: ptSounds),// sndHellishImpact3
       
   781             (FileName:             'hell_ugh.ogg'; Path: ptSounds),// sndHellishImpact4
       
   782             (FileName:          'melonimpact.ogg'; Path: ptSounds),// sndMelonImpact
       
   783             (FileName:             'Droplet1.ogg'; Path: ptSounds),// sndDroplet1
       
   784             (FileName:             'Droplet2.ogg'; Path: ptSounds),// sndDroplet2
       
   785             (FileName:             'Droplet3.ogg'; Path: ptSounds),// sndDroplet3
       
   786             (FileName:                  'egg.ogg'; Path: ptSounds),// sndEggBreak
       
   787             (FileName:             'drillgun.ogg'; Path: ptSounds),// sndDrillRocket
       
   788             (FileName:          'PoisonCough.ogg'; Path: ptVoices),// sndPoisonCough
       
   789             (FileName:           'PoisonMoan.ogg'; Path: ptVoices),// sndPoisonMoan
       
   790             (FileName:             'BirdyLay.ogg'; Path: ptSounds),// sndBirdyLay
       
   791             (FileName:              'Whistle.ogg'; Path: ptSounds),// sndWhistle
       
   792             (FileName:             'beewater.ogg'; Path: ptSounds),// sndBeeWater
       
   793             (FileName:                   '1C.ogg'; Path: ptSounds),// sndPiano0
       
   794             (FileName:                   '2D.ogg'; Path: ptSounds),// sndPiano1
       
   795             (FileName:                   '3E.ogg'; Path: ptSounds),// sndPiano2
       
   796             (FileName:                   '4F.ogg'; Path: ptSounds),// sndPiano3
       
   797             (FileName:                   '5G.ogg'; Path: ptSounds),// sndPiano4
       
   798             (FileName:                   '6A.ogg'; Path: ptSounds),// sndPiano5
       
   799             (FileName:                   '7B.ogg'; Path: ptSounds),// sndPiano6
       
   800             (FileName:                   '8C.ogg'; Path: ptSounds),// sndPiano7
       
   801             (FileName:                   '9D.ogg'; Path: ptSounds),// sndPiano8
       
   802             (FileName:                 'skip.ogg'; Path: ptSounds),// sndSkip
       
   803             (FileName:              'sinegun.ogg'; Path: ptSounds),// sndSineGun
       
   804             (FileName:                'Ooff1.ogg'; Path: ptVoices),// sndOoff1
       
   805             (FileName:                'Ooff2.ogg'; Path: ptVoices),// sndOoff2
       
   806             (FileName:                'Ooff3.ogg'; Path: ptVoices),// sndOoff3
       
   807             (FileName:               'hammer.ogg'; Path: ptSounds),// sndWhack
       
   808             (FileName:           'Comeonthen.ogg'; Path: ptVoices),// sndComeonthen
       
   809             (FileName:            'parachute.ogg'; Path: ptSounds),// sndParachute
       
   810             (FileName:                 'bump.ogg'; Path: ptSounds),// sndBump
       
   811             (FileName:            'hogchant3.ogg'; Path: ptSounds),// sndResurrector
       
   812             (FileName:                'plane.ogg'; Path: ptSounds),// sndPlane
       
   813             (FileName:               'TARDIS.ogg'; Path: ptSounds) // sndTardis
       
   814             );
       
   815 var
   686 var
   816     Ammoz: array [TAmmoType] of record
   687     Ammoz: array [TAmmoType] of record
   817             NameId: TAmmoStrId;
   688             NameId: TAmmoStrId;
   818             NameTex: PTexture;
   689             NameTex: PTexture;
   819             Probability, NumberInCase: Longword;
   690             Probability, NumberInCase: Longword;
   853 // Grenade
   724 // Grenade
   854             (NameId: sidGrenade;
   725             (NameId: sidGrenade;
   855             NameTex: nil;
   726             NameTex: nil;
   856             Probability: 0;
   727             Probability: 0;
   857             NumberInCase: 1;
   728             NumberInCase: 1;
   858             Ammo: (Propz: ammoprop_Timerable or 
   729             Ammo: (Propz: ammoprop_Timerable or
   859                           ammoprop_Power or 
   730                           ammoprop_Power or
   860                           ammoprop_AltUse or 
   731                           ammoprop_AltUse or
   861                           ammoprop_SetBounce or
   732                           ammoprop_SetBounce or
   862                           ammoprop_NeedUpDown;
   733                           ammoprop_NeedUpDown;
   863                 Count: AMMO_INFINITE;
   734                 Count: AMMO_INFINITE;
   864                 NumPerTurn: 0;
   735                 NumPerTurn: 0;
   865                 Timer: 3000;
   736                 Timer: 3000;
   881 // ClusterBomb
   752 // ClusterBomb
   882             (NameId: sidClusterBomb;
   753             (NameId: sidClusterBomb;
   883             NameTex: nil;
   754             NameTex: nil;
   884             Probability: 100;
   755             Probability: 100;
   885             NumberInCase: 3;
   756             NumberInCase: 3;
   886             Ammo: (Propz: ammoprop_Timerable or 
   757             Ammo: (Propz: ammoprop_Timerable or
   887                           ammoprop_Power or 
   758                           ammoprop_Power or
   888                           ammoprop_AltUse or 
   759                           ammoprop_AltUse or
   889                           ammoprop_SetBounce or
   760                           ammoprop_SetBounce or
   890                           ammoprop_NeedUpDown;
   761                           ammoprop_NeedUpDown;
   891                 Count: 5;
   762                 Count: 5;
   892                 NumPerTurn: 0;
   763                 NumPerTurn: 0;
   893                 Timer: 3000;
   764                 Timer: 3000;
   909 // Bazooka
   780 // Bazooka
   910             (NameId: sidBazooka;
   781             (NameId: sidBazooka;
   911             NameTex: nil;
   782             NameTex: nil;
   912             Probability: 0;
   783             Probability: 0;
   913             NumberInCase: 1;
   784             NumberInCase: 1;
   914             Ammo: (Propz: ammoprop_Power or 
   785             Ammo: (Propz: ammoprop_Power or
   915                           ammoprop_AltUse or
   786                           ammoprop_AltUse or
   916                           ammoprop_NeedUpDown;
   787                           ammoprop_NeedUpDown;
   917                 Count: AMMO_INFINITE;
   788                 Count: AMMO_INFINITE;
   918                 NumPerTurn: 0;
   789                 NumPerTurn: 0;
   919                 Timer: 0;
   790                 Timer: 0;
   935 // Bee
   806 // Bee
   936             (NameId: sidBee;
   807             (NameId: sidBee;
   937             NameTex: nil;
   808             NameTex: nil;
   938             Probability: 100;
   809             Probability: 100;
   939             NumberInCase: 1;
   810             NumberInCase: 1;
   940             Ammo: (Propz: ammoprop_Power or 
   811             Ammo: (Propz: ammoprop_Power or
   941                           ammoprop_NeedTarget or 
   812                           ammoprop_NeedTarget or
   942                           ammoprop_DontHold or
   813                           ammoprop_DontHold or
   943                           ammoprop_NeedUpDown;
   814                           ammoprop_NeedUpDown;
   944                 Count: 2;
   815                 Count: 2;
   945                 NumPerTurn: 0;
   816                 NumPerTurn: 0;
   946                 Timer: 0;
   817                 Timer: 0;
   987 // PickHammer
   858 // PickHammer
   988             (NameId: sidPickHammer;
   859             (NameId: sidPickHammer;
   989             NameTex: nil;
   860             NameTex: nil;
   990             Probability: 0;
   861             Probability: 0;
   991             NumberInCase: 1;
   862             NumberInCase: 1;
   992             Ammo: (Propz: ammoprop_ForwMsgs or 
   863             Ammo: (Propz: ammoprop_ForwMsgs or
   993                           ammoprop_AttackInMove or 
   864                           ammoprop_AttackInMove or
   994                           ammoprop_NoCrosshair or 
   865                           ammoprop_NoCrosshair or
   995                           ammoprop_DontHold;
   866                           ammoprop_DontHold;
   996                 Count: 2;
   867                 Count: 2;
   997                 NumPerTurn: 0;
   868                 NumPerTurn: 0;
   998                 Timer: 0;
   869                 Timer: 0;
   999                 Pos: 0;
   870                 Pos: 0;
  1014 // Skip
   885 // Skip
  1015             (NameId: sidSkip;
   886             (NameId: sidSkip;
  1016             NameTex: nil;
   887             NameTex: nil;
  1017             Probability: 0;
   888             Probability: 0;
  1018             NumberInCase: 1;
   889             NumberInCase: 1;
  1019             Ammo: (Propz: ammoprop_NoCrosshair or 
   890             Ammo: (Propz: ammoprop_NoCrosshair or
  1020                           ammoprop_DontHold;
   891                           ammoprop_DontHold;
  1021                 Count: AMMO_INFINITE;
   892                 Count: AMMO_INFINITE;
  1022                 NumPerTurn: 0;
   893                 NumPerTurn: 0;
  1023                 Timer: 0;
   894                 Timer: 0;
  1024                 Pos: 0;
   895                 Pos: 0;
  1068 // Mine
   939 // Mine
  1069             (NameId: sidMine;
   940             (NameId: sidMine;
  1070             NameTex: nil;
   941             NameTex: nil;
  1071             Probability: 100;
   942             Probability: 100;
  1072             NumberInCase: 1;
   943             NumberInCase: 1;
  1073             Ammo: (Propz: ammoprop_NoCrosshair or 
   944             Ammo: (Propz: ammoprop_NoCrosshair or
  1074                           ammoprop_AttackInMove or 
   945                           ammoprop_AttackInMove or
  1075                           ammoprop_DontHold or 
   946                           ammoprop_DontHold or
  1076                           ammoprop_AltUse or 
   947                           ammoprop_AltUse or
  1077                           ammoprop_SetBounce;
   948                           ammoprop_SetBounce;
  1078                 Count: 2;
   949                 Count: 2;
  1079                 NumPerTurn: 0;
   950                 NumPerTurn: 0;
  1080                 Timer: 0;
   951                 Timer: 0;
  1081                 Pos: 0;
   952                 Pos: 0;
  1120 // Dynamite
   991 // Dynamite
  1121             (NameId: sidDynamite;
   992             (NameId: sidDynamite;
  1122             NameTex: nil;
   993             NameTex: nil;
  1123             Probability: 100;
   994             Probability: 100;
  1124             NumberInCase: 1;
   995             NumberInCase: 1;
  1125             Ammo: (Propz: ammoprop_NoCrosshair or 
   996             Ammo: (Propz: ammoprop_NoCrosshair or
  1126                           ammoprop_AttackInMove or 
   997                           ammoprop_AttackInMove or
  1127                           ammoprop_DontHold or 
   998                           ammoprop_DontHold or
  1128                           ammoprop_AltUse;
   999                           ammoprop_AltUse;
  1129                 Count: 1;
  1000                 Count: 1;
  1130                 NumPerTurn: 0;
  1001                 NumPerTurn: 0;
  1131                 Timer: 0;
  1002                 Timer: 0;
  1132                 Pos: 0;
  1003                 Pos: 0;
  1147 // FirePunch
  1018 // FirePunch
  1148             (NameId: sidFirePunch;
  1019             (NameId: sidFirePunch;
  1149             NameTex: nil;
  1020             NameTex: nil;
  1150             Probability: 0;
  1021             Probability: 0;
  1151             NumberInCase: 1;
  1022             NumberInCase: 1;
  1152             Ammo: (Propz: ammoprop_NoCrosshair or 
  1023             Ammo: (Propz: ammoprop_NoCrosshair or
  1153                           ammoprop_ForwMsgs or 
  1024                           ammoprop_ForwMsgs or
  1154                           ammoprop_AttackInMove;
  1025                           ammoprop_AttackInMove;
  1155                 Count: AMMO_INFINITE;
  1026                 Count: AMMO_INFINITE;
  1156                 NumPerTurn: 0;
  1027                 NumPerTurn: 0;
  1157                 Timer: 0;
  1028                 Timer: 0;
  1158                 Pos: 0;
  1029                 Pos: 0;
  1443 // Kamikaze
  1314 // Kamikaze
  1444             (NameId: sidKamikaze;
  1315             (NameId: sidKamikaze;
  1445             NameTex: nil;
  1316             NameTex: nil;
  1446             Probability: 100;
  1317             Probability: 100;
  1447             NumberInCase: 1;
  1318             NumberInCase: 1;
  1448             Ammo: (Propz: ammoprop_ForwMsgs or 
  1319             Ammo: (Propz: ammoprop_ForwMsgs or
  1449                           ammoprop_DontHold or 
  1320                           ammoprop_DontHold or
  1450                           ammoprop_NeedUpDown or
  1321                           ammoprop_NeedUpDown or
  1451                           ammoprop_AttackInMove;
  1322                           ammoprop_AttackInMove;
  1452                 Count: 1;
  1323                 Count: 1;
  1453                 NumPerTurn: 0;
  1324                 NumPerTurn: 0;
  1454                 Timer: 0;
  1325                 Timer: 0;
  1470 // Cake
  1341 // Cake
  1471             (NameId: sidCake;
  1342             (NameId: sidCake;
  1472             NameTex: nil;
  1343             NameTex: nil;
  1473             Probability: 100;
  1344             Probability: 100;
  1474             NumberInCase: 1;
  1345             NumberInCase: 1;
  1475             Ammo: (Propz: ammoprop_ForwMsgs or 
  1346             Ammo: (Propz: ammoprop_ForwMsgs or
  1476                           ammoprop_NoCrosshair or 
  1347                           ammoprop_NoCrosshair or
  1477                           ammoprop_DontHold or
  1348                           ammoprop_DontHold or
  1478                           ammoprop_Track;
  1349                           ammoprop_Track;
  1479                 Count: 1;
  1350                 Count: 1;
  1480                 NumPerTurn: 0;
  1351                 NumPerTurn: 0;
  1481                 Timer: 0;
  1352                 Timer: 0;
  1497 // Seduction
  1368 // Seduction
  1498             (NameId: sidSeduction;
  1369             (NameId: sidSeduction;
  1499             NameTex: nil;
  1370             NameTex: nil;
  1500             Probability: 100;
  1371             Probability: 100;
  1501             NumberInCase: 1;
  1372             NumberInCase: 1;
  1502             Ammo: (Propz: ammoprop_ForwMsgs or 
  1373             Ammo: (Propz: ammoprop_ForwMsgs or
  1503                           ammoprop_DontHold or
  1374                           ammoprop_DontHold or
  1504                           ammoprop_NoCrosshair;
  1375                           ammoprop_NoCrosshair;
  1505                 Count: 1;
  1376                 Count: 1;
  1506                 NumPerTurn: 0;
  1377                 NumPerTurn: 0;
  1507                 Timer: 0;
  1378                 Timer: 0;
  1523 // Watermelon
  1394 // Watermelon
  1524             (NameId: sidWatermelon;
  1395             (NameId: sidWatermelon;
  1525             NameTex: nil;
  1396             NameTex: nil;
  1526             Probability: 400;
  1397             Probability: 400;
  1527             NumberInCase: 1;
  1398             NumberInCase: 1;
  1528             Ammo: (Propz: ammoprop_Timerable or 
  1399             Ammo: (Propz: ammoprop_Timerable or
  1529                           ammoprop_Power or 
  1400                           ammoprop_Power or
  1530                           ammoprop_NeedUpDown or
  1401                           ammoprop_NeedUpDown or
  1531                           ammoprop_AltUse;
  1402                           ammoprop_AltUse;
  1532                 Count: 0;
  1403                 Count: 0;
  1533                 NumPerTurn: 0;
  1404                 NumPerTurn: 0;
  1534                 Timer: 3000;
  1405                 Timer: 3000;
  1550 // HellishBomb ("Hellish Hand-Grenade")
  1421 // HellishBomb ("Hellish Hand-Grenade")
  1551             (NameId: sidHellishBomb;
  1422             (NameId: sidHellishBomb;
  1552             NameTex: nil;
  1423             NameTex: nil;
  1553             Probability: 400;
  1424             Probability: 400;
  1554             NumberInCase: 1;
  1425             NumberInCase: 1;
  1555             Ammo: (Propz: ammoprop_Power or 
  1426             Ammo: (Propz: ammoprop_Power or
  1556                           ammoprop_NeedUpDown or
  1427                           ammoprop_NeedUpDown or
  1557                           ammoprop_AltUse;
  1428                           ammoprop_AltUse;
  1558                 Count: 0;
  1429                 Count: 0;
  1559                 NumPerTurn: 0;
  1430                 NumPerTurn: 0;
  1560                 Timer: 5000;
  1431                 Timer: 5000;
  1604 // Drill ("Drill Rocket")
  1475 // Drill ("Drill Rocket")
  1605             (NameId: sidDrill;
  1476             (NameId: sidDrill;
  1606             NameTex: nil;
  1477             NameTex: nil;
  1607             Probability: 300;
  1478             Probability: 300;
  1608             NumberInCase: 1;
  1479             NumberInCase: 1;
  1609             Ammo: (Propz: ammoprop_Power or 
  1480             Ammo: (Propz: ammoprop_Power or
  1610                           ammoprop_NeedUpDown or
  1481                           ammoprop_NeedUpDown or
  1611                           ammoprop_AltUse;
  1482                           ammoprop_AltUse;
  1612                 Count: AMMO_INFINITE;
  1483                 Count: AMMO_INFINITE;
  1613                 NumPerTurn: 0;
  1484                 NumPerTurn: 0;
  1614                 Timer: 0;
  1485                 Timer: 0;
  1630 // Ballgun
  1501 // Ballgun
  1631             (NameId: sidBallgun;
  1502             (NameId: sidBallgun;
  1632             NameTex: nil;
  1503             NameTex: nil;
  1633             Probability: 400;
  1504             Probability: 400;
  1634             NumberInCase: 1;
  1505             NumberInCase: 1;
  1635             Ammo: (Propz: ammoprop_ForwMsgs or 
  1506             Ammo: (Propz: ammoprop_ForwMsgs or
  1636                           ammoprop_NeedUpDown or
  1507                           ammoprop_NeedUpDown or
  1637                           ammoprop_DontHold;
  1508                           ammoprop_DontHold;
  1638                 Count: AMMO_INFINITE;
  1509                 Count: AMMO_INFINITE;
  1639                 NumPerTurn: 0;
  1510                 NumPerTurn: 0;
  1640                 Timer: 5001;
  1511                 Timer: 5001;
  1858 // SniperRifle
  1729 // SniperRifle
  1859             (NameId: sidSniperRifle;
  1730             (NameId: sidSniperRifle;
  1860             NameTex: nil;
  1731             NameTex: nil;
  1861             Probability: 20;
  1732             Probability: 20;
  1862             NumberInCase: 2;
  1733             NumberInCase: 2;
  1863             Ammo: (Propz: ammoprop_NeedUpDown or 
  1734             Ammo: (Propz: ammoprop_NeedUpDown or
  1864                     ammoprop_OscAim or
  1735                     ammoprop_OscAim or
  1865                     ammoprop_NoMoveAfter;
  1736                     ammoprop_NoMoveAfter;
  1866                 Count: 2;
  1737                 Count: 2;
  1867                 NumPerTurn: 1;
  1738                 NumPerTurn: 1;
  1868                 Timer: 0;
  1739                 Timer: 0;
  1915 // Molotov
  1786 // Molotov
  1916             (NameId: sidMolotov;
  1787             (NameId: sidMolotov;
  1917             NameTex: nil;
  1788             NameTex: nil;
  1918             Probability: 0;
  1789             Probability: 0;
  1919             NumberInCase: 1;
  1790             NumberInCase: 1;
  1920             Ammo: (Propz: ammoprop_Power or 
  1791             Ammo: (Propz: ammoprop_Power or
  1921                           ammoprop_NeedUpDown or
  1792                           ammoprop_NeedUpDown or
  1922                           ammoprop_AltUse;
  1793                           ammoprop_AltUse;
  1923                 Count: AMMO_INFINITE;
  1794                 Count: AMMO_INFINITE;
  1924                 NumPerTurn: 0;
  1795                 NumPerTurn: 0;
  1925                 Timer: 3000;
  1796                 Timer: 3000;
  2024 // GasBomb
  1895 // GasBomb
  2025             (NameId: sidGasBomb;
  1896             (NameId: sidGasBomb;
  2026             NameTex: nil;
  1897             NameTex: nil;
  2027             Probability: 0;
  1898             Probability: 0;
  2028             NumberInCase: 1;
  1899             NumberInCase: 1;
  2029             Ammo: (Propz: ammoprop_Timerable or 
  1900             Ammo: (Propz: ammoprop_Timerable or
  2030                           ammoprop_Power or 
  1901                           ammoprop_Power or
  2031                           ammoprop_AltUse or 
  1902                           ammoprop_AltUse or
  2032                           ammoprop_NeedUpDown or
  1903                           ammoprop_NeedUpDown or
  2033                           ammoprop_SetBounce;
  1904                           ammoprop_SetBounce;
  2034                 Count: AMMO_INFINITE;
  1905                 Count: AMMO_INFINITE;
  2035                 NumPerTurn: 0;
  1906                 NumPerTurn: 0;
  2036                 Timer: 3000;
  1907                 Timer: 3000;
  2077 // Flamethrower
  1948 // Flamethrower
  2078             (NameId: sidFlamethrower;
  1949             (NameId: sidFlamethrower;
  2079             NameTex: nil;
  1950             NameTex: nil;
  2080             Probability: 20;
  1951             Probability: 20;
  2081             NumberInCase: 1;
  1952             NumberInCase: 1;
  2082             Ammo: (Propz: ammoprop_ForwMsgs or 
  1953             Ammo: (Propz: ammoprop_ForwMsgs or
  2083                           ammoprop_NeedUpDown or
  1954                           ammoprop_NeedUpDown or
  2084                           ammoprop_DontHold;
  1955                           ammoprop_DontHold;
  2085                 Count: 1;
  1956                 Count: 1;
  2086                 NumPerTurn: 0;
  1957                 NumPerTurn: 0;
  2087                 Timer: 5001;
  1958                 Timer: 5001;
  2208 // Snowball/Mudball
  2079 // Snowball/Mudball
  2209             (NameId: sidSnowball;
  2080             (NameId: sidSnowball;
  2210             NameTex: nil;
  2081             NameTex: nil;
  2211             Probability: 0;
  2082             Probability: 0;
  2212             NumberInCase: 1;
  2083             NumberInCase: 1;
  2213             Ammo: (Propz: ammoprop_Power or 
  2084             Ammo: (Propz: ammoprop_Power or
  2214                           ammoprop_AltUse or
  2085                           ammoprop_AltUse or
  2215                           ammoprop_NoRoundEnd;
  2086                           ammoprop_NoRoundEnd;
  2216                 Count: 2;
  2087                 Count: 2;
  2217                 NumPerTurn: 0;
  2088                 NumPerTurn: 0;
  2218                 Timer: 0;
  2089                 Timer: 0;
  2226             maxAngle: 0;
  2097             maxAngle: 0;
  2227             isDamaging: true;
  2098             isDamaging: true;
  2228             SkipTurns: 0;
  2099             SkipTurns: 0;
  2229             PosCount: 1;
  2100             PosCount: 1;
  2230             PosSprite: sprWater;
  2101             PosSprite: sprWater;
  2231             ejectX: 0; 
  2102             ejectX: 0;
  2232             ejectY: 0),
  2103             ejectY: 0),
  2233 
  2104 
  2234 // Tardis
  2105 // Tardis
  2235             (NameId: sidTardis;
  2106             (NameId: sidTardis;
  2236             NameTex: nil;
  2107             NameTex: nil;
  2256             PosCount: 2;
  2127             PosCount: 2;
  2257             PosSprite: sprAmTeleport;
  2128             PosSprite: sprAmTeleport;
  2258             ejectX: 0;
  2129             ejectX: 0;
  2259             ejectY: 0),
  2130             ejectY: 0),
  2260 
  2131 
  2261 // Structure      
  2132 // Structure
       
  2133 {
  2262             (NameId: sidStructure;
  2134             (NameId: sidStructure;
  2263             NameTex: nil;
  2135             NameTex: nil;
  2264             Probability: 0;
  2136             Probability: 0;
  2265             NumberInCase: 1;
  2137             NumberInCase: 1;
  2266             Ammo: (Propz: ammoprop_ForwMsgs or
  2138             Ammo: (Propz: ammoprop_ForwMsgs or
  2282             SkipTurns: 0;
  2154             SkipTurns: 0;
  2283             PosCount: 1;
  2155             PosCount: 1;
  2284             PosSprite: sprWater;
  2156             PosSprite: sprWater;
  2285             ejectX: 0;
  2157             ejectX: 0;
  2286             ejectY: 0),
  2158             ejectY: 0),
  2287             
  2159 }
       
  2160 
  2288 // Land Gun
  2161 // Land Gun
  2289             (NameId: sidLandGun;
  2162             (NameId: sidLandGun;
  2290             NameTex: nil;
  2163             NameTex: nil;
  2291             Probability: 20;
  2164             Probability: 20;
  2292             NumberInCase: 1;
  2165             NumberInCase: 1;
  2312 // Freezer
  2185 // Freezer
  2313             (NameId: sidIceGun;
  2186             (NameId: sidIceGun;
  2314             NameTex: nil;
  2187             NameTex: nil;
  2315             Probability: 20;
  2188             Probability: 20;
  2316             NumberInCase: 1;
  2189             NumberInCase: 1;
  2317             Ammo: (Propz: ammoprop_ForwMsgs or 
  2190             Ammo: (Propz: ammoprop_ForwMsgs or
  2318                           ammoprop_NeedUpDown or
  2191                           ammoprop_NeedUpDown or
  2319                           ammoprop_DontHold;
  2192                           ammoprop_DontHold;
  2320                 Count: 1;
  2193                 Count: 1;
  2321                 NumPerTurn: 0;
  2194                 NumPerTurn: 0;
  2322                 Timer: 5001;
  2195                 Timer: 5001;
  2358             PosCount: 1;
  2231             PosCount: 1;
  2359             PosSprite: sprWater;
  2232             PosSprite: sprWater;
  2360             ejectX: 0;
  2233             ejectX: 0;
  2361             ejectY: 0)
  2234             ejectY: 0)
  2362         );
  2235         );
  2363 
       
  2364 const
       
  2365     GearKindAmmoTypeMap : array [TGearType] of TAmmoType = (    
       
  2366 (*          gtFlame *)   amNothing
       
  2367 (*       gtHedgehog *) , amNothing
       
  2368 (*           gtMine *) , amMine
       
  2369 (*           gtCase *) , amNothing
       
  2370 (*     gtExplosives *) , amNothing
       
  2371 (*        gtGrenade *) , amGrenade
       
  2372 (*          gtShell *) , amBazooka
       
  2373 (*          gtGrave *) , amNothing
       
  2374 (*            gtBee *) , amBee
       
  2375 (*    gtShotgunShot *) , amShotgun
       
  2376 (*     gtPickHammer *) , amPickHammer
       
  2377 (*           gtRope *) , amRope
       
  2378 (*     gtDEagleShot *) , amDEagle
       
  2379 (*       gtDynamite *) , amDynamite
       
  2380 (*    gtClusterBomb *) , amClusterBomb
       
  2381 (*        gtCluster *) , amClusterBomb
       
  2382 (*         gtShover *) , amBaseballBat  // Shover is only used for baseball bat right now
       
  2383 (*      gtFirePunch *) , amFirePunch
       
  2384 (*    gtATStartGame *) , amNothing
       
  2385 (*   gtATFinishGame *) , amNothing
       
  2386 (*      gtParachute *) , amParachute
       
  2387 (*      gtAirAttack *) , amAirAttack
       
  2388 (*        gtAirBomb *) , amAirAttack
       
  2389 (*      gtBlowTorch *) , amBlowTorch
       
  2390 (*         gtGirder *) , amGirder
       
  2391 (*       gtTeleport *) , amTeleport
       
  2392 (*       gtSwitcher *) , amSwitch
       
  2393 (*         gtTarget *) , amNothing
       
  2394 (*         gtMortar *) , amMortar
       
  2395 (*           gtWhip *) , amWhip
       
  2396 (*       gtKamikaze *) , amKamikaze
       
  2397 (*           gtCake *) , amCake
       
  2398 (*      gtSeduction *) , amSeduction
       
  2399 (*     gtWatermelon *) , amWatermelon
       
  2400 (*     gtMelonPiece *) , amWatermelon
       
  2401 (*    gtHellishBomb *) , amHellishBomb
       
  2402 (*        gtWaterUp *) , amNothing
       
  2403 (*          gtDrill *) , amDrill
       
  2404 (*        gtBallGun *) , amBallgun
       
  2405 (*           gtBall *) , amBallgun
       
  2406 (*        gtRCPlane *) , amRCPlane
       
  2407 (*gtSniperRifleShot *) , amSniperRifle
       
  2408 (*        gtJetpack *) , amJetpack
       
  2409 (*        gtMolotov *) , amMolotov
       
  2410 (*          gtBirdy *) , amBirdy
       
  2411 (*            gtEgg *) , amBirdy
       
  2412 (*         gtPortal *) , amPortalGun
       
  2413 (*          gtPiano *) , amPiano
       
  2414 (*        gtGasBomb *) , amGasBomb
       
  2415 (*    gtSineGunShot *) , amSineGun
       
  2416 (*   gtFlamethrower *) , amFlamethrower
       
  2417 (*          gtSMine *) , amSMine
       
  2418 (*    gtPoisonCloud *) , amNothing
       
  2419 (*         gtHammer *) , amHammer
       
  2420 (*      gtHammerHit *) , amHammer
       
  2421 (*    gtResurrector *) , amResurrector
       
  2422 (*    gtPoisonCloud *) , amNothing
       
  2423 (*       gtSnowball *) , amSnowball
       
  2424 (*          gtFlake *) , amNothing
       
  2425 (*      gtStructure *) , amStructure  // TODO - This will undoubtedly change once there is more than one structure
       
  2426 (*        gtLandGun *) , amLandGun
       
  2427 (*         gtTardis *) , amTardis
       
  2428 (*         gtIceGun *) , amIceGun
       
  2429 (*        gtAddAmmo *) , amNothing
       
  2430 (*  gtGenericFaller *) , amNothing
       
  2431 (*          gtKnife *) , amKnife
       
  2432     );
       
  2433 
  2236 
  2434 var
  2237 var
  2435     Land: TCollisionArray;
  2238     Land: TCollisionArray;
  2436     LandPixels: TLandArray;
  2239     LandPixels: TLandArray;
  2437     LandDirty: TDirtyTag;
  2240     LandDirty: TDirtyTag;
  2462     ClansCount: Longword;
  2265     ClansCount: Longword;
  2463     LocalClan: LongInt;  // last non-bot, non-extdriven clan
  2266     LocalClan: LongInt;  // last non-bot, non-extdriven clan
  2464     LocalTeam: LongInt;  // last non-bot, non-extdriven clan first team
  2267     LocalTeam: LongInt;  // last non-bot, non-extdriven clan first team
  2465     LocalAmmo: LongInt;  // last non-bot, non-extdriven clan's first team's ammo index, updated to next upcoming hog for per-hog-ammo
  2268     LocalAmmo: LongInt;  // last non-bot, non-extdriven clan's first team's ammo index, updated to next upcoming hog for per-hog-ammo
  2466     CurMinAngle, CurMaxAngle: Longword;
  2269     CurMinAngle, CurMaxAngle: Longword;
  2467     NextClan: boolean;
       
  2468 
  2270 
  2469     FollowGear: PGear;
  2271     FollowGear: PGear;
  2470     WindBarWidth: LongInt;
  2272     WindBarWidth: LongInt;
  2471     bShowAmmoMenu: boolean;
  2273     bShowAmmoMenu: boolean;
  2472     bSelected: boolean;
  2274     bSelected: boolean;
  2473     bShowFinger: boolean;
  2275     bShowFinger: boolean;
  2474     Frames: Longword;
  2276     Frames: Longword;
  2475     WaterColor, DeepWaterColor: TSDL_Color;
  2277     WaterColor, DeepWaterColor: TSDL_Color;
  2476     SkyColor, RQSkyColor, SDSkyColor: TSDL_Color;
  2278     SkyColor, RQSkyColor, SDSkyColor: TSDL_Color;
  2477     SkyOffset: LongInt;
  2279     SkyOffset: LongInt;
  2478     HorizontOffset: LongInt;
       
  2479 {$IFDEF COUNTTICKS}
  2280 {$IFDEF COUNTTICKS}
  2480     cntTicks: LongWord;
  2281     cntTicks: LongWord;
  2481 {$ENDIF}
  2282 {$ENDIF}
  2482     cOffsetY: LongInt;
       
  2483     AFRToggle: Boolean;
       
  2484     bAFRRight: Boolean;
       
  2485 
  2283 
  2486 
  2284 
  2487     PauseTexture,
  2285     PauseTexture,
  2488     SyncTexture,
  2286     SyncTexture,
  2489     ConfirmTexture: PTexture;
  2287     ConfirmTexture: PTexture;
  2490     cScaleFactor: GLfloat;
  2288     cScaleFactor: GLfloat;
  2491     cStereoDepth: GLfloat;
  2289     cStereoDepth: GLfloat;
  2492     SupportNPOTT: Boolean;
  2290     SupportNPOTT: Boolean;
  2493     Step: LongInt;
  2291     Step: LongInt;
  2494     squaresize : LongInt;
       
  2495     numsquares : LongInt;
       
  2496     ProgrTex: PTexture;
       
  2497     MissionIcons: PSDL_Surface;
  2292     MissionIcons: PSDL_Surface;
  2498     ropeIconTex: PTexture;
  2293     ropeIconTex: PTexture;
  2499 
  2294 
  2500     // stereoscopic framebuffer and textures
  2295     // stereoscopic framebuffer and textures
  2501     framel, framer, depthl, depthr: GLuint;
  2296     framel, framer, depthl, depthr: GLuint;
  2503 
  2298 
  2504     // video recorder framebuffer and texture
  2299     // video recorder framebuffer and texture
  2505     defaultFrame, depthv: GLuint;
  2300     defaultFrame, depthv: GLuint;
  2506     texv: GLuint;
  2301     texv: GLuint;
  2507 
  2302 
  2508     VisualGearLayers: array[0..6] of PVisualGear;
       
  2509     lastVisualGearByUID: PVisualGear;
  2303     lastVisualGearByUID: PVisualGear;
  2510     vobFrameTicks, vobFramesCount, vobCount: Longword;
  2304     vobFrameTicks, vobFramesCount, vobCount: Longword;
  2511     vobVelocity, vobFallSpeed: LongInt;
  2305     vobVelocity, vobFallSpeed: LongInt;
  2512     vobSDFrameTicks, vobSDFramesCount, vobSDCount: Longword;
  2306     vobSDFrameTicks, vobSDFramesCount, vobSDCount: Longword;
  2513     vobSDVelocity, vobSDFallSpeed: LongInt;
  2307     vobSDVelocity, vobSDFallSpeed: LongInt;
  2514 
  2308 
  2515     ControllerNumControllers: Integer;
       
  2516     ControllerEnabled: Integer;
       
  2517     ControllerNumAxes: array[0..5] of Integer;
       
  2518     //ControllerNumBalls: array[0..5] of Integer;
       
  2519     ControllerNumHats: array[0..5] of Integer;
       
  2520     ControllerNumButtons: array[0..5] of Integer;
       
  2521     ControllerAxes: array[0..5] of array[0..19] of Integer;
       
  2522     //ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer;
       
  2523     ControllerHats: array[0..5] of array[0..19] of Byte;
       
  2524     ControllerButtons: array[0..5] of array[0..19] of Byte;
       
  2525 
       
  2526     DefaultBinds : TBinds;
  2309     DefaultBinds : TBinds;
  2527 
  2310 
  2528     lastTurnChecksum : Longword;
  2311     lastTurnChecksum : Longword;
  2529 
  2312 
  2530     mModelview: TMatrix4x4f;
  2313     mModelview: TMatrix4x4f;
  2561 begin
  2344 begin
  2562     // initialisation flags - they are going to be overwritten by program args
  2345     // initialisation flags - they are going to be overwritten by program args
  2563 
  2346 
  2564     cScreenWidth    := 1024;
  2347     cScreenWidth    := 1024;
  2565     cScreenHeight   := 768;
  2348     cScreenHeight   := 768;
  2566     cBits           := 32;
       
  2567     cShowFPS        := false;
  2349     cShowFPS        := false;
  2568     cAltDamage      := true;
  2350     cAltDamage      := true;
  2569     cTimerInterval  := 8;
  2351     cTimerInterval  := 8;
  2570     cReducedQuality := rqNone;
  2352     cReducedQuality := rqNone;
  2571     cLocaleFName    := 'en.txt';
  2353     cLocaleFName    := 'en.txt';
  2721     cSeed           := '';
  2503     cSeed           := '';
  2722     cVolumeDelta    := 0;
  2504     cVolumeDelta    := 0;
  2723     cHasFocus       := true;
  2505     cHasFocus       := true;
  2724     cInactDelay     := 100;
  2506     cInactDelay     := 100;
  2725     ReadyTimeLeft   := 0;
  2507     ReadyTimeLeft   := 0;
  2726     
  2508 
  2727     disableLandBack := false;
  2509     disableLandBack := false;
  2728     ScreenFade      := sfNone;
  2510     ScreenFade      := sfNone;
  2729 
  2511 
  2730     // those values still are not perfect
  2512     // those values still are not perfect
  2731     cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
  2513     cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
  2762 //    MatrixLoadIdentity(mModelview);
  2544 //    MatrixLoadIdentity(mModelview);
  2763 //    MatrixLoadIdentity(mProjection);
  2545 //    MatrixLoadIdentity(mProjection);
  2764     aVertex:= 0;
  2546     aVertex:= 0;
  2765     aTexCoord:= 1;
  2547     aTexCoord:= 1;
  2766     aColor:= 2;
  2548     aColor:= 2;
       
  2549 
       
  2550     mobileRecord.getScreenDPI:= @getScreenDPI; //TODO: define external function.
       
  2551     {$IFDEF IPHONEOS}
       
  2552     mobileRecord.PerformRumble:= @AudioServicesPlaySystemSound;
       
  2553     mobileRecord.GameLoading:= @startLoadingIndicator;
       
  2554     mobileRecord.GameLoaded:= @stopLoadingIndicator;
       
  2555     mobileRecord.SaveLoadingEnded:= @saveFinishedSynching;
       
  2556     {$ELSE}
       
  2557     mobileRecord.PerformRumble:= nil;
       
  2558     mobileRecord.GameLoading:= nil;
       
  2559     mobileRecord.GameLoaded:= nil;
       
  2560     mobileRecord.SaveLoadingEnded:= nil;
       
  2561     {$ENDIF}
  2767 end;
  2562 end;
  2768 
  2563 
  2769 procedure freeModule;
  2564 procedure freeModule;
  2770 begin
  2565 begin
  2771 end;
  2566 end;