hedgewars/uConsts.pas
changeset 3697 d5b30d6373fc
parent 3689 e2be39ee19f0
child 3704 ed2b9c7fb260
equal deleted inserted replaced
3695:c11abf387a7d 3697:d5b30d6373fc
    31 
    31 
    32 type
    32 type
    33     HwColor4f = record
    33     HwColor4f = record
    34         r, g, b, a: byte
    34         r, g, b, a: byte
    35         end;
    35         end;
    36         
    36 
    37     TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit);
    37     TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit);
    38 
    38 
    39     TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
    39     TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
    40 
    40 
    41     TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
    41     TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
    69             sprSniperRifle, sprBubbles, sprJetpack, sprHealth, sprHandMolotov, sprMolotov,
    69             sprSniperRifle, sprBubbles, sprJetpack, sprHealth, sprHandMolotov, sprMolotov,
    70             sprSmoke, sprSmokeWhite, sprShell, sprDust, sprExplosives, sprExplosivesRoll,
    70             sprSmoke, sprSmokeWhite, sprShell, sprDust, sprExplosives, sprExplosivesRoll,
    71             sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
    71             sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
    72             sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
    72             sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
    73             sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
    73             sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
    74             sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee, 
    74             sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee,
    75             sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
    75             sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
    76             sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk
    76             sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk
    77             );
    77             );
    78     
    78 
    79     // Gears that interact with other Gears and/or Land
    79     // Gears that interact with other Gears and/or Land
    80     TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtGrave, gtBee, // 4
    80     TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtGrave, gtBee, // 4
    81             gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
    81             gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
    82             gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14
    82             gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14
    83             gtFlame, gtFirePunch, gtATStartGame, gtATSmoothWindCh, // 18
    83             gtFlame, gtFirePunch, gtATStartGame, gtATSmoothWindCh, // 18
   152     TAmmo = record
   152     TAmmo = record
   153             Propz: LongWord;
   153             Propz: LongWord;
   154             Count: LongWord;
   154             Count: LongWord;
   155 (* Using for place hedgehogs mode, but for any other situation where the initial count would be needed I guess.
   155 (* Using for place hedgehogs mode, but for any other situation where the initial count would be needed I guess.
   156 For example, say, a mode where the weaponset is reset each turn, or on sudden death *)
   156 For example, say, a mode where the weaponset is reset each turn, or on sudden death *)
   157             InitialCount: LongWord; 
   157             InitialCount: LongWord;
   158             NumPerTurn: LongWord;
   158             NumPerTurn: LongWord;
   159             Timer: LongWord;
   159             Timer: LongWord;
   160             Pos: LongWord;
   160             Pos: LongWord;
   161             AmmoType: TAmmoType;
   161             AmmoType: TAmmoType;
   162             AttackVoice: TSound;
   162             AttackVoice: TSound;
   254     cMaxPower     = 1500;
   254     cMaxPower     = 1500;
   255     cMaxAngle     = 2048;
   255     cMaxAngle     = 2048;
   256     cPowerDivisor = 1500;
   256     cPowerDivisor = 1500;
   257 
   257 
   258     MAXNAMELEN = 192;
   258     MAXNAMELEN = 192;
   259     
   259 
   260     // some opengl headers do not have these macros
   260     // some opengl headers do not have these macros
   261     GL_BGR              = $80E0;
   261     GL_BGR              = $80E0;
   262     GL_BGRA             = $80E1;
   262     GL_BGRA             = $80E1;
   263     GL_CLAMP_TO_EDGE    = $812F;
   263     GL_CLAMP_TO_EDGE    = $812F;
   264     GL_TEXTURE_PRIORITY = $8066;
   264     GL_TEXTURE_PRIORITY = $8066;
   265     
   265 
   266     cSendCursorPosTime  : LongWord = 50;
   266     cSendCursorPosTime  : LongWord = 50;
   267     cVisibleWater       : LongInt = 128;
   267     cVisibleWater       : LongInt = 128;
   268     cCursorEdgesDist    : LongInt = 100;
   268     cCursorEdgesDist    : LongInt = 100;
   269     cTeamHealthWidth    : LongInt = 128;
   269     cTeamHealthWidth    : LongInt = 128;
   270     cWaterOpacity       : byte = $80;
   270     cWaterOpacity       : byte = $80;
   319     tfTimeTrial     = $00000001;
   319     tfTimeTrial     = $00000001;
   320     tfRCPlane       = $00000002;
   320     tfRCPlane       = $00000002;
   321     tfSpawnTargets  = $00000004;
   321     tfSpawnTargets  = $00000004;
   322     tfIgnoreDelays  = $00000008;
   322     tfIgnoreDelays  = $00000008;
   323     tfTargetRespawn = $00000010;
   323     tfTargetRespawn = $00000010;
   324     
   324 
   325     gfAny            = $FFFFFFFF;
   325     gfAny            = $FFFFFFFF;
   326     gfForts          = $00000001;
   326     gfForts          = $00000001;
   327     gfMultiWeapon    = $00000002;
   327     gfMultiWeapon    = $00000002;
   328     gfSolidLand      = $00000004;
   328     gfSolidLand      = $00000004;
   329     gfBorder         = $00000008;
   329     gfBorder         = $00000008;
   398     ammoprop_AltUse       = $00000400;
   398     ammoprop_AltUse       = $00000400;
   399     ammoprop_NotBorder    = $00000800;
   399     ammoprop_NotBorder    = $00000800;
   400     ammoprop_Utility      = $00001000;
   400     ammoprop_Utility      = $00001000;
   401     ammoprop_Effect       = $00002000;
   401     ammoprop_Effect       = $00002000;
   402     ammoprop_NoRoundEndHint=$10000000;
   402     ammoprop_NoRoundEndHint=$10000000;
   403     
   403 
   404     AMMO_INFINITE = 100;
   404     AMMO_INFINITE = 100;
   405 
   405 
   406     EXPLAllDamageInRadius = $00000001;
   406     EXPLAllDamageInRadius = $00000001;
   407     EXPLAutoSound         = $00000002;
   407     EXPLAutoSound         = $00000002;
   408     EXPLNoDamage          = $00000004;
   408     EXPLNoDamage          = $00000004;
   422     htNone        = $00;
   422     htNone        = $00;
   423     htTeamName    = $01;
   423     htTeamName    = $01;
   424     htName        = $02;
   424     htName        = $02;
   425     htHealth      = $04;
   425     htHealth      = $04;
   426     htTransparent = $08;
   426     htTransparent = $08;
   427     
   427 
   428     cHHFileName = 'Hedgehog';
   428     cHHFileName = 'Hedgehog';
   429     cCHFileName = 'Crosshair';
   429     cCHFileName = 'Crosshair';
   430     cThemeCFGFilename = 'theme.cfg';
   430     cThemeCFGFilename = 'theme.cfg';
   431     
   431 
   432     FontBorder = 2;
   432     FontBorder = 2;
   433     cPathz: array[TPathType] of shortstring = (
   433     cPathz: array[TPathType] of shortstring = (
   434         '',                              // ptNone
   434         '',                              // ptNone
   435         '',                              // ptData
   435         '',                              // ptData
   436         'Graphics',                      // ptGraphics
   436         'Graphics',                      // ptGraphics
   449         'Graphics/Hedgehog',             // ptHedgehog
   449         'Graphics/Hedgehog',             // ptHedgehog
   450         'Sounds/voices',                 // ptVoices
   450         'Sounds/voices',                 // ptVoices
   451         'Graphics/Hats',                 // ptHats
   451         'Graphics/Hats',                 // ptHats
   452         'Graphics/Flags'                 // ptFlags
   452         'Graphics/Flags'                 // ptFlags
   453     );
   453     );
   454     
   454 
   455 var PathPrefix: shortstring = './';
   455 var PathPrefix: shortstring = './';
   456     Pathz: array[TPathType] of shortstring;
   456     Pathz: array[TPathType] of shortstring;
   457     CountTexz: array[1..Pred(AMMO_INFINITE)] of PTexture;
   457     CountTexz: array[1..Pred(AMMO_INFINITE)] of PTexture;
   458     LAND_WIDTH  :longint;
   458     LAND_WIDTH  :longint;
   459     LAND_HEIGHT :longint;
   459     LAND_HEIGHT :longint;
   720             Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprBubbles
   720             Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprBubbles
   721             (FileName:  'amJetpack'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   721             (FileName:  'amJetpack'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   722             Width: 64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprJetpack
   722             Width: 64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprJetpack
   723             (FileName:  'Health'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   723             (FileName:  'Health'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   724             Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprHealth
   724             Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprHealth
   725             (FileName:  'amMolotov'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; 
   725             (FileName:  'amMolotov'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   726             Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),//sprHandMolotov
   726             Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),//sprHandMolotov
   727             (FileName:  'Molotov'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   727             (FileName:  'Molotov'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   728             Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMolotov
   728             Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMolotov
   729             (FileName: 'Smoke'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   729             (FileName: 'Smoke'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   730             Width:  22; Height: 22; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprSmoke
   730             Width:  22; Height: 22; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprSmoke
  2101             SkipTurns: 0;
  2101             SkipTurns: 0;
  2102             PosCount: 1;
  2102             PosCount: 1;
  2103             PosSprite: sprWater;
  2103             PosSprite: sprWater;
  2104             ejectX: 0;
  2104             ejectX: 0;
  2105             ejectY: 0),
  2105             ejectY: 0),
  2106             
  2106 
  2107 // SineGun
  2107 // SineGun
  2108             (NameId: sidSineGun;
  2108             (NameId: sidSineGun;
  2109             NameTex: nil;
  2109             NameTex: nil;
  2110             Probability: 20;
  2110             Probability: 20;
  2111             NumberInCase: 2;
  2111             NumberInCase: 2;
  2178         BMask : BMask;
  2178         BMask : BMask;
  2179         AMask : AMask;
  2179         AMask : AMask;
  2180         colorkey: 0;
  2180         colorkey: 0;
  2181         alpha : 255
  2181         alpha : 255
  2182     );
  2182     );
  2183     
  2183 
  2184 procedure initModule;
  2184 procedure initModule;
  2185 procedure freeModule;
  2185 procedure freeModule;
  2186 
  2186 
  2187 implementation
  2187 implementation
  2188 uses uMisc;
  2188 uses uMisc;
  2208         LAND_HEIGHT:= 2048;
  2208         LAND_HEIGHT:= 2048;
  2209         LAND_WIDTH_MASK:= $FFFFF000;
  2209         LAND_WIDTH_MASK:= $FFFFF000;
  2210         LAND_HEIGHT_MASK:= $FFFFF800
  2210         LAND_HEIGHT_MASK:= $FFFFF800
  2211     end;
  2211     end;
  2212 
  2212 
  2213 {$IFDEF IPHONEOS}    
  2213 {$IFDEF IPHONEOS}
  2214     if isPhone() then
  2214     if isPhone() then
  2215         cMaxCaptions:= 3
  2215         cMaxCaptions:= 3
  2216     else
  2216     else
  2217 {$ENDIF}
  2217 {$ENDIF}
  2218         cMaxCaptions:= 4;
  2218         cMaxCaptions:= 4;