comparison linda.c @ 74:ec6563ccd5f4

*** empty log message ***
author gongo
date Thu, 09 Nov 2006 04:53:04 +0000
parents 0c0e21cd63cd
children 89ede83e7959
comparison
equal deleted inserted replaced
73:0c0e21cd63cd 74:ec6563ccd5f4
415 flg = 0; 415 flg = 0;
416 } 416 }
417 } 417 }
418 418
419 if (p == 1 && connect == CLIENT_MAX) { 419 if (p == 1 && connect == CLIENT_MAX) {
420 linda_set_schedule(linda_sche_main0, MODE_MAIN); 420 linda_set_schedule(linda_sche_main, MODE_MAIN);
421 return TRUE; 421 return TRUE;
422 } else { 422 } else {
423 return FALSE; 423 return FALSE;
424 } 424 }
425 } 425 }
430 int mode; 430 int mode;
431 431
432 get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, NULL); 432 get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, NULL);
433 433
434 if (mode == MODE_MAIN) { 434 if (mode == MODE_MAIN) {
435 linda_set_schedule(linda_sche_main1, MODE_MAIN); 435 linda_set_schedule(linda_sche_main, MODE_MAIN);
436 return TRUE; 436 return TRUE;
437 } else { 437 } else {
438 return FALSE; 438 return FALSE;
439 } 439 }
440 }
441
442 static Bool
443 linda_sche_main(int p)
444 {
445 int i, flg, mode;
446 int id = game.play_id;
447 int connect = 1;
448 FMATRIX po;
449 CarPtr mycar = game.jiki;
450 CarPtr enemy = NULL;
451 get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, (char*)po);
452
453 for (i=1; i<=CLIENT_MAX; i++) {
454 ps2_vu0_unit_matrix(po);
455
456 if (i == id) {
457 ps2_vu0_copy_matrix(po, mycar->body->transfer);
458 ps2_vu0_copy_vector(po[3], mycar->location);
459
460 linda_seq[i] = psx_in(i);
461 send_packet(i, MODE_MAIN, 0, 0, (char*)po);
462 } else {
463 enemy = linda_carlist[i];
464 get_packet(i, NULL, &mode, NULL, NULL, (char*)po);
465 if (mode == MODE_MAIN) {
466 ps2_vu0_copy_matrix(enemy->body->transfer, po);
467 enemy->body->transfer[3][0] -= game.jiki->location[0];
468 enemy->body->transfer[3][1] -= game.jiki->location[1];
469 enemy->body->transfer[3][2] -= game.jiki->location[2];
470 enemy->body->transfer[3][3] = 1;
471 }
472 }
473 }
474 return FALSE;
440 } 475 }
441 476
442 static Bool 477 static Bool
443 linda_sche_main0(int p) 478 linda_sche_main0(int p)
444 { 479 {