hedgewars/uWorld.pas
changeset 1753 2ccba26f1aa4
parent 1689 3d0eee01f734
child 1760 55a1edd97911
equal deleted inserted replaced
1752:769986d39202 1753:2ccba26f1aa4
    62 cWaterSprCount:= 1 + cScreenWidth div (SpritesData[sprWater].Width);
    62 cWaterSprCount:= 1 + cScreenWidth div (SpritesData[sprWater].Width);
    63 cGearScrEdgesDist:= Min(cScreenWidth div 2 - 100, cScreenHeight div 2 - 50);
    63 cGearScrEdgesDist:= Min(cScreenWidth div 2 - 100, cScreenHeight div 2 - 50);
    64 SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    64 SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    65 prevPoint.X:= cScreenWidth div 2;
    65 prevPoint.X:= cScreenWidth div 2;
    66 prevPoint.Y:= cScreenHeight div 2;
    66 prevPoint.Y:= cScreenHeight div 2;
    67 WorldDx:=  - 1024 + cScreenWidth div 2;
    67 WorldDx:=  - (LAND_WIDTH shr 1) + cScreenWidth div 2;
    68 WorldDy:=  - 512 + cScreenHeight div 2;
    68 WorldDy:=  - (LAND_HEIGHT shr 1) + cScreenHeight div 2;
    69 AMxShift:= 210
    69 AMxShift:= 210
    70 end;
    70 end;
    71 
    71 
    72 procedure ShowAmmoMenu;
    72 procedure ShowAmmoMenu;
    73 const MENUSPEED = 15;
    73 const MENUSPEED = 15;
   175     begin
   175     begin
   176     w:= SpritesData[spr].Width;
   176     w:= SpritesData[spr].Width;
   177     i:= Shift mod w;
   177     i:= Shift mod w;
   178     if i > 0 then dec(i, w);
   178     if i > 0 then dec(i, w);
   179     repeat
   179     repeat
   180       DrawSprite(spr, i, WorldDy + 1024 - SpritesData[spr].Height, 0);
   180       DrawSprite(spr, i, WorldDy + LAND_HEIGHT + 1 - SpritesData[spr].Height, 0);
   181       inc(i, w)
   181       inc(i, w)
   182     until i > cScreenWidth
   182     until i > cScreenWidth
   183     end;
   183     end;
   184 
   184 
   185 begin
   185 begin
   489       end;
   489       end;
   490 
   490 
   491 if cHasFocus then SDL_WarpMouse(CursorPoint.X, CursorPoint.Y);
   491 if cHasFocus then SDL_WarpMouse(CursorPoint.X, CursorPoint.Y);
   492 prevPoint:= CursorPoint;
   492 prevPoint:= CursorPoint;
   493 if WorldDy < cScreenHeight - cWaterLine - cVisibleWater then WorldDy:= cScreenHeight - cWaterLine - cVisibleWater;
   493 if WorldDy < cScreenHeight - cWaterLine - cVisibleWater then WorldDy:= cScreenHeight - cWaterLine - cVisibleWater;
   494 if WorldDy >  2048 then WorldDy:=  2048;
   494 if WorldDy >  LAND_HEIGHT then WorldDy:=  LAND_HEIGHT;
   495 if WorldDx < -2048 then WorldDx:= -2048;
   495 if WorldDx < -LAND_WIDTH then WorldDx:= -LAND_WIDTH;
   496 if WorldDx > cScreenWidth then WorldDx:=  cScreenWidth;
   496 if WorldDx > cScreenWidth then WorldDx:=  cScreenWidth;
   497 end;
   497 end;
   498 
   498 
   499 initialization
   499 initialization
   500 FillChar(Captions, sizeof(Captions), 0)
   500 FillChar(Captions, sizeof(Captions), 0)