]>
git.r.bdr.sh - rbdr/pico-engine/blob - gfx.cpp
3 /*Draws a rectangular surface (specify only the x and y)*/
4 void Gfx::drawsurface(SDL_Surface
*src
, int dx
, int dy
, SDL_Surface
*dst
)
8 dst_rect
.x
= dx
; dst_rect
.y
= dy
;
9 SDL_BlitSurface(src
, NULL
, dst
, &dst_rect
);
12 /*Draws a rectangular surface from sx,sy of swxsh dimensions to dx, dy*/
13 void Gfx::drawsurface(int sx
, int sy
, int sw
, int sh
, SDL_Surface
*src
,
14 int dx
, int dy
, SDL_Surface
*dst
)
16 SDL_Rect src_rect
, dst_rect
;
18 src_rect
.x
= sx
; src_rect
.y
= sy
;
19 src_rect
.w
= sw
; src_rect
.h
= sh
;
20 dst_rect
.x
= dx
; dst_rect
.y
= dy
;
21 SDL_BlitSurface(src
, &src_rect
, dst
, &dst_rect
);