This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, generate has been updated via c019f09ad68b300c79e25e59465f0a80ef999c7c (commit) from bdecc49ad74d5d50032ba686e53eb98c5bec913e (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/c019f09ad68b300c79e25e59465f0a80ef999...
commit c019f09ad68b300c79e25e59465f0a80ef999c7c Author: Cyril Hrubis metan@ucw.cz Date: Sun Aug 28 11:35:34 2011 +0200
Fixed the clipping for the time being.
Added GP_PutPixel_Raw_Clipped_xxx and changed gfx primitives to use it.
diff --git a/include/core/GP_Context.h b/include/core/GP_Context.h index e5f62bf..bd53482 100644 --- a/include/core/GP_Context.h +++ b/include/core/GP_Context.h @@ -83,8 +83,8 @@ static inline GP_PixelType GP_GetContextPixelType(const GP_Context *context) * Is true, when pixel is clipped out of context. */ #define GP_PIXEL_IS_CLIPPED(context, x, y) - ((x) < 0 || x >= (int) context->w - || (y) < 0 || y >= (int) context->h) + ((x) < 0 || x >= (typeof(x)) context->w + || (y) < 0 || y >= (typeof(y)) context->h) /* * Allocate context. diff --git a/include/core/GP_DefFnPerBpp.h b/include/core/GP_DefFnPerBpp.h index bedc3b0..277c956 100644 --- a/include/core/GP_DefFnPerBpp.h +++ b/include/core/GP_DefFnPerBpp.h @@ -31,7 +31,7 @@ #define GP_DEF_FN_PER_BPP_H
#define GP_DEF_DRAW_FN_PER_BPP(fname, MACRO_NAME) - GP_DEF_FN_PER_BPP(fname, MACRO_NAME, GP_PutPixel_Raw_) + GP_DEF_FN_PER_BPP(fname, MACRO_NAME, GP_PutPixel_Raw_Clipped_)
#define GP_DEF_FILL_FN_PER_BPP(fname, MACRO_NAME) GP_DEF_FN_PER_BPP(fname, MACRO_NAME, GP_HLine_Raw_) diff --git a/include/core/GP_GetPutPixel.gen.h.t b/include/core/GP_GetPutPixel.gen.h.t index c29ae57..ee1ea90 100644 --- a/include/core/GP_GetPutPixel.gen.h.t +++ b/include/core/GP_GetPutPixel.gen.h.t @@ -8,8 +8,7 @@ Do not include directly, use GP_Pixel.h %% block body
#include "GP_Common.h" - -struct GP_Context; +#include "GP_Context.h"
%% for ps in pixelsizes /* @@ -68,6 +67,14 @@ static inline void GP_PutPixel_Raw_{{ ps.suffix }}(GP_Context *c, int x, int y, %% endif }
+static inline void GP_PutPixel_Raw_Clipped_{{ ps.suffix }}(GP_Context *c, GP_Coord x, GP_Coord y, GP_Pixel p) +{ + if (GP_PIXEL_IS_CLIPPED(c, x, y)) + return; + + GP_PutPixel_Raw_{{ ps.suffix }}(c, x, y, p); +} + %% endfor
%% endblock body diff --git a/tests/SDL/subcontext.c b/tests/SDL/subcontext.c index 963e8e8..cbe110e 100644 --- a/tests/SDL/subcontext.c +++ b/tests/SDL/subcontext.c @@ -48,7 +48,7 @@ Uint32 timer_callback(__attribute__((unused)) Uint32 interval, { timer_event.type = SDL_USEREVENT; SDL_PushEvent((SDL_Event *) &timer_event); - return 10; + return 30; }
static void draw_line(GP_Context *dest, GP_Coord x, GP_Coord y,
-----------------------------------------------------------------------
Summary of changes: include/core/GP_Context.h | 4 ++-- include/core/GP_DefFnPerBpp.h | 2 +- include/core/GP_GetPutPixel.gen.h.t | 11 +++++++++-- tests/SDL/subcontext.c | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.