hedgewars/uStore.pas
changeset 1939 4b8e4cd9e7c0
parent 1916 9c3d0e3df6bb
child 1989 129e8c4fe554
equal deleted inserted replaced
1938:da7f27122fd2 1939:4b8e4cd9e7c0
    31 procedure StoreLoad;
    31 procedure StoreLoad;
    32 procedure StoreRelease;
    32 procedure StoreRelease;
    33 procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
    33 procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
    34 procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
    34 procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
    35 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
    35 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
       
    36 procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt);
    36 procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture);
    37 procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture);
    37 procedure DrawTexture(X, Y: LongInt; Texture: PTexture);
    38 procedure DrawTexture(X, Y: LongInt; Texture: PTexture);
    38 procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, Frames: LongInt);
    39 procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, Frames: LongInt);
    39 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
    40 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
    40 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
    41 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
   265 LoadGraves;
   266 LoadGraves;
   266 
   267 
   267 AddProgress;
   268 AddProgress;
   268 for ii:= Low(TSprite) to High(TSprite) do
   269 for ii:= Low(TSprite) to High(TSprite) do
   269 	with SpritesData[ii] do
   270 	with SpritesData[ii] do
       
   271         if (not cReducedQuality) or 
       
   272            ((ii <> sprSky) and (ii <> sprHorizont) and (ii <> sprFlake)) then
   270 			begin
   273 			begin
   271 			if AltPath = ptNone then
   274 			if AltPath = ptNone then
   272 				tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, true, true, true)
   275 				tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, true, true, true)
   273 			else begin
   276 			else begin
   274 				tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, true, false, true);
   277 				tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, true, false, true);
   505 r.y:= Frame * SpritesData[Sprite].Height;
   508 r.y:= Frame * SpritesData[Sprite].Height;
   506 r.h:= SpritesData[Sprite].Height;
   509 r.h:= SpritesData[Sprite].Height;
   507 DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
   510 DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
   508 end;
   511 end;
   509 
   512 
       
   513 procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt);
       
   514 var r: TSDL_Rect;
       
   515 begin
       
   516 r.x:= 0;
       
   517 r.y:= 0;
       
   518 r.w:= SpritesData[Sprite].Width;
       
   519 r.h:= SpritesData[Sprite].Height;
       
   520 
       
   521 if (X < LeftX) then
       
   522     r.x:= LeftX - X;
       
   523 if (Y < TopY) then
       
   524     r.y:= TopY - Y;
       
   525 
       
   526 if (Y + SpritesData[Sprite].Height > BottomY) then
       
   527     r.h:= BottomY - Y + 1;
       
   528 if (X + SpritesData[Sprite].Width > RightX) then
       
   529     r.w:= RightX - X + 1;
       
   530 
       
   531 dec(r.h, r.y);
       
   532 dec(r.w, r.x);
       
   533 
       
   534 DrawFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture)
       
   535 end;
       
   536 
   510 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
   537 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
   511 var r: TSDL_Rect;
   538 var r: TSDL_Rect;
   512 begin
   539 begin
   513 r.x:= FrameX * SpritesData[Sprite].Width;
   540 r.x:= FrameX * SpritesData[Sprite].Width;
   514 r.w:= SpritesData[Sprite].Width;
   541 r.w:= SpritesData[Sprite].Width;