changeset 74:ec6563ccd5f4

*** empty log message ***
author gongo
date Thu, 09 Nov 2006 04:53:04 +0000
parents 0c0e21cd63cd
children 89ede83e7959
files linda.c linda.h
diffstat 2 files changed, 38 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/linda.c	Thu Nov 09 04:40:55 2006 +0000
+++ b/linda.c	Thu Nov 09 04:53:04 2006 +0000
@@ -417,7 +417,7 @@
     }
 
     if (p == 1 && connect == CLIENT_MAX) {
-	linda_set_schedule(linda_sche_main0, MODE_MAIN);
+	linda_set_schedule(linda_sche_main, MODE_MAIN);
 	return TRUE;
     } else {
 	return FALSE;
@@ -432,7 +432,7 @@
     get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, NULL);
 
     if (mode == MODE_MAIN) {
-	linda_set_schedule(linda_sche_main1, MODE_MAIN);
+	linda_set_schedule(linda_sche_main, MODE_MAIN);
 	return TRUE;
     } else {
 	return FALSE;
@@ -440,6 +440,41 @@
 }
 
 static Bool
+linda_sche_main(int p)
+{
+    int i, flg, mode;
+    int id = game.play_id;
+    int connect = 1;
+    FMATRIX po;
+    CarPtr mycar = game.jiki;
+    CarPtr enemy = NULL;
+    get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, (char*)po);
+
+    for (i=1; i<=CLIENT_MAX; i++) {
+	ps2_vu0_unit_matrix(po);
+
+	if (i == id) {
+	    ps2_vu0_copy_matrix(po, mycar->body->transfer);
+	    ps2_vu0_copy_vector(po[3], mycar->location);
+	    
+	    linda_seq[i] = psx_in(i);
+	    send_packet(i, MODE_MAIN, 0, 0, (char*)po);
+	} else {
+	    enemy = linda_carlist[i];
+	    get_packet(i, NULL, &mode, NULL, NULL, (char*)po);	    
+	    if (mode == MODE_MAIN) {
+		ps2_vu0_copy_matrix(enemy->body->transfer, po);
+		enemy->body->transfer[3][0] -= game.jiki->location[0];
+		enemy->body->transfer[3][1] -= game.jiki->location[1];
+		enemy->body->transfer[3][2] -= game.jiki->location[2];
+		enemy->body->transfer[3][3] = 1;
+	    }
+	}
+    }
+	return FALSE;
+}
+
+static Bool
 linda_sche_main0(int p)
 {
     FMATRIX data;
--- a/linda.h	Thu Nov 09 04:40:55 2006 +0000
+++ b/linda.h	Thu Nov 09 04:53:04 2006 +0000
@@ -58,5 +58,6 @@
 static Bool linda_sche_main_init(int);
 static Bool linda_sche_main_ready0(int);
 static Bool linda_sche_main_ready1(int);
+static Bool linda_sche_main(int);
 static Bool linda_sche_main0(int);
 static Bool linda_sche_main1(int);