1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include "stdafx.h"
/*Draws a rectangular surface (specify only the x and y)*/
void Gfx::drawsurface(SDL_Surface *src, int dx, int dy, SDL_Surface *dst)
{
SDL_Rect dst_rect;
dst_rect.x = dx; dst_rect.y = dy;
SDL_BlitSurface(src, NULL, dst, &dst_rect);
}
/*Draws a rectangular surface from sx,sy of swxsh dimensions to dx, dy*/
void Gfx::drawsurface(int sx, int sy, int sw, int sh, SDL_Surface *src,
int dx, int dy, SDL_Surface *dst)
{
SDL_Rect src_rect, dst_rect;
src_rect.x = sx; src_rect.y = sy;
src_rect.w = sw; src_rect.h = sh;
dst_rect.x = dx; dst_rect.y = dy;
SDL_BlitSurface(src, &src_rect, dst, &dst_rect);
}
|