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