From 958f6b5bd834121362183f33cabd1d75290429ab Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 22 Apr 2012 23:35:16 +0000 Subject: misc --- gui.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gui.c') 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 -- cgit v1.2.3