hedgewars/uVariables.pas
changeset 11164 e19cf9459665
parent 11154 1d08386a7c0f
child 11166 9aad7f294864
child 11174 5cadfe82eaf6
equal deleted inserted replaced
11159:48190da6af61 11164:e19cf9459665
   236 
   236 
   237     LuaGoals        : shortstring;
   237     LuaGoals        : shortstring;
   238 
   238 
   239     LuaTemplateNumber : LongWord;
   239     LuaTemplateNumber : LongWord;
   240 
   240 
   241     LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
   241     LastVoice : TVoice;
   242 
   242 
   243     mobileRecord: TMobileRecord;
   243     mobileRecord: TMobileRecord;
   244 
   244 
   245     MaxTextureSize: LongInt;
   245     MaxTextureSize: LongInt;
   246 
   246 
   257 {$ENDIF}
   257 {$ENDIF}
   258 
   258 
   259 
   259 
   260 var
   260 var
   261     // these consts are here because they would cause circular dependencies in uConsts/uTypes
   261     // these consts are here because they would cause circular dependencies in uConsts/uTypes
   262     cPathz: array[TPathType] of shortstring = (
   262     cPathz: array[TPathType] of shortstring;
       
   263 
       
   264 const
       
   265     cPathzInit: array[TPathType] of shortstring = (
   263         '',                              // ptNone
   266         '',                              // ptNone
   264         '//',                            // ptData
   267         '//',                            // ptData
   265         '/Graphics',                     // ptGraphics
   268         '/Graphics',                     // ptGraphics
   266         '/Themes',                       // ptThemes
   269         '/Themes',                       // ptThemes
   267         '/Themes/Bamboo',                // ptCurrTheme
   270         '/Themes/Bamboo',                // ptCurrTheme
   284         '/Graphics/Buttons',             // ptButton
   287         '/Graphics/Buttons',             // ptButton
   285         '/Shaders'                       // ptShaders
   288         '/Shaders'                       // ptShaders
   286     );
   289     );
   287 
   290 
   288 var
   291 var
   289     Fontz: array[THWFont] of THHFont = (
   292     Fontz: array[THWFont] of THHFont;
       
   293 
       
   294 const
       
   295     FontzInit: array[THWFont] of THHFont = (
   290             (Handle: nil;
   296             (Handle: nil;
   291             Height: 12;
   297             Height: 12;
   292             style: TTF_STYLE_NORMAL;
   298             style: TTF_STYLE_NORMAL;
   293             Name: 'DejaVuSans-Bold.ttf'),
   299             Name: 'DejaVuSans-Bold.ttf'),
   294             (Handle: nil;
   300             (Handle: nil;
   314             Name: 'wqy-zenhei.ttc')
   320             Name: 'wqy-zenhei.ttc')
   315             {$ENDIF}
   321             {$ENDIF}
   316             );
   322             );
   317 
   323 
   318 var
   324 var
   319     SpritesData: array[TSprite] of TSpriteData = (
   325     SpritesData: array[TSprite] of TSpriteData;
       
   326 
       
   327 const
       
   328     SpritesDataInit: array[TSprite] of TSpriteData = (
   320             (FileName:  'BlueWater'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil;
   329             (FileName:  'BlueWater'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil;
   321             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: true; getImageDimensions: true),// sprWater
   330             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: true; getImageDimensions: true),// sprWater
   322             (FileName:     'Clouds'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil;
   331             (FileName:     'Clouds'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil;
   323             Width: 256; Height:128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprCloud
   332             Width: 256; Height:128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprCloud
   324             (FileName:       'Bomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   333             (FileName:       'Bomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
   732             (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0),
   741             (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0),
   733             (Sprite:    sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0),
   742             (Sprite:    sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0),
   734             (Sprite:   sprJuggle; FramesCount: 49; Interval:  38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0)
   743             (Sprite:   sprJuggle; FramesCount: 49; Interval:  38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0)
   735             );
   744             );
   736 
   745 
   737 var
   746 type
   738     Ammoz: array [TAmmoType] of record
   747     TAmmozRec = record
   739             NameId: TAmmoStrId;
   748             NameId: TAmmoStrId;
   740             NameTex: PTexture;
   749             NameTex: PTexture;
   741             Probability, NumberInCase: Longword;
   750             Probability, NumberInCase: Longword;
   742             Ammo: TAmmo;
   751             Ammo: TAmmo;
   743             Slot: 0..cMaxSlotIndex;
   752             Slot: 0..cMaxSlotIndex;
   746             isDamaging: boolean;
   755             isDamaging: boolean;
   747             SkipTurns: LongWord;
   756             SkipTurns: LongWord;
   748             PosCount: Longword;
   757             PosCount: Longword;
   749             PosSprite: TSprite;
   758             PosSprite: TSprite;
   750             ejectX, ejectY: Longint;
   759             ejectX, ejectY: Longint;
   751             end = (
   760             end;
       
   761 
       
   762 var
       
   763     Ammoz: array [TAmmoType] of TAmmozRec;
       
   764 
       
   765 const
       
   766     AmmozInit: array [TAmmoType] of TAmmozRec = (
   752             (NameId: sidNothing;
   767             (NameId: sidNothing;
   753             NameTex: nil;
   768             NameTex: nil;
   754             Probability: 0;
   769             Probability: 0;
   755             NumberInCase: 0;
   770             NumberInCase: 0;
   756             Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_DontHold or ammoprop_Effect;
   771             Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_DontHold or ammoprop_Effect;
  2493 
  2508 
  2494 procedure initModule;
  2509 procedure initModule;
  2495 var s: shortstring;
  2510 var s: shortstring;
  2496     i: integer;
  2511     i: integer;
  2497 begin
  2512 begin
       
  2513     // init LastVoice
       
  2514     LastVoice.snd:= sndNone;
       
  2515     LastVoice.voicepack:= nil;
       
  2516 
       
  2517     // init arrays
       
  2518     Move(cPathzInit, cPathz, sizeof(cPathz));
       
  2519     Move(FontzInit, Fontz, sizeof(Fontz));
       
  2520     Move(SpritesDataInit, SpritesData, sizeof(SpritesData));
       
  2521     Move(AmmozInit, Ammoz, sizeof(Ammoz));
       
  2522 
       
  2523 
  2498     cLocale:= cLocaleFName;
  2524     cLocale:= cLocaleFName;
  2499     SplitByChar(cLocale, s, '.');
  2525     SplitByChar(cLocale, s, '.');
  2500 
  2526 
  2501     cFlattenFlakes      := false;
  2527     cFlattenFlakes      := false;
  2502     cFlattenClouds      := false;
  2528     cFlattenClouds      := false;