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:
parent
932c8d0953
commit
826a2f41f6
|
@ -3,6 +3,11 @@
|
|||
|
||||
#include "settings.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.
|
||||
|
|
Reference in New Issue