diff options
| author | Ben Beltran <ben@nsovocal.com> | 2012-04-16 09:39:52 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2012-04-16 09:39:52 -0500 |
| commit | 10a0e290ac07524dc129cc2b227b0f9e95df0f8e (patch) | |
| tree | ed518c45c45d96e37e28640f745496fffb8e1325 /gfx.cpp | |
first commit
Diffstat (limited to 'gfx.cpp')
| -rwxr-xr-x | gfx.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,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);
+
+
+}
\ No newline at end of file |