changeset 20:b1ba4dad7f6e

*** empty log message ***
author gongo
date Sat, 04 Nov 2006 12:31:22 +0000
parents 8ab79a86aa73
children 447281fe6845
files car.c col.c schedule.c
diffstat 3 files changed, 36 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/car.c	Sat Nov 04 09:13:06 2006 +0000
+++ b/car.c	Sat Nov 04 12:31:22 2006 +0000
@@ -305,6 +305,3 @@
     fprintf(main_fp, "free car addr = %x\n", (int)p->free_addr);
 #endif
 }
-
-
-
--- a/col.c	Sat Nov 04 09:13:06 2006 +0000
+++ b/col.c	Sat Nov 04 12:31:22 2006 +0000
@@ -7,7 +7,7 @@
 #include"col.h"
 #include"mytype.h"
 
-/*
+/**
  * v0, v1が描く三角形と点pの内外判定(approx detection)
  * 点pはv0, v1が描く面のどこかに位置している。
  * pが面の三角形の外側にあるときTRUEを戻し、
@@ -16,20 +16,20 @@
 static Bool
 col_detect_approx(FVECTOR p, FVECTOR v0, FVECTOR v1)
 {
-	float v_r1, v_r2, r1_r2, r1_r1, r2_r2;
-	float a, b, r;
+    float v_r1, v_r2, r1_r2, r1_r1, r2_r2;
+    float a, b, r;
 
-	v_r1  = ps2_vu0_inner_product( p,  v0 );
-	v_r2  = ps2_vu0_inner_product( p,  v1 );
-	r1_r2 = ps2_vu0_inner_product( v0, v1 );
-	r1_r1 = ps2_vu0_inner_product( v0, v0 );
-	r2_r2 = ps2_vu0_inner_product( v1, v1 );
+    v_r1  = ps2_vu0_inner_product( p,  v0 );
+    v_r2  = ps2_vu0_inner_product( p,  v1 );
+    r1_r2 = ps2_vu0_inner_product( v0, v1 );
+    r1_r1 = ps2_vu0_inner_product( v0, v0 );
+    r2_r2 = ps2_vu0_inner_product( v1, v1 );
 
-	a = (v_r1  * r2_r2 - v_r2  * r1_r2);
-	b = (v_r2  * r1_r1 - v_r1  * r1_r2);
-	r = (r1_r1 * r2_r2 - r1_r2 * r1_r2);
+    a = (v_r1  * r2_r2 - v_r2  * r1_r2);
+    b = (v_r2  * r1_r1 - v_r1  * r1_r2);
+    r = (r1_r1 * r2_r2 - r1_r2 * r1_r2);
 
-	return (a>=0 && b>=0 && a+b-r<=0) ? TRUE : FALSE;
+    return (a>=0 && b>=0 && a+b-r<=0) ? TRUE : FALSE;
 }
 
 /**
@@ -81,7 +81,7 @@
 	}
     }
     return FALSE;
-  NOCOLLISION:
+NOCOLLISION:
     ps2_vu0_copy_vector(p, o);
     ps2_vu0_copy_vector(pose, col_face[i].normal);
     return TRUE;
--- a/schedule.c	Sat Nov 04 09:13:06 2006 +0000
+++ b/schedule.c	Sat Nov 04 12:31:22 2006 +0000
@@ -27,13 +27,6 @@
 #define SP_SEL_CAR    50
 #define SP_SEL_COURSE 80
 
-/* timer */
-static int start_time,time_count;
-static int RUNNIG=0;
-char raptime[10];
-
-  
-
 extern int car_check();
 /* --- controler.c --- */
 extern SGO_PAD pad;
@@ -61,6 +54,10 @@
 /* --- linda.c --- */
 extern void linda_jikiInfo_init();
 
+/* timer */
+static int start_time,time_count;
+static int RUNNIG=0;
+char raptime[10];
 
 static int ranking = 0;
 static LIGHT l;
@@ -68,7 +65,7 @@
 static int i=0;
 
 void
-set_sche(void *func)
+set_schedule(void *func)
 {
     game.exec = func;
 }
@@ -131,7 +128,7 @@
     graphic_init();
     camera_init();
 
-    set_sche(sche_game_opening);
+    set_schedule(sche_game_opening);
 }
 
 void
@@ -142,11 +139,11 @@
 	if (blink_count < 35) {
 	    gFont_SetString("PUSH START !!", 170, 380);
 	}
-	blink_count = (blink_count > 70) ? 0 : blink_count+1;
+	blink_count = (blink_count > 70) ? 0 : blink_count + 1;
     }
 
     if (pad.st == 1) {
-	set_sche(sche_game_select_car);
+	set_schedule(sche_game_select_car);
     }
 
     /*
@@ -183,7 +180,7 @@
 	    (game.car_id < 2) ? MAXCAR : game.car_id - 1;
     }
     if (pad.circle == 1) {
-	set_sche(sche_game_select_course);
+	set_schedule(sche_game_select_course);
     }
 }
 
@@ -205,7 +202,7 @@
 	    (game.course_id < 2) ? MAXFIELD : game.course_id - 1;
     }
     if (pad.circle == 1) {
-	set_sche(sche_game_ready);
+	set_schedule(sche_game_ready);
     }
 }
 
@@ -225,10 +222,10 @@
     blink_count = (blink_count > 70) ? 0 : blink_count + 1;
 
     if (pad.st > 0) {
-	set_sche(sche_game_main_init);
+	set_schedule(sche_game_main_init);
     }
     if (pad.cross > 0) {
-	set_sche(sche_game_select_car);
+	set_schedule(sche_game_select_car);
     }
 }
 
@@ -238,7 +235,7 @@
     if (!game.jiki)
 	play_init();
     RUNNIG=0;
-    set_sche(sche_game_main);
+    set_schedule(sche_game_main);
 }
 
 void
@@ -264,7 +261,7 @@
     field_update(game.jiki);
     camera_update(game.jiki->body->transfer);
     carNode_draw();
-      
+
     gFont_SetStringInt(game.rap, 50, 100);
 
     /* スピードメーター */
@@ -276,13 +273,12 @@
     gSprite_PutSprite(27, 80, 100);
 
     if (game.rap > MAXRAP) {
-	wait_init();
 	ranking = 1;
-	set_sche(sche_game_main_goal);
+	set_schedule(sche_game_main_goal);
     }
 
     gFont_SetStringInt((int)(100.0*game.jiki->speed), 380, 350);
-      
+
     if ((pad.right > 0) && ((game.jiki->speed != 0) || (pad.circle > 0))) {
 	car_swerve(game.jiki, 1);
     }
@@ -295,11 +291,12 @@
     if (pad.cross > 0) {
 	car_accelerate(game.jiki, -1);
     }
+
     if (pad.r1 == 1) {
 	game.camera_type = !game.camera_type;
     }
     if (pad.st == 1) {
-	set_sche(sche_game_main_pause);
+	set_schedule(sche_game_main_pause);
     }
 }
 
@@ -321,13 +318,13 @@
 
     if (pad.circle == 1) {
 	if (game.select == 0) {
-	    set_sche(sche_game_main);
+	    set_schedule(sche_game_main);
 	} else {
-	    set_sche(sche_game_main_finish);
+	    set_schedule(sche_game_main_finish);
 	}
     }
     if (pad.st == 1) {
-	set_sche(sche_game_main);
+	set_schedule(sche_game_main);
     }
     if (pad.up == 1 || pad.down == 1) {
 	game.select = !game.select;
@@ -360,7 +357,7 @@
     carNode_draw();
     camera_update(game.jiki->body->transfer);
     if (pad.st == 1) {
-	set_sche(sche_game_main_finish);
+	set_schedule(sche_game_main_finish);
     }
 }
 
@@ -372,11 +369,10 @@
     if (game.jiki) {
 	field_destroy();
 	carNode_destroy();
-	demo_closeFp();
 	game_env_init();
     }
     if (pad.st == 1) {
-	set_sche(sche_game_opening);
+	set_schedule(sche_game_opening);
     }
 }