hedgewars/uStore.pas
changeset 2958 e6f7620da87e
parent 2948 3f21a9dc93d0
child 3006 da6023c2745b
equal deleted inserted replaced
2957:8f3f2a220835 2958:e6f7620da87e
    56 procedure DrawRotatedTextureF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real);
    56 procedure DrawRotatedTextureF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real);
    57 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
    57 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
    58 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
    58 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
    59 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
    59 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
    60 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    60 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
       
    61 procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    61 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    62 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    62 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    63 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    63 procedure DrawFillRect(r: TSDL_Rect);
    64 procedure DrawFillRect(r: TSDL_Rect);
    64 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
    65 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
    65 function  CheckCJKFont(s: ansistring; font: THWFont): THWFont;
    66 function  CheckCJKFont(s: ansistring; font: THWFont): THWFont;
   446 IMG_Quit();
   447 IMG_Quit();
   447 {$ENDIF}
   448 {$ENDIF}
   448 end;
   449 end;
   449 
   450 
   450 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
   451 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
       
   452 begin
       
   453 DrawFromRect(X, Y, r^.w, r^.h, r, SourceTexture)
       
   454 end;
       
   455 
       
   456 procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
   451 var rr: TSDL_Rect;
   457 var rr: TSDL_Rect;
   452     _l, _r, _t, _b: real;
   458     _l, _r, _t, _b: real;
   453     VertexBuffer, TextureBuffer: array [0..3] of TVertex2f;
   459     VertexBuffer, TextureBuffer: array [0..3] of TVertex2f;
   454 begin
   460 begin
   455 if (SourceTexture^.h = 0) or (SourceTexture^.w = 0) then exit;
   461 if (SourceTexture^.h = 0) or (SourceTexture^.w = 0) then exit;
   456 rr.x:= X;
   462 rr.x:= X;
   457 rr.y:= Y;
   463 rr.y:= Y;
   458 rr.w:= r^.w;
   464 rr.w:= W;
   459 rr.h:= r^.h;
   465 rr.h:= H;
   460 
   466 
   461 _l:= r^.x / SourceTexture^.w * SourceTexture^.rx;
   467 _l:= r^.x / SourceTexture^.w * SourceTexture^.rx;
   462 _r:= (r^.x + r^.w) / SourceTexture^.w * SourceTexture^.rx;
   468 _r:= (r^.x + r^.w) / SourceTexture^.w * SourceTexture^.rx;
   463 _t:= r^.y / SourceTexture^.h * SourceTexture^.ry;
   469 _t:= r^.y / SourceTexture^.h * SourceTexture^.ry;
   464 _b:= (r^.y + r^.h) / SourceTexture^.h * SourceTexture^.ry;
   470 _b:= (r^.y + r^.h) / SourceTexture^.h * SourceTexture^.ry;