From 7b0feb4c5cbdb555607f639235b90a3d4788ccfc Mon Sep 17 00:00:00 2001 From: masterzorag Date: Wed, 18 Oct 2017 16:28:54 +0200 Subject: [PATCH 1/2] Update orbis2dDrawPixelColor --- liborbis2d/source/orbis2d.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/liborbis2d/source/orbis2d.c b/liborbis2d/source/orbis2d.c index aa77cd0..7794345 100755 --- a/liborbis2d/source/orbis2d.c +++ b/liborbis2d/source/orbis2d.c @@ -172,14 +172,13 @@ void orbis2dStartDrawing() void orbis2dDrawPixelColor(int x, int y, uint32_t pixelColor) { - int color; - int pixel = (y * orbconf->pitch) + x; - - color=pixelColor; - - - ((uint32_t *)orbconf->surfaceAddr[orbconf->currentBuffer])[pixel]=color; + if((x > -1 && x < ATTR_WIDTH) + && (y > -1 && y < ATTR_HEIGHT)) + { + int pixel = (y * orbconf->pitch) + x; + ((uint32_t *)orbconf->surfaceAddr[orbconf->currentBuffer])[pixel] = pixelColor; + } } void orbis2dPutImage(uint32_t *buf,int x, int y, int w, int h) { From 8d12289a7396a08b3879fcd314d3aafea2c026c4 Mon Sep 17 00:00:00 2001 From: masterzorag Date: Mon, 23 Oct 2017 12:30:26 +0200 Subject: [PATCH 2/2] Fix location of event header --- liborbis2d/source/orbis2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liborbis2d/source/orbis2d.c b/liborbis2d/source/orbis2d.c index 7794345..b1b8f5f 100755 --- a/liborbis2d/source/orbis2d.c +++ b/liborbis2d/source/orbis2d.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include