From 03ca45bf76c168b54cdeeb0e78574b3e15530dad Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Thu, 22 Jan 2009 23:21:55 +0000 Subject: [PATCH] [CHG] Added some defines for colours in the template [NEW] Documentation main page --- template/source/GRRLIB/GRRLIB.c | 19 ++++++++++--------- template/source/GRRLIB/GRRLIB.h | 6 ++++++ template/source/main.c | 22 ++++++++++++++++------ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/template/source/GRRLIB/GRRLIB.c b/template/source/GRRLIB/GRRLIB.c index 289b4ed..0eeca9c 100644 --- a/template/source/GRRLIB/GRRLIB.c +++ b/template/source/GRRLIB/GRRLIB.c @@ -258,10 +258,10 @@ GRRLIB_texImg GRRLIB_LoadTextureJPG(const unsigned char my_jpg[]) { /** * Draw a texture. - * @param xpos - * @param ypos - * @param tex - * @param degrees + * @param xpos specifies the x-coordinate of the upper-left corner. + * @param ypos specifies the y-coordinate of the upper-left corner. + * @param tex texture to draw. + * @param degrees angle of rotation. * @param scaleX * @param scaleY * @param color @@ -315,10 +315,10 @@ inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees, /** * Draw a tile. - * @param xpos - * @param ypos - * @param tex - * @param degrees + * @param xpos specifies the x-coordinate of the upper-left corner. + * @param ypos specifies the y-coordinate of the upper-left corner. + * @param tex texture to draw. + * @param degrees angle of rotation. * @param scaleX * @param scaleY * @param color @@ -436,7 +436,8 @@ void GRRLIB_GXEngine(Vector v[], u32 color, long n, u8 fmt) { } /** - * Initialize GRRLIB. + * Initialize GRRLIB. Call this at the beginning your code. + * @see GRRLIB_Exit */ void GRRLIB_Init() { f32 yscale; diff --git a/template/source/GRRLIB/GRRLIB.h b/template/source/GRRLIB/GRRLIB.h index 6734269..d16bdf0 100644 --- a/template/source/GRRLIB/GRRLIB.h +++ b/template/source/GRRLIB/GRRLIB.h @@ -74,3 +74,9 @@ void GRRLIB_Exit(); #endif /* __cplusplus */ #endif + +/** + * @mainpage GRRLIB Documentation + * @image html grrlib_logo.png + * Welcome to the GRRLIB documentation. + */ diff --git a/template/source/main.c b/template/source/main.c index 12c931b..206f006 100644 --- a/template/source/main.c +++ b/template/source/main.c @@ -19,6 +19,16 @@ #include "gfx/BMfont4.h" #include "gfx/test_jpg.h" +// RGBA Colors +#define GRRLIB_BLACK 0x000000FF +#define GRRLIB_WHITE 0xFFFFFFFF +#define GRRLIB_RED 0xFF0000FF +#define GRRLIB_BLUE 0x0000FFFF +#define GRRLIB_GREEN 0x008000FF +#define GRRLIB_GRAY 0x808080FF +#define GRRLIB_YELLOW 0xFFFF00FF +#define GRRLIB_SILVER 0xC0C0C0FF + Mtx GXmodelView2D; int main() { @@ -55,14 +65,14 @@ int main() { WPAD_IR(WPAD_CHAN_0, &ir1); - GRRLIB_FillScreen(0x000000FF); + GRRLIB_FillScreen(GRRLIB_BLACK); - GRRLIB_DrawImg(10, 10, tex_test_jpg, 0, 1, 1, 0xFFFFFFFF); + GRRLIB_DrawImg(10, 10, tex_test_jpg, 0, 1, 1, GRRLIB_WHITE); - GRRLIB_Printf(left, 200, tex_BMfont1, 0xFFFFFFFF, 1, "X VALUE:%d", (int)ir1.sx); - GRRLIB_Printf(left, 250, tex_BMfont4, 0xFFFFFFFF, 1, "X VALUE:%d", (int)ir1.sx); - GRRLIB_Printf(left, 300, tex_BMfont3, 0xFFFFFFFF, 1, "X VALUE : %d", tex_test_jpg.w); - GRRLIB_Printf(left, 350, tex_BMfont2, 0xFFFFFFFF, 1, "X VALUE : 1"); + GRRLIB_Printf(left, 200, tex_BMfont1, GRRLIB_WHITE, 1, "X VALUE:%d", (int)ir1.sx); + GRRLIB_Printf(left, 250, tex_BMfont4, GRRLIB_WHITE, 1, "X VALUE:%d", (int)ir1.sx); + GRRLIB_Printf(left, 300, tex_BMfont3, GRRLIB_WHITE, 1, "X VALUE : %d", tex_test_jpg.w); + GRRLIB_Printf(left, 350, tex_BMfont2, GRRLIB_WHITE, 1, "X VALUE : 1"); GRRLIB_Render();