aboutsummaryrefslogtreecommitdiff
path: root/gui.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-04-22 23:35:16 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-04-22 23:35:16 +0000
commit958f6b5bd834121362183f33cabd1d75290429ab (patch)
tree320ff517e5b7d23c4a4ad20d0048d4e382abed34 /gui.c
parentf8b1782dba2462403f1df62ecd1f8d94068ece4e (diff)
misc
Diffstat (limited to 'gui.c')
-rw-r--r--gui.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gui.c b/gui.c
index b44a0ca..cd3384b 100644
--- a/gui.c
+++ b/gui.c
@@ -54,8 +54,17 @@ SDL_Color color[0x10] = {
void
setpixel(SDL_Surface *s, int x, int y, Uint8 c)
{
- Uint8 *buf = (Uint8 *)s->pixels + y * s->pitch + x;
- *buf = c;
+ Uint8 *p = (Uint8 *)s->pixels + y * s->pitch + x;
+
+ *p = c;
+}
+
+Uint8
+getpixel(SDL_Surface *s, int x, int y)
+{
+ Uint8 *p = (Uint8 *)s->pixels + y * s->pitch + x;
+
+ return *p;
}
void