From 0d0ae2ca979c61f25ca8001a64a4b37e5bed6115 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Thu, 3 Dec 2009 00:08:19 +0000 Subject: [PATCH] [NEW] Added a define with the version as a string (GRRLIB_VER_STRING) --- GRRLIB/GRRLIB/GRRLIB_core.c | 5 ++--- GRRLIB/GRRLIB/grrlib.h | 7 ++++++- examples/lesson1/source/main.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/GRRLIB/GRRLIB/GRRLIB_core.c b/GRRLIB/GRRLIB/GRRLIB_core.c index 6fe1fac..d226988 100644 --- a/GRRLIB/GRRLIB/GRRLIB_core.c +++ b/GRRLIB/GRRLIB/GRRLIB_core.c @@ -48,9 +48,6 @@ int GRRLIB_Init (void) { u32 xfbHeight; Mtx44 perspective; s8 error_code = 0; - - //just to get the GRRLIB version in the dol ;) - if(1){ printf("GRRLIB 4.1.2"); } // Ensure this function is only ever called once if (is_setup) return 0 ; @@ -114,6 +111,8 @@ int GRRLIB_Init (void) { GX_SetDispCopyGamma(GX_GM_1_0); + if(rmode->fbWidth <= 0){ printf("GRRLIB " GRRLIB_VER_STRING); } + // Setup the vertex descriptor GX_ClearVtxDesc(); // clear all the vertex descriptors GX_InvVtxCache(); // Invalidate the vertex cache diff --git a/GRRLIB/GRRLIB/grrlib.h b/GRRLIB/GRRLIB/grrlib.h index bf1a62e..ff16979 100644 --- a/GRRLIB/GRRLIB/grrlib.h +++ b/GRRLIB/GRRLIB/grrlib.h @@ -28,6 +28,11 @@ THE SOFTWARE. #ifndef __GRRLIB_H__ #define __GRRLIB_H__ +/** + * Version information for GRRLIB. + */ +#define GRRLIB_VER_STRING "4.1.2" + //============================================================================== // Includes //============================================================================== @@ -197,7 +202,7 @@ typedef struct tagRGBQUAD { GRR_EXTERN GXRModeObj *rmode; GRR_EXTERN void *xfb[2] GRR_INITS(NULL, NULL); GRR_EXTERN u32 fb GRR_INIT(0); -GRR_EXTERN void *TrashTex; +GRR_EXTERN void *TrashTex; //============================================================================== // procedure and function prototypes // Inline function handling - http://www.greenend.org.uk/rjk/2003/03/inline.html diff --git a/examples/lesson1/source/main.c b/examples/lesson1/source/main.c index 1c33937..bad76d9 100644 --- a/examples/lesson1/source/main.c +++ b/examples/lesson1/source/main.c @@ -155,7 +155,7 @@ int main() { GRRLIB_Plot(ir1.sx + 1, ir1.sy + 1, GRRLIB_YELLOW); break; default: // Print some text - GRRLIB_Printf(5, 25, tex_BMfont2, GRRLIB_WHITE, 1, "TEXT DEMO"); + GRRLIB_Printf(5, 25, tex_BMfont2, GRRLIB_WHITE, 1, "GRRLIB %s TEXT DEMO", GRRLIB_VER_STRING); GRRLIB_Printf(5, 100, tex_BMfont4, GRRLIB_WHITE, 1, "TO QUIT PRESS THE HOME BUTTON."); GRRLIB_Printf(5, 140, tex_BMfont4, GRRLIB_YELLOW, 1, "USE + OR - TO MOVE ACROSS PAGES.");