From 826a2f41f6995b82e31b26a308d9c767e5345220 Mon Sep 17 00:00:00 2001 From: oysteini Date: Fri, 23 Feb 2007 17:41:14 +0000 Subject: [PATCH] Macros for treatment of pixels in SDL_Surface. Need to find best way of getting an int type which is guaranteed to use exactly 32 bit. --- lib/state.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/state.h b/lib/state.h index 6f960b7..8de4dd0 100644 --- a/lib/state.h +++ b/lib/state.h @@ -3,6 +3,11 @@ #include "settings.h" #include +#include + +#define PX_(p, x, y, w, h) ((p)[(x)+(y)*(w)]) +#define PX(i,x,y) (PX_((uint32_t*)(i)->pixels, (x), (y), (i)->w, (i)->h)) +#define iter_pixels(s,x,y) for (x = 0; x < s->w; x++) for (y = 0; y < s->h; y++) /** * Describes the current state of a go board.