hedgewars/uWorld.pas
changeset 2699 249adefa9c1c
parent 2682 d4c395f25db2
child 2704 51cda17b7c3b
equal deleted inserted replaced
2698:90585aba87ad 2699:249adefa9c1c
    23 uses SDLh, uGears, uConsts, uFloat;
    23 uses SDLh, uGears, uConsts, uFloat;
    24 
    24 
    25 const WorldDx: LongInt = -512;
    25 const WorldDx: LongInt = -512;
    26       WorldDy: LongInt = -256;
    26       WorldDy: LongInt = -256;
    27 
    27 
       
    28 procedure init_uWorld;
    28 procedure InitWorld;
    29 procedure InitWorld;
    29 procedure DrawWorld(Lag: LongInt);
    30 procedure DrawWorld(Lag: LongInt);
    30 procedure AddCaption(s: string; Color: Longword; Group: TCapGroup);
    31 procedure AddCaption(s: string; Color: Longword; Group: TCapGroup);
    31 
    32 
    32 {$IFDEF COUNTTICKS}
    33 {$IFDEF COUNTTICKS}
    33 var cntTicks: LongWord;
    34 var cntTicks: LongWord;
    34 {$ENDIF}
    35 {$ENDIF}
    35 var FollowGear: PGear = nil;
    36 var FollowGear: PGear;
    36 	WindBarWidth: LongInt = 0;
    37     WindBarWidth: LongInt;
    37        	bShowAmmoMenu: boolean = false;
    38     bShowAmmoMenu: boolean;
    38 	bSelected: boolean = false;
    39     bSelected: boolean;
    39 	bShowFinger: boolean = false;
    40     bShowFinger: boolean;
    40 	Frames: Longword = 0;
    41     Frames: Longword;
    41 	WaterColor, DeepWaterColor: TSDL_Color;
    42     WaterColor, DeepWaterColor: TSDL_Color;
    42 
    43 
    43 implementation
    44 implementation
    44 uses uStore, uMisc, uTeams, uIO, uConsole, uKeys, uLocale, uSound,
    45 uses	uStore, uMisc, uTeams, uIO, uConsole, uKeys, uLocale, uSound, uAmmos, uVisualGears, uChat, uLandTexture, uLand,
    45 {$IFDEF GLES11}
    46 {$IFDEF GLES11}
    46 	gles11,
    47 	gles11;
    47 {$ELSE}
    48 {$ELSE}
    48 	GL,
    49 	GL;
    49 {$ENDIF}
    50 {$ENDIF}
    50      uAmmos, uVisualGears, uChat, uLandTexture, uLand;
       
    51 
    51 
    52 const FPS: Longword = 0;
    52 const FPS: Longword = 0;
    53       CountTicks: Longword = 0;
    53       CountTicks: Longword = 0;
    54       SoundTimerTicks: Longword = 0;
    54       SoundTimerTicks: Longword = 0;
    55       prevPoint: TPoint = (X: 0; Y: 0);
    55       prevPoint: TPoint = (X: 0; Y: 0);
    58                    Tex: PTexture;
    58                    Tex: PTexture;
    59                    EndTime: LongWord;
    59                    EndTime: LongWord;
    60                    end;
    60                    end;
    61 
    61 
    62 var cWaveWidth, cWaveHeight: LongInt;
    62 var cWaveWidth, cWaveHeight: LongInt;
    63 	Captions: array[TCapGroup] of TCaptionStr;
    63     Captions: array[TCapGroup] of TCaptionStr;
    64 	AMxShift, SlotsNum: LongInt;
    64     AMxShift, SlotsNum: LongInt;
    65 	tmpSurface: PSDL_Surface;
    65     tmpSurface: PSDL_Surface;
    66 	fpsTexture: PTexture = nil;
    66     fpsTexture: PTexture;
    67 
    67 
    68 procedure InitWorld;
    68 procedure InitWorld;
    69 begin
    69 begin
    70 cWaveWidth:= SpritesData[sprWater].Width;
    70 cWaveWidth:= SpritesData[sprWater].Width;
    71 //cWaveHeight:= SpritesData[sprWater].Height;
    71 //cWaveHeight:= SpritesData[sprWater].Height;
   721 if WorldDy < wdy then WorldDy:= wdy;
   721 if WorldDy < wdy then WorldDy:= wdy;
   722 if WorldDx < - LAND_WIDTH - 1024 then WorldDx:= - LAND_WIDTH - 1024;
   722 if WorldDx < - LAND_WIDTH - 1024 then WorldDx:= - LAND_WIDTH - 1024;
   723 if WorldDx > 1024 then WorldDx:= 1024;
   723 if WorldDx > 1024 then WorldDx:= 1024;
   724 end;
   724 end;
   725 
   725 
   726 initialization
   726 procedure init_uWorld;
   727 FillChar(Captions, sizeof(Captions), 0)
   727 begin
       
   728 	fpsTexture:= nil;
       
   729 	FollowGear:= nil;
       
   730 	WindBarWidth:= 0;
       
   731 	bShowAmmoMenu:= false;
       
   732 	bSelected:= false;
       
   733 	bShowFinger:= false;
       
   734 	Frames:= 0;
       
   735 	
       
   736 	FillChar(Captions, sizeof(Captions), 0)
       
   737 end;
   728 
   738 
   729 end.
   739 end.