Made image_setPixel() static inline; added image_setMaskPixel()

This commit is contained in:
rxi
2016-09-26 20:40:05 +01:00
parent 030695e0db
commit 5112373338

View File

@@ -12,12 +12,6 @@
#include "luaobj.h"
#define image_setPixel(self, x, y, color)\
if ((x) > 0 && (x) < (self)->width && (y) > 0 && (y) < (self)->height) {\
(self)->data[(x) + (y) * (self)->width] = (color);\
}
enum {
IMAGE_NORMAL,
IMAGE_FAST,
@@ -34,6 +28,20 @@ typedef struct {
} image_t;
static inline
void image_setPixel(image_t* self, int x, int y, pixel_t val) {
if (x > 0 && x < self->width && y > 0 && y < self->height) {
self->data[x + y * self->width] = val;
}
}
static inline
void image_setMaskPixel(image_t* self, int x, int y, pixel_t val) {
if (x > 0 && x < self->width && y > 0 && y < self->height) {
self->mask[x + y * self->width] = val;
}
}
void image_setColor(pixel_t color);
void image_setBlendMode(int mode);
void image_setFlip(int mode);