hedgewars/uConsts.pas
changeset 755 edf26e9554ac
parent 708 6ee55ba9c8fe
child 757 ddbff94153e8
equal deleted inserted replaced
754:94ac14829085 755:edf26e9554ac
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
    18 
    18 
    19 unit uConsts;
    19 unit uConsts;
    20 interface
    20 interface
    21 uses SDLh, uLocale;
    21 uses SDLh, GL, uLocale;
    22 {$INCLUDE options.inc}
    22 {$INCLUDE options.inc}
    23 {$INCLUDE proto.inc}
    23 {$INCLUDE proto.inc}
    24 type
    24 type
    25 
    25 
    26      TGameState = (gsLandGen, gsStart, gsGame, gsConsole, gsExit);
    26      TGameState = (gsLandGen, gsStart, gsGame, gsConsole, gsExit);
    81              NumPerTurn: LongWord;
    81              NumPerTurn: LongWord;
    82              Timer: LongWord;
    82              Timer: LongWord;
    83              Pos: LongWord;
    83              Pos: LongWord;
    84              AmmoType: TAmmoType;
    84              AmmoType: TAmmoType;
    85              end;
    85              end;
       
    86      TTexture = record
       
    87                 id: GLuint;
       
    88                 w, h: LongInt;
       
    89                 end;
       
    90      PTexture = ^TTexture;
    86 
    91 
    87 
    92 
    88 const
    93 const
    89       errmsgCreateSurface   = 'Error creating SDL surface';
    94       errmsgCreateSurface   = 'Error creating SDL surface';
    90       errmsgTransparentSet  = 'Error setting transparent color';
    95       errmsgTransparentSet  = 'Error setting transparent color';
   231                                                );
   236                                                );
   232 
   237 
   233       SpritesData: array[TSprite] of record
   238       SpritesData: array[TSprite] of record
   234                      FileName: String[31];
   239                      FileName: String[31];
   235                      Path, AltPath: TPathType;
   240                      Path, AltPath: TPathType;
   236                      Surface : PSDL_Surface;
   241                      Texture: PTexture;
   237                      Width, Height: LongInt;
   242                      Width, Height: LongInt;
   238                      hasAlpha: boolean;
   243                      hasAlpha: boolean;
   239                      end = (
   244                      end = (
   240                      (FileName:  'BlueWater'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   245                      (FileName:  'BlueWater'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   241                       Width: 256; Height: 48; hasAlpha: false),// sprWater
   246                       Width: 256; Height: 48; hasAlpha: false),// sprWater
   242                      (FileName:     'Clouds'; Path: ptCurrTheme; AltPath: ptGraphics; Surface: nil;
   247                      (FileName:     'Clouds'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil;
   243                       Width: 256; Height:128; hasAlpha: false),// sprCloud
   248                       Width: 256; Height:128; hasAlpha: false),// sprCloud
   244                      (FileName:       'Bomb'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   249                      (FileName:       'Bomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   245                       Width:  16; Height: 16; hasAlpha: false),// sprBomb
   250                       Width:  16; Height: 16; hasAlpha: false),// sprBomb
   246                      (FileName:  'BigDigits'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   251                      (FileName:  'BigDigits'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   247                       Width:  32; Height: 32; hasAlpha:  true),// sprBigDigit
   252                       Width:  32; Height: 32; hasAlpha:  true),// sprBigDigit
   248                      (FileName:      'Frame'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   253                      (FileName:      'Frame'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   249                       Width:   4; Height: 32; hasAlpha:  true),// sprFrame
   254                       Width:   4; Height: 32; hasAlpha:  true),// sprFrame
   250                      (FileName:        'Lag'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   255                      (FileName:        'Lag'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   251                       Width:  65; Height: 65; hasAlpha:  true),// sprLag
   256                       Width:  65; Height: 65; hasAlpha:  true),// sprLag
   252                      (FileName:      'Arrow'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   257                      (FileName:      'Arrow'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   253                       Width:  16; Height: 16; hasAlpha: false),// sprCursor
   258                       Width:  16; Height: 16; hasAlpha: false),// sprCursor
   254                      (FileName:    'Grenade'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   259                      (FileName:    'Grenade'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   255                       Width:  32; Height: 32; hasAlpha: false),// sprGrenade
   260                       Width:  32; Height: 32; hasAlpha: false),// sprGrenade
   256                      (FileName:    'Targetp'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   261                      (FileName:    'Targetp'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   257                       Width:  32; Height: 32; hasAlpha: false),// sprTargetP
   262                       Width:  32; Height: 32; hasAlpha: false),// sprTargetP
   258                      (FileName:        'UFO'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   263                      (FileName:        'UFO'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   259                       Width:  32; Height: 32; hasAlpha: false),// sprUFO
   264                       Width:  32; Height: 32; hasAlpha: false),// sprUFO
   260                      (FileName: 'SmokeTrace'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   265                      (FileName: 'SmokeTrace'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   261                       Width:  32; Height: 32; hasAlpha:  true),// sprSmokeTrace
   266                       Width:  32; Height: 32; hasAlpha:  true),// sprSmokeTrace
   262                      (FileName:   'RopeHook'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   267                      (FileName:   'RopeHook'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   263                       Width:  32; Height: 32; hasAlpha: false),// sprRopeHook
   268                       Width:  32; Height: 32; hasAlpha: false),// sprRopeHook
   264                      (FileName:     'Expl50'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   269                      (FileName:     'Expl50'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   265                       Width:  64; Height: 64; hasAlpha: false),// sprExplosion50
   270                       Width:  64; Height: 64; hasAlpha: false),// sprExplosion50
   266                      (FileName:    'MineOff'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   271                      (FileName:    'MineOff'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   267                       Width:  16; Height: 16; hasAlpha: false),// sprMineOff
   272                       Width:  16; Height: 16; hasAlpha: false),// sprMineOff
   268                      (FileName:     'MineOn'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   273                      (FileName:     'MineOn'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   269                       Width:  16; Height: 16; hasAlpha: false),// sprMineOn
   274                       Width:  16; Height: 16; hasAlpha: false),// sprMineOn
   270                      (FileName:       'Case'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   275                      (FileName:       'Case'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   271                       Width:  32; Height: 32; hasAlpha: false),// sprCase
   276                       Width:  32; Height: 32; hasAlpha: false),// sprCase
   272                      (FileName:   'FirstAid'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   277                      (FileName:   'FirstAid'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   273                       Width:  48; Height: 48; hasAlpha: false),// sprFAid
   278                       Width:  48; Height: 48; hasAlpha: false),// sprFAid
   274                      (FileName:   'dynamite'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   279                      (FileName:   'dynamite'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   275                       Width:  32; Height: 32; hasAlpha: false),// sprDynamite
   280                       Width:  32; Height: 32; hasAlpha: false),// sprDynamite
   276                      (FileName:      'Power'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   281                      (FileName:      'Power'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   277                       Width:  32; Height: 32; hasAlpha:  true),// sprPower
   282                       Width:  32; Height: 32; hasAlpha:  true),// sprPower
   278                      (FileName:     'ClBomb'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   283                      (FileName:     'ClBomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   279                       Width:  16; Height: 16; hasAlpha: false),// sprClusterBomb
   284                       Width:  16; Height: 16; hasAlpha: false),// sprClusterBomb
   280                      (FileName: 'ClParticle'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   285                      (FileName: 'ClParticle'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   281                       Width:  16; Height: 16; hasAlpha: false),// sprClusterParticle
   286                       Width:  16; Height: 16; hasAlpha: false),// sprClusterParticle
   282                      (FileName:      'Flame'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   287                      (FileName:      'Flame'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   283                       Width:  16; Height: 16; hasAlpha: false),// sprFlame
   288                       Width:  16; Height: 16; hasAlpha: false),// sprFlame
   284                      (FileName:   'horizont'; Path: ptCurrTheme; AltPath: ptNone; Surface: nil;
   289                      (FileName:   'horizont'; Path: ptCurrTheme; AltPath: ptNone; Texture: nil;
   285                       Width:   0; Height:  0; hasAlpha: false),// sprHorizont
   290                       Width:   0; Height:  0; hasAlpha: false),// sprHorizont
   286                      (FileName:        'Sky'; Path: ptCurrTheme; AltPath: ptNone; Surface: nil;
   291                      (FileName:        'Sky'; Path: ptCurrTheme; AltPath: ptNone; Texture: nil;
   287                       Width:   0; Height:  0; hasAlpha: false),// sprSky
   292                       Width:   0; Height:  0; hasAlpha: false),// sprSky
   288                      (FileName:  'BrdrLines'; Path: ptAmmoMenu; AltPath: ptNone; Surface: nil;
   293                      (FileName:  'BrdrLines'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil;
   289                       Width: 202; Height:  1; hasAlpha: false),// sprAMBorders
   294                       Width: 202; Height:  1; hasAlpha: false),// sprAMBorders
   290                      (FileName:       'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Surface: nil;
   295                      (FileName:       'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil;
   291                       Width: 202; Height: 33; hasAlpha: false),// sprAMSlot
   296                       Width: 202; Height: 33; hasAlpha: false),// sprAMSlot
   292                      (FileName:   'AmmoName'; Path: ptAmmoMenu; AltPath: ptNone; Surface: nil;
   297                      (FileName:   'AmmoName'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil;
   293                       Width: 202; Height: 33; hasAlpha: false),// sprAMSlotName
   298                       Width: 202; Height: 33; hasAlpha: false),// sprAMSlotName
   294                      (FileName:      'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Surface: nil;
   299                      (FileName:      'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil;
   295                       Width:  32; Height: 32; hasAlpha: false),// sprAMAmmos
   300                       Width:  32; Height: 32; hasAlpha: false),// sprAMAmmos
   296                      (FileName:   'SlotKeys'; Path: ptAmmoMenu; AltPath: ptNone; Surface: nil;
   301                      (FileName:   'SlotKeys'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil;
   297                       Width:  32; Height: 32; hasAlpha: false),// sprAMSlotKeys
   302                       Width:  32; Height: 32; hasAlpha: false),// sprAMSlotKeys
   298                      (FileName:  'Selection'; Path: ptAmmoMenu; AltPath: ptNone; Surface: nil;
   303                      (FileName:  'Selection'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil;
   299                       Width:  32; Height: 32; hasAlpha: false),// sprAMSelection
   304                       Width:  32; Height: 32; hasAlpha: false),// sprAMSelection
   300                      (FileName:     'Finger'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   305                      (FileName:     'Finger'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   301                       Width:  32; Height: 48; hasAlpha: false),// sprFinger
   306                       Width:  32; Height: 48; hasAlpha: false),// sprFinger
   302                      (FileName:    'AirBomb'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   307                      (FileName:    'AirBomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   303                       Width:  32; Height: 32; hasAlpha: false),// sprAirBomb
   308                       Width:  32; Height: 32; hasAlpha: false),// sprAirBomb
   304                      (FileName:   'Airplane'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   309                      (FileName:   'Airplane'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   305                       Width: 125; Height: 42; hasAlpha: false),// sprAirplane
   310                       Width: 125; Height: 42; hasAlpha: false),// sprAirplane
   306                      (FileName: 'amAirplane'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   311                      (FileName: 'amAirplane'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   307                       Width:  64; Height: 32; hasAlpha:  true),// sprAirplane
   312                       Width:  64; Height: 32; hasAlpha:  true),// sprAirplane
   308                      (FileName:   'amGirder'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   313                      (FileName:   'amGirder'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   309                       Width: 160; Height:160; hasAlpha: false),// sprAmGirder
   314                       Width: 160; Height:160; hasAlpha: false),// sprAmGirder
   310                      (FileName:     'hhMask'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   315                      (FileName:     'hhMask'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   311                       Width:  32; Height: 32; hasAlpha: false),// sprHHTelepMask
   316                       Width:  32; Height: 32; hasAlpha: false),// sprHHTelepMask
   312                      (FileName:     'Switch'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   317                      (FileName:     'Switch'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   313                       Width:  32; Height: 32; hasAlpha:  true),// sprSwitch
   318                       Width:  32; Height: 32; hasAlpha:  true),// sprSwitch
   314                      (FileName:  'Parachute'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   319                      (FileName:  'Parachute'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   315                       Width:  48; Height: 48; hasAlpha:  true),// sprParachute
   320                       Width:  48; Height: 48; hasAlpha:  true),// sprParachute
   316                      (FileName:     'Target'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   321                      (FileName:     'Target'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   317                       Width:  32; Height: 32; hasAlpha: false),// sprTarget
   322                       Width:  32; Height: 32; hasAlpha: false),// sprTarget
   318                      (FileName:   'RopeNode'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   323                      (FileName:   'RopeNode'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   319                       Width:   6; Height:  6; hasAlpha: false),// sprRopeNode
   324                       Width:   6; Height:  6; hasAlpha: false),// sprRopeNode
   320                      (FileName:    'Console'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   325                      (FileName:    'Console'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   321                       Width: 256; Height:256; hasAlpha: false),// sprConsoleBG
   326                       Width: 256; Height:256; hasAlpha: false),// sprConsoleBG
   322                      (FileName:   'thinking'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   327                      (FileName:   'thinking'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   323                       Width:  32; Height: 32; hasAlpha: false),// sprQuestion
   328                       Width:  32; Height: 32; hasAlpha: false),// sprQuestion
   324                      (FileName:   'PowerBar'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   329                      (FileName:   'PowerBar'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   325                       Width: 256; Height: 32; hasAlpha: false),// sprPowerBar
   330                       Width: 256; Height: 32; hasAlpha: false),// sprPowerBar
   326                      (FileName:    'WindBar'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   331                      (FileName:    'WindBar'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   327                       Width: 151; Height: 17; hasAlpha: false),// sprWindBar
   332                       Width: 151; Height: 17; hasAlpha: false),// sprWindBar
   328                      (FileName:      'WindL'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   333                      (FileName:      'WindL'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   329                       Width:  80; Height: 13; hasAlpha: false),// sprWindL
   334                       Width:  80; Height: 13; hasAlpha: false),// sprWindL
   330                      (FileName:      'WindR'; Path: ptGraphics; AltPath: ptNone; Surface: nil;
   335                      (FileName:      'WindR'; Path: ptGraphics; AltPath: ptNone; Texture: nil;
   331                       Width:  80; Height: 13; hasAlpha: false) // sprWindR
   336                       Width:  80; Height: 13; hasAlpha: false) // sprWindR
   332                      );
   337                      );
   333 
   338 
   334       Soundz: array[TSound] of record
   339       Soundz: array[TSound] of record
   335                                        FileName: String[31];
   340                                        FileName: String[31];