From 6f00bceb2f99f65d29baa60a218add615ec79489 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Tue, 5 Oct 2010 03:02:38 +0000 Subject: [PATCH] [CHG] Use M_PI instead of custom macro for PI in two examples --- examples/unlimited2d/source/main.c | 6 ++-- examples/unlimited3d/source/main.c | 54 ++++++++++++++---------------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/examples/unlimited2d/source/main.c b/examples/unlimited2d/source/main.c index 3848db8..55925ed 100644 --- a/examples/unlimited2d/source/main.c +++ b/examples/unlimited2d/source/main.c @@ -14,8 +14,6 @@ #include "gfx/font.h" #include "gfx/ball.h" -#define PI 3.14159265358979323846F - extern GXRModeObj *rmode; int main() { @@ -77,12 +75,12 @@ int main() { spr+=0.1f; t+=0.01f; - if(t>n*2*PI) { + if(t>n*2*M_PI) { n++; f+=0.01f; } - if(f>2*PI) { + if(f>2*M_PI) { f=0; ff+=0.02f; } diff --git a/examples/unlimited3d/source/main.c b/examples/unlimited3d/source/main.c index 0c9eb31..23174fc 100644 --- a/examples/unlimited3d/source/main.c +++ b/examples/unlimited3d/source/main.c @@ -14,8 +14,6 @@ #include "gfx/logo.h" #include "gfx/font.h" -#define PI 3.14159265358979323846F - extern GXRModeObj *rmode; @@ -84,81 +82,81 @@ int main() { GRRLIB_SetTexture(tex_girl, 0); GX_Begin(GX_QUADS, GX_VTXFMT0, 24); GX_Position3f32(-1.0f,1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,0.0f); GX_Position3f32(1.0f,1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,0.0f); GX_Position3f32(1.0f,-1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,1.0f); GX_Position3f32(1.0f,1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,0.0f); GX_Position3f32(-1.0f,1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,0.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,0.0f); GX_Position3f32(1.0f,1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,0.0f); GX_Position3f32(1.0f,-1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,0.0f); GX_Position3f32(-1.0f,1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,0.0f); GX_Position3f32(-1.0f,-1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,0.0f); GX_Position3f32(1.0f,1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,0.0f); GX_Position3f32(1.0f,1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,0.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,0.0f); GX_Position3f32(-1.0f,-1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f); - GX_Color1u32(0xFFFFFFFF); + GX_Color1u32(0xFFFFFFFF); GX_TexCoord2f32(0.0f,1.0f); GX_End(); @@ -175,12 +173,12 @@ int main() { spr+=0.1f; t+=0.01f; - if(t>n*2*PI) { + if(t>n*2*M_PI) { n++; f+=0.01f; } - if(f>2*PI) { + if(f>2*M_PI) { f=0; ff+=0.02f; }