From 5f57f2e3467ac8b698e956473a010290cc0a39c8 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Mon, 16 Feb 2009 04:38:16 +0000 Subject: [PATCH] [NEW] GRRLIB_BMFX_FlipH and GRRLIB_BMFX_FlipV for flipping a texture --- GRRLIB/GRRLIB/GRRLIB.c | 34 ++++++++++++++++++++++++++++++++++ GRRLIB/GRRLIB/GRRLIB.h | 2 ++ examples/lesson2/source/main.c | 30 ++++++++++++++++++++++++++---- readme.txt | 10 ++++++++-- 4 files changed, 70 insertions(+), 6 deletions(-) diff --git a/GRRLIB/GRRLIB/GRRLIB.c b/GRRLIB/GRRLIB/GRRLIB.c index 138a9da..c46d9e6 100644 --- a/GRRLIB/GRRLIB/GRRLIB.c +++ b/GRRLIB/GRRLIB/GRRLIB.c @@ -551,6 +551,40 @@ void GRRLIB_BMFX_Invert(GRRLIB_texImg texsrc, GRRLIB_texImg texdest) { } } +/** + * Flip texture horizontal. + * @see GRRLIB_FlushTex + * @param texsrc the texture source. + * @param texdest the texture destination. + */ +void GRRLIB_BMFX_FlipH(GRRLIB_texImg texsrc, GRRLIB_texImg texdest) { + unsigned int x, y, txtWidth = texsrc.w - 1; + + for(y=0; y 5) page = 0; + if(page > 6) page = 0; } } GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB free(tex_pirate.data); free(tex_gray.data); free(tex_invert.data); + free(tex_fliph.data); + free(tex_flipv.data); + free(tex_fliphv.data); free(tex_blur1.data); free(tex_blur2.data); free(tex_blur3.data); diff --git a/readme.txt b/readme.txt index 1950aec..0b7c6b9 100644 --- a/readme.txt +++ b/readme.txt @@ -56,7 +56,14 @@ ChangeLog : * GRRLIB_CreateEmptyTexture and GRRLIB_FlushTex -* New Bitmap FX: GRRLIB_BMFX_Grayscale, GRRLIB_BMFX_Invert, GRRLIB_BMFX_Scatter, GRRLIB_BMFX_Blur, GRRLIB_BMFX_Pixelate +* New Bitmap FX: + - GRRLIB_BMFX_Grayscale + - GRRLIB_BMFX_Invert + - GRRLIB_BMFX_FlipH + - GRRLIB_BMFX_FlipV + - GRRLIB_BMFX_Scatter + - GRRLIB_BMFX_Blur + - GRRLIB_BMFX_Pixelate * add GRRLIB_Exit to free the memory allocated by GRRLIB @@ -69,4 +76,3 @@ Contact me to provide me all your patch/addon/new functions... NoNameNo. -