haraldhv
/
aigo
Archived
1
0
Fork 0

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.
This commit is contained in:
Øystein Ingmar Skartsæterhagen 2007-02-23 17:41:14 +00:00
parent 932c8d0953
commit 826a2f41f6
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,11 @@
#include "settings.h" #include "settings.h"
#include <SDL/SDL.h> #include <SDL/SDL.h>
#include <stdint.h>
#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. * Describes the current state of a go board.