changeset 116:ed702e49cc6c

conpile
author e085768
date Thu, 16 Jun 2011 04:05:33 +0900
parents 31dd5c07f7c1
children 9e4100c5d7ec
files Magoroku.cc Makefile Makefile.def SgoexCerium.h TAGS car.cc carNode.cc field.cc gFont.cc gSprite.cc gSprite.h game.cc libps2.h ps2util.cc ps2util.h schedule.cc title_scene.cc
diffstat 17 files changed, 515 insertions(+), 561 deletions(-) [+]
line wrap: on
line diff
--- a/Magoroku.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/Magoroku.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -96,14 +96,13 @@
 
 //Magoroku の初期化など
 /* timer */
-static int start_time,time_count;
-static int RUNNIG=0;
-char raptime[10];
+//static int start_time,time_count;
+//static int RUNNIG=0;
+//char raptime[10];
 
-static int ranking = 0;
-static LIGHT l;
-static int i=0;
-
+//static int ranking = 0;
+//static LIGHT l;
+//static int i=0;
 // schedule.ccで使用してる
 void linda_env_init( void );
 
@@ -129,7 +128,8 @@
 
   // magoroku_racing                                                                                                        
   game_main();
-  
+
+  /*
   // Dandy
   printf("gamef = %d\n",gamef);
   switch (gamef) {
@@ -139,7 +139,7 @@
   case 3:    gamef= magoroku_main_loop(gamef); break;
   case 4:    gamef= magoroku_closing(gamef); break;
   }
-
+  */
   return next;
 }; 
 
@@ -147,11 +147,21 @@
 static void
 task_init() 
 {
+  printf("task_init\n");
 }
 
+FILE *main_fp;
+
 int
 TMmain(TaskManager *manager,int argc, char *argv[])
 {
+  main_fp = fopen("/dev/stdout", "w");
+  if (!main_fp) {
+    perror("main");
+  }
+
+  printf("trace_TMmain\n");
+
   for(int i = 1; i<argc ; i++) {
     if (strcmp(argv[i],"-t")) {
       if (i+1<argc && argv[i+1]) {
@@ -176,12 +186,14 @@
   printf("game end\n");
 }
 
-static int light_sysswitch = 0;
-static int light_num = 4;
+//static int light_sysswitch = 0;
+//static int light_num = 4;
 
 
+// ceriumuで同じ変数名があるから _2 って付け足しました
+/*
 static void 
-LightSysSwitch(Viewer *sgroot) {
+LightSysSwitch_2(Viewer *sgroot) {
   if (light_sysswitch == 1) {
     sgroot->OnLightSysSwitch();
     for (int i = 0; i < light_num; i++) {
@@ -195,3 +207,4 @@
     sgroot->OffLightSysSwitch();
   }
 }
+*/
--- a/Makefile	Wed Jun 15 23:31:59 2011 +0900
+++ b/Makefile	Thu Jun 16 04:05:33 2011 +0900
@@ -4,9 +4,11 @@
 srcdir  = .
 ABI = -m$(ABIBIT)
 
-SRCS = main.cc game.cc car.cc col.cc quotanion.cc controler.cc field.cc camera.cc gSprite.cc schedule.cc mytype.cc gFont.cc carNode.cc light.cc title_scene.cc game_time.cc ps2util.cc sjoy.cc name_dictionary.cc sound.cc Ss.cc Magoroku.cc
+SRCS = game.cc car.cc col.cc quotanion.cc controler.cc field.cc camera.cc gSprite.cc schedule.cc mytype.cc gFont.cc carNode.cc light.cc title_scene.cc game_time.cc ps2util.cc sjoy.cc name_dictionary.cc sound.cc Ss.cc
+
 
-CFLAGS  += -DINVISIBLE_MODE -g $(ABI) -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
+#CFLAGS  += -DINVISIBLE_MODE -g $(ABI) -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
+CFLAGS  += -DINVISIBLE_MODE -g -O0 $(ABI) -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
 LIBS	+=  `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
 LIBS += -lCerium -lFifoManager
 
@@ -15,8 +17,8 @@
 
 all: $(TARGET)
 
-magoroku: $(OBJS) Magoroku.o SgoexCerium.o
-	$(CC) $(ABI) -o $@ $(OBJS) Magoroku.o SgoexCerium.o $(LIBS)
+magoroku: $(OBJS) Magoroku.o 
+	$(CC) $(ABI) -o $@ $(OBJS) Magoroku.o $(LIBS)
 
 clean:
 	rm -f $(TARGET) $(OBJS) main.o sgoex.o Magoroku.o  SgoexCerium.o Test.o
--- a/Makefile.def	Wed Jun 15 23:31:59 2011 +0900
+++ b/Makefile.def	Thu Jun 16 04:05:33 2011 +0900
@@ -4,6 +4,11 @@
 #ex linux/ps3
 CERIUM = ../Cerium
 
+# 下3行、ダンディのトコからのコピー
+CC      = g++
+OPT = -g #-O9
+CFLAGS  =  -Wall $(OPT)
+
 # OPT = -g
 
 ABIBIT = 64
@@ -13,5 +18,8 @@
 TOOL = $(CERIUM)/bin
 
 
-LIBS += `sdl-config --libs`, -framework, OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
-LIBS += -lCerium -lFifoManager
+#LIBS += `sdl-config --libs`, -framework, OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
+#LIBS += `sdl-config --libs`, -framework, -lSDL_mixer -lSDL_image `xml2-config --libs`
+#LIBS += -lCerium -lFifoManager
+
+
--- a/SgoexCerium.h	Wed Jun 15 23:31:59 2011 +0900
+++ b/SgoexCerium.h	Thu Jun 16 04:05:33 2011 +0900
@@ -15,7 +15,7 @@
 extern void PutSprite(int zorder, short x, short y, int number);
 extern void PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle);
 
-extern struct SGO_PAD pad[2];
+//extern struct SGO_PAD pad[2];
 //extern struct SGO_PAD pad;
 
 /* コントローラ状態の読み込み */
--- a/TAGS	Wed Jun 15 23:31:59 2011 +0900
+++ b/TAGS	Thu Jun 16 04:05:33 2011 +0900
@@ -2,8 +2,8 @@
 Magoroku.h,121
 #define INCLUDE_MAGOROKU_H2,27
 class Magoroku 10,170
-typedef void (*move)move18,378
-typedef void (*coll)coll19,449
+typedef void (*move)move19,379
+typedef void (*coll)coll20,450
 
 SgoexCerium.h,27
 #define SgoexCerium_h2,22
@@ -28,31 +28,26 @@
 typedef struct col_face_handler 15,189
 } ColFaceHd;19,285
 
-controler.h,580
-#define CONTROLER_H4,22
-#define DEFOBJ 8,61
-#define MAXOBJ 9,113
-#define BOOL 10,162
-#define TRUE 11,201
-#define FALSE 12,236
-#define PS2_CROSS 16,286
-#define PS2_CIRCLE 17,306
-#define PS2_SQUARE 18,327
-#define PS2_TRIANGLE 19,348
-#define PS2_L1 21,372
-#define PS2_R1 22,389
-#define PS2_L2 23,406
-#define PS2_R2 24,423
-#define PS2_START 25,440
-#define PS2_SELECT 26,460
-#define PS2_L3 27,481
-#define PS2_R3 28,499
-#define PS2_LEFT 30,518
-#define PS2_RIGHT 31,538
-#define PS2_UP 32,559
-#define PS2_DOWN 33,577
-typedef struct SGO_PAD 44,730
-} SGO_PAD;59,947
+controler.h,467
+#define CONTROLER_H2,20
+#define PS2_CROSS 6,70
+#define PS2_CIRCLE 7,90
+#define PS2_SQUARE 8,111
+#define PS2_TRIANGLE 9,132
+#define PS2_L1 11,156
+#define PS2_R1 12,173
+#define PS2_L2 13,190
+#define PS2_R2 14,207
+#define PS2_START 15,224
+#define PS2_SELECT 16,244
+#define PS2_L3 17,265
+#define PS2_R3 18,283
+#define PS2_LEFT 20,302
+#define PS2_RIGHT 21,322
+#define PS2_UP 22,343
+#define PS2_DOWN 23,361
+typedef struct SGO_PAD 34,514
+} SGO_PAD;49,759
 
 field.h,225
 #define FIELD_H2,16
@@ -63,29 +58,27 @@
 typedef struct field 19,519
 } Field, *FieldPtr;FieldPtr27,705
 
-gSprite.h,112
+gSprite.h,116
 #define GSPRITE_H2,18
 #define SPRITE_PRIO_FOREGROUND 5,81
-typedef struct sptable 7,115
-} SpriteTable;27,378
+typedef struct SpriteTable 7,115
+} SpriteTable;20,399
 
 game.h,81
 #define GAME_H4,29
 typedef struct game 14,148
 } Game, *GamePtr;GamePtr21,332
 
-libps2.h,301
+libps2.h,237
 #define LIBPS2_H3,18
 typedef float FVECTOR[FVECTOR9,75
 typedef float FMATRIX[FMATRIX10,131
-typedef SceneGraph OBJECT;51,1640
-typedef struct texture 53,1668
-} TEXTURE;61,2074
-} GsPrim;75,2253
-} GsSpritePacket;84,2373
-} SPRITE;96,2675
-typedef struct popygon 105,2771
-} PolygonInfo;108,2823
+class OBJECT 54,1670
+} GsPrim;70,1930
+} GsSpritePacket;80,2051
+} SPRITE;93,2354
+typedef struct popygon 100,2448
+} PolygonInfo;103,2500
 
 light.h,16
 } LIGHT;11,159
@@ -128,17 +121,6 @@
 name_dictionary.h,31
 #define NAME_DICTIONARY_H2,26
 
-object.h,250
-#define OBJECT_H2,17
-typedef float FVECTOR[FVECTOR5,36
-typedef float FMATRIX[FMATRIX6,62
-typedef struct width_height{width_height8,92
-} WX;11,143
-typedef struct surface 13,151
-} SURFACE;28,480
-typedef struct object 30,492
-} OBJECT;36,706
-
 ps2util.h,142
 #define JOYPAD_1 4,48
 #define PS2UTIL_H8,87
@@ -240,29 +222,21 @@
 } GsSpritePacket;87,2043
 } SpritePacketHeader;102,2557
 
-Magoroku.cc,660
+Magoroku.cc,413
 int runmode;69,1563
 SDL_Joystick *joy;joy71,1577
-const char *usr_help_str usr_help_str75,1599
-Viewer *droot;droot79,1785
-static    int screen_w;81,1801
-static    int screen_h;82,1825
-Magoroku::init(86,1910
-Application *application(application94,2028
-static int start_time,101,2128
-static int start_time,time_count;101,2128
-static int RUNNIG=102,2162
-char raptime[raptime103,2183
-static int ranking 105,2202
-static LIGHT l;106,2226
-static int i=107,2242
-Magoroku::app_loop(137,3160
-Magoroku::application_task(147,3356
-task_init(156,3509
-TMmain(161,3531
-TMend(179,3819
-static int light_sysswitch 184,3878
-static int light_num 185,3910
+const char *usr_help_str usr_help_str73,1597
+Viewer *droot;droot77,1783
+static    int screen_w;79,1799
+static    int screen_h;80,1823
+Magoroku::init(84,1908
+Application *application(application92,2026
+Magoroku::app_loop(117,2567
+Magoroku::application_task(127,2763
+task_init(148,3323
+FILE *main_fp;main_fp153,3366
+TMmain(156,3386
+TMend(184,3846
 
 SgoexCerium.cc,269
 static SceneGraphPtr root;13,172
@@ -308,16 +282,16 @@
 static FVECTOR location 19,377
 static FVECTOR direction 20,418
 car_create(25,497
-car_new_readCSV(73,1792
-CarPtr car_init(115,2664
-car_swerve(136,3085
-car_accelerate(156,3636
-car_field_check(174,4241
-car_move(216,5306
-car_axis_rotation(232,5694
-void car_update(264,6592
-car_destroy(279,6825
-void car_id_update(296,7117
+car_new_readCSV(75,1804
+CarPtr car_init(117,2679
+car_swerve(138,3100
+car_accelerate(158,3651
+car_field_check(176,4256
+car_move(218,5321
+car_axis_rotation(234,5709
+void car_update(266,6607
+car_destroy(281,6840
+void car_id_update(301,7147
 
 carNode.cc,99
 static CarPtr car_list;12,188
@@ -336,24 +310,23 @@
 bool padCheck(24,409
 bool keybord(115,2715
 
-field.cc,419
+field.cc,398
 #define BUFSIZE 13,222
 static int field_num_max 18,287
 static int field_num 19,317
 static FieldPtr field_list;21,344
 static FieldPtr field_actual;22,372
 PolygonInfo  xml_read_file(25,427
-field_create(35,553
-field_new_readCSV(82,1834
-field_init(151,3348
-field_draw(166,3622
-void field_update(178,3911
-field_destroy(212,4582
-field_rap_increment(243,5090
-field_set_actual(255,5242
-field_get_actual(261,5305
+field_new_readCSV(82,1837
+field_init(160,3408
+field_draw(175,3669
+void field_update(187,3958
+field_destroy(221,4629
+field_rap_increment(257,5152
+field_set_actual(269,5304
+field_get_actual(275,5367
 
-gFont.cc,647
+gFont.cc,625
 #define DEFOBJ 15,332
 #define SPRITE_COL 16,351
 #define SCREEN_HALF_W 17,375
@@ -364,38 +337,38 @@
 static ps2utilSprite sp[sp23,512
 static unsigned int  sp_counter;24,587
 static bool          flag_spriteInited 25,620
-static TEXTURE *font_tex;font_tex27,706
-gFont_Init_Png(30,745
-gFont_Create(48,1124
-gFont_DefSprite(66,1452
-gFont_Init(75,1622
-gFont_PutSprite(93,1890
-gFont_Clear(114,2369
-gFont_Draw_Reset(125,2502
-get_number_char(133,2601
-gFont_SetString(142,2696
-gFont_SetStringInt(158,2969
-gFont_SetFont_OP(167,3105
+gFont_Init_Png(30,747
+gFont_Create(50,1136
+gFont_DefSprite(70,1476
+DefSprite(79,1644
+gFont_Init(93,1952
+gFont_PutSprite(111,2220
+gFont_Clear(132,2699
+gFont_Draw_Reset(143,2832
+get_number_char(151,2931
+gFont_SetString(160,3026
+gFont_SetStringInt(176,3299
+gFont_SetFont_OP(185,3435
 
-gSprite.cc,562
-#define DEFOBJ 8,123
-#define SPRITE_COL 9,142
-#define SCREEN_HALF_W 10,166
-#define SCREEN_HALF_H 11,192
-static SpriteTable   sptable[sptable13,219
-static ps2utilSprite sp[sp14,257
-static unsigned int  sp_counter;15,330
-static bool          flag_spriteInited 16,363
-static TEXTURE *sprite_tex;sprite_tex18,449
-gSprite_DefSprite(22,484
-gSprite_PutSprite(31,664
-gSprite_PutSpriteEx(48,1140
-gSprite_Init_Png(66,1644
-gSprite_Create(85,2018
-gSprite_Init(104,2355
-gSprite_Clear(132,3412
-gSprite_Draw_Reset(145,3541
-gSprite_PutSprite_Pause(155,3634
+gSprite.cc,558
+#define DEFOBJ 14,246
+#define SPRITE_COL 15,265
+#define SCREEN_HALF_W 16,289
+#define SCREEN_HALF_H 17,315
+static SpriteTable   sptable[sptable19,342
+static ps2utilSprite sp[sp20,380
+static unsigned int  sp_counter;21,453
+static bool          flag_spriteInited 22,486
+/*static*/ SceneGraphPtr root;29,627
+static float my_scale 31,659
+flip(36,716
+gSprite_DefSprite(72,1651
+void gSprite_PutSprite(104,2564
+gSprite_PutSpriteEx(160,4143
+gSprite_Init(245,6122
+gSprite_Clear(272,7163
+gSprite_Draw_Reset(285,7292
+gSprite_PutSprite_Pause(295,7385
 
 game.cc,50
 #define linda_init 20,288
@@ -474,37 +447,40 @@
 void delete_name_dictionary(62,1356
 int init_name_dictionary(87,1914
 
-ps2util.cc,1098
+ps2util.cc,1200
 OBJECT *ps2util_obj_Create_fromXML(ps2util_obj_Create_fromXML16,366
 void ps2util_obj_Set_effect(33,645
 void ps2_vu0_copy_vector(39,767
 void ps2util_obj_Renew_transMatrix(45,889
-void ps2_vu0_unit_matrix(83,1491
-void ps2_vu0_rot_matrix_y(97,2084
-void ps2_vu0_apply_matrix(121,2718
-void ps2_vu0_scale_vector(130,3116
-void ps2_vu0_add_vector(140,3467
-void ps2_vu0_outer_product(150,3687
-float ps2_vu0_inner_product(159,3924
-void ps2_vu0_mul_matrix(165,4038
-void ps2_vu0_copy_matrix(189,5775
-void ps2util_obj_Free(194,5880
-void ps2_vu0_sub_vector(201,5935
-void ps2_vu0_normalize(211,6125
-void xml_free(222,6372
-void ps2util_obj_Draw(228,6428
-void  ps2util_sprite_Destroy(236,6575
-void ps2util_sprite_Set_basicAttribute(244,6681
-void ps2util_sprite_Request(254,6987
-void ps2util_sprite_Unuse_alpha(260,7048
-void ps2util_graphic_Init(265,7113
-#define SPRITE_HAS_4VERTEXIS 274,7209
-#define PS2_GS_XYZ3 276,7241
-sprite_disappear(279,7333
-int malloc_align16(313,8039
-void ps2util_sprite_Draw(344,8675
-void ps2util_graphic_Finish(349,8744
-void ps2util_sprite_Use_alpha(356,8846
+int ps2util_tex_Set(66,1165
+int ps2util_sprite_Create(71,1216
+void ps2util_obj_Set_texture(77,1300
+void ps2_vu0_unit_matrix(84,1430
+void ps2_vu0_rot_matrix_y(98,2023
+void ps2_vu0_apply_matrix(122,2657
+void ps2_vu0_scale_vector(131,3055
+void ps2_vu0_add_vector(141,3406
+void ps2_vu0_outer_product(151,3626
+float ps2_vu0_inner_product(160,3863
+void ps2_vu0_mul_matrix(166,3977
+void ps2_vu0_copy_matrix(190,5714
+void ps2util_obj_Free(195,5819
+void ps2_vu0_sub_vector(202,5874
+void ps2_vu0_normalize(212,6064
+void xml_free(223,6311
+void ps2util_obj_Draw(231,6395
+void  ps2util_sprite_Destroy(239,6542
+void ps2util_sprite_Set_basicAttribute(246,6647
+void ps2util_sprite_Request(256,6953
+void ps2util_sprite_Unuse_alpha(262,7014
+void ps2util_graphic_Init(267,7079
+#define SPRITE_HAS_4VERTEXIS 276,7175
+#define PS2_GS_XYZ3 278,7207
+sprite_disappear(281,7299
+int malloc_align16(313,7964
+void ps2util_sprite_Draw(342,8564
+void ps2util_graphic_Finish(347,8633
+void ps2util_sprite_Use_alpha(354,8735
 
 quotanion.cc,69
 quotanion(11,226
@@ -518,36 +494,36 @@
 #define MAXRAP 37,677
 #define SP_SEL_CAR 38,712
 #define SP_SEL_COURSE 39,737
-static int start_time,64,1524
-static int start_time,time_count;64,1524
-static int RUNNIG=65,1558
-char raptime[raptime66,1579
-static int ranking 68,1598
-static LIGHT l;69,1622
-static int i=70,1638
-static int change_state 74,1750
-set_schedule_assumption(80,1855
-unset_schedule(87,1971
-set_schedule(93,2025
-graphic_init(100,2123
-play_init(107,2266
-void linda_env_init(115,2420
-static void game_env_init 120,2483
-sche_game_init(137,2716
-sche_game_opening(192,3773
-sche_game_select_car(225,4294
-sche_game_select_course(256,4933
-sche_game_ready(287,5604
-sche_game_main_init(314,6220
-sche_game_main_ready(324,6371
-sche_game_main(331,6508
-sche_game_main_pause(399,8067
-sche_game_main_goal(433,8767
-sche_game_main_finish(463,9445
-sche_game_main_finish2(473,9604
-void wait_sync(485,9794
-void swap_dbuff(491,9864
-schedule(497,9920
+static int start_time,63,1523
+static int start_time,time_count;63,1523
+static int RUNNIG=64,1557
+char raptime[raptime65,1578
+static int ranking 67,1597
+static LIGHT l;68,1621
+static int i=69,1637
+static int change_state 73,1749
+set_schedule_assumption(79,1854
+unset_schedule(86,1970
+set_schedule(92,2024
+graphic_init(99,2122
+play_init(106,2265
+void linda_env_init(114,2419
+static void game_env_init 119,2482
+sche_game_init(135,2714
+sche_game_opening(190,3770
+sche_game_select_car(222,4290
+sche_game_select_course(254,4935
+sche_game_ready(285,5611
+sche_game_main_init(312,6239
+sche_game_main_ready(322,6390
+sche_game_main(329,6527
+sche_game_main_pause(398,8192
+sche_game_main_goal(432,8892
+sche_game_main_finish(462,9566
+sche_game_main_finish2(472,9725
+void wait_sync(483,9914
+void swap_dbuff(489,9984
+schedule(495,10040
 
 sjoy.cc,437
 #define N_JOY 14,195
@@ -600,19 +576,18 @@
 void output_FMATRIX(169,3558
 void all_init(184,3789
 
-title_scene.cc,360
+title_scene.cc,316
     TITLE_INIT,::TITLE_INIT10,123
     TITLE_MAIN,::TITLE_MAIN11,139
     TITLE_FINISH::TITLE_FINISH12,155
 } TITLE_STATE;13,172
 static ps2utilSprite title_sprite;15,188
-static TEXTURE *title_img;title_img17,224
-#define TITLE_IMG_FILE 19,252
-title_init(23,305
-title_init_call(44,735
-title_finish(50,786
-title_finish_call(58,919
-title_scene(64,966
+#define TITLE_IMG_FILE 19,254
+title_init(23,307
+title_init_call(46,755
+title_finish(52,806
+title_finish_call(60,943
+title_scene(66,990
 
 title_scene.h,0
 
--- a/car.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/car.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -84,6 +84,9 @@
   flag = false;
 
   while ((bufp = fgets(buff, BUFSIZE, fp)) != NULL) {
+
+    printf("trace\n");
+
     bufp++;
 
     switch (buff[0]) {
@@ -116,15 +119,25 @@
 
 CarPtr car_init(int id)
 {
+  printf("car_init()\n");
+  
   CarPtr newCar;
   FILE *fp;
   const char *filename = "car/car.dat";
+  
+  printf("car_init()\n");
 
   if (!(fp = fopen(filename, "r"))) {
     fprintf(main_fp, "error read file %s\n", filename);
     exit(EXIT_FAILURE);
   }
+
+  printf("car_init()\n");
+
   newCar = car_new_readCSV(fp, id);
+
+  printf("car_init()\n");
+
   fclose(fp);
 
   return newCar;
--- a/carNode.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/carNode.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -14,9 +14,11 @@
 void
 carNode_append(CarPtr newCar) 
 {
+  printf("carNode_append()\n");
   CarPtr p = car_list;
 
   if (!p) {
+    printf("carNode_append()\n");
     car_list = newCar;
   } else {
     while (p->next) p = p->next;
--- a/field.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/field.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -30,7 +30,7 @@
   return test;
 }
 
-
+/*
 static FieldPtr
 field_create(char *fieldImg, char *colImg, OBJECT *tex)
 {
@@ -75,7 +75,7 @@
 
   return self;
 }
-
+*/
 
 
 static void
@@ -83,9 +83,9 @@
 {
   FieldPtr fieldHead = NULL;
   FieldPtr newField  = NULL;
-  FieldPtr prevField = NULL;
+  //FieldPtr prevField = NULL;
   char buff[BUFSIZE], *bufp;
-  char fieldImg[BUFSIZE], colImg[BUFSIZE], texname[BUFSIZE];
+  //char fieldImg[BUFSIZE], colImg[BUFSIZE], texname[BUFSIZE];
 
   //TEXTURE *tex = NULL;
   int course_id;
@@ -116,7 +116,7 @@
       break;
       */
 
-      
+      /*
     case 'c': // コースのロード
       if (flag) {
 	sscanf(bufp, " %s %s\n", fieldImg, colImg);
@@ -132,9 +132,12 @@
 	field_num_max++;
       }
       break;
+       */
     default:
       break;
+     
     }
+    
   }
 
  FINISH_LOAD:
@@ -217,10 +220,11 @@
 void
 field_destroy()
 {
+  /*
   FieldPtr p = field_list;
   FieldPtr d;
 
-  /*
+  
   TEXTURE *t;
 
   p->prev->next = NULL;
--- a/gFont.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/gFont.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -24,11 +24,12 @@
 static unsigned int  sp_counter;
 static bool          flag_spriteInited = false; // スプライトロードフラグ
 
-static TEXTURE *font_tex;
+//static TEXTURE *font_tex;
 
 static void
 gFont_Init_Png(const char *texname)
 {
+  /*
   if (!(font_tex = read_png_file(texname))) {
     fprintf(stderr,
 	    "cannot creat texture - gFont_Init_Png().\n");
@@ -42,11 +43,13 @@
     fflush(stderr);
     exit(EXIT_FAILURE);
   }
+  */
 }
 
 static void
 gFont_Create()
 {
+  /*
   int i;
   for (i=0; i<DEFOBJ; i++) {
     if (ps2util_sprite_Create(&sp[i], font_tex) == -1) {
@@ -58,17 +61,32 @@
     ps2util_sprite_Unuse_alpha(&sp[i]);
   }
 
+  flag_spriteInited = true;
+    */
 
-  flag_spriteInited = true;
 }
 
 static void
 gFont_DefSprite(int number, int x, int y, int w, int h)
 {
-  sptable[number].tx = x;
-  sptable[number].ty = y;
-  sptable[number].tw = w;
-  sptable[number].th = h;
+  sptable[number].mx = x;
+  sptable[number].my = y;
+  sptable[number].w = w;
+  sptable[number].h = h;
+}
+
+void
+DefSprite(int number, const char *name, float w, float h, int color, OBJECT *obj)
+{
+  SpriteTable *m = &sptable[number];
+  m->w = w;
+  m->h = h;
+  m->color = (color & 32);
+  m->mx = w / 2;
+  m->my = h / 2;
+  m->tex_w = power_of_two(m->w);
+  m->tex_h = power_of_two(m->h);
+  m->texture = (int *)name;
 }
 
 void
--- a/gSprite.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/gSprite.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -1,3 +1,9 @@
+//SgoexCerium.ccより
+#include "matrix_calc.h"
+#include "TaskManager.h"
+#include "SceneGraph.h"
+#include "Application.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include "libps2.h"
@@ -18,52 +24,179 @@
 //static TEXTURE *sprite_tex;
 
 
+extern Viewer *droot;
+
+/*static*/ SceneGraphPtr root;
+
+static float my_scale = 5;
+
+
+//SgoexCerium.ccより
 void
+flip()
+{
+    CameraPtr camera = droot->sgroot->getCamera();
+
+    droot->sgroot->flip();
+    droot->sgroot->lightCalc();
+
+    root = droot->createSceneGraph();
+    //root->xyz[0] = screen_w/2;
+    //root->xyz[1] = screen_h/2;;
+    root->xyz[0] = 0;
+    root->xyz[1] = 0;
+    root->xyz[2] = 30.0f;
+
+    /*親の回転、座標から、子の回転、座標を算出*/
+    get_matrix(root->matrix, root->angle, root->xyz, camera->matrix);
+    /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
+    get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix);
+    //出力して、次のものを出力するための準備
+    droot->setSceneData(root);
+}
+
+
+
+
+
+/*void
 gSprite_DefSprite(int number, int tx, int ty, int tw, int th)
 {
   sptable[number].tx = tx;
   sptable[number].ty = ty;
   sptable[number].tw = tw;
   sptable[number].th = th;
+}*/
+
+void
+gSprite_DefSprite(int number, const char *name, float w, float h, int color)//, OBJECT *obj)
+{
+  SpriteTable *m = &sptable[number];
+  m->w = w;
+  m->h = h;
+  m->color = (color & 32);
+  m->mx = w / 2; //画像の中心を座標としたいらしい。
+  m->my = h / 2;
+  m->tex_w = power_of_two(m->w);
+  m->tex_h = power_of_two(m->h);
+  m->texture = (int *)name;
 }
 
-// DandyのPutSprite関数
-void
+/*void
 gSprite_PutSprite(int number, int x, int y)
 {
-  ps2utilSprite *p = &sp[sp_counter];
+    ps2utilSprite *p = &sp[sp_counter];
+
+    ps2util_sprite_Set_basicAttribute(
+	p,
+	(unsigned short)x, (unsigned short)y,
+	(unsigned short)sptable[number].tw*2, (unsigned short)sptable[number].th*2,
+	(unsigned short)sptable[number].tx, (unsigned short)sptable[number].ty,
+	(unsigned short)sptable[number].tw, (unsigned short)sptable[number].th,
+	SPRITE_PRIO_FOREGROUND);
+
+    ps2util_sprite_Request(p);
+    sp_counter++;
+}*/
+
 
-  // テクスチャの設定
-  ps2util_sprite_Set_basicAttribute(
-				    p,
-				    (unsigned short)x, (unsigned short)y,
-				    (unsigned short)sptable[number].tw*2, (unsigned short)sptable[number].th*2,
-				    (unsigned short)sptable[number].tx, (unsigned short)sptable[number].ty,
-				    (unsigned short)sptable[number].tw, (unsigned short)sptable[number].th,
-				    SPRITE_PRIO_FOREGROUND);
+//void gSprite_PutSprite(int number, short x, short y, int zorder)
+void gSprite_PutSprite(int number, int x, int y)
+{
+  SpriteTable *m = &sptable[number];
+  char *name = (char *) m->texture;
+  if (!name) {
+    printf("PutSprite %d unknown\n",number);
+    return;
+  }
+  SceneGraphPtr object = droot->createSceneGraph(name);
+  //object->c_xyz[0] = m->mx;
+  //object->c_xyz[1] = m->my;
+  root->addChild(object);
 
-  // 表示
-  ps2util_sprite_Request(p);
-  sp_counter++;
+  object->xyz[0] -= object->c_xyz[0]*my_scale;
+  object->xyz[1] -= object->c_xyz[1]*my_scale;
+  object->xyz[2] -= object->c_xyz[2];
+
+  object->xyz[0] += x+m->mx;
+  object->xyz[1] += y+m->my;
+  //  object->xyz[2] += zorder * 0.01;
+
+  //float scale[] = {my_scale,my_scale,1};
+  //float c_xyz[] = {0,0,0};
+  //scale_matrix(object->matrix, scale, c_xyz);
+
+  /*親の回転、座標から、子の回転、座標を算出*/
+  //get_matrix_scale(object->matrix, object->angle, object->xyz, scale, root->matrix);
+
+  /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
+  // get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix);
 }
 
-void
-gSprite_PutSpriteEx(int number, int x, int y, float w, float h)
-{
+
+
+
+
+
+/*void
+  gSprite_PutSpriteEx(int number, int x, int y, float w, float h)
+  {
   ps2utilSprite *p = &sp[sp_counter];
 
   ps2util_sprite_Set_basicAttribute(
-				    p,
-				    (unsigned short)x, (unsigned short)y,
-				    (unsigned short)sptable[number].tw*w, (unsigned short)sptable[number].th*h,
-				    (unsigned short)sptable[number].tx, (unsigned short)sptable[number].ty,
-				    (unsigned short)sptable[number].tw, (unsigned short)sptable[number].th,
-				    SPRITE_PRIO_FOREGROUND);
+  p,
+  (unsigned short)x, (unsigned short)y,
+  (unsigned short)sptable[number].tw*w, (unsigned short)sptable[number].th*h,
+  (unsigned short)sptable[number].tx, (unsigned short)sptable[number].ty,
+  (unsigned short)sptable[number].tw, (unsigned short)sptable[number].th,
+  SPRITE_PRIO_FOREGROUND);
 
   ps2util_sprite_Request(p);
   sp_counter++;
+  }
+*/
+
+void
+gSprite_PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle)
+{
+  if (1) {
+    gSprite_PutSprite(number, x, y);
+    return;
+  }
+
+  SpriteTable *m = &sptable[number];
+  char *name = (char *) m->texture;
+  if (!name) {
+    printf("PutSpriteEx %d unknown\n",number);
+    return;
+  }
+  SceneGraphPtr object = droot->createSceneGraph(name);
+  root->addChild(object);
+
+  float scale[] = {my_scale*scalex*4,my_scale*scaley*4,1};
+
+  /*親の回転、座標から、子の回転、座標を算出*/
+  object->xyz[0] = x - object->c_xyz[0] * my_scale - m->w*my_scale;
+  object->xyz[1] = y - object->c_xyz[1] * my_scale - m->h*my_scale;
+  object->xyz[2] = number * 0.01;
+  //object->c_xyz[0] = m->mx;
+  //object->c_xyz[1] = m->my;
+  object->angle[3] = angle * (3.1415926*2/4096);
+  get_matrix(object->matrix, object->angle, object->xyz, root->matrix);
+  float c_xyz[] = {0,0,0};
+  scale_matrix(object->matrix, scale, c_xyz);
+  /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
+  // get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix);
 }
 
+
+
+
+
+
+
+//ここいらはどうやら、スプライトを取得する部分。
+/*
 static void
 gSprite_Init_Png(const char *texname)
 {
@@ -73,15 +206,20 @@
     fflush(stderr);
     exit(EXIT_FAILURE);
   }
-
+  
+  
   if (ps2util_tex_Set(sprite_tex) == -1) {
     fprintf(stderr,
 	    "cannot set texture - init_png().\n");
     fflush(stderr);
     exit(EXIT_FAILURE);
   }
+
+  
 }
+*/
 
+ /*
 static void
 gSprite_Create()
 {
@@ -96,21 +234,22 @@
     }
     ps2util_sprite_Unuse_alpha(&sp[i]);
   }
-
+ 
   flag_spriteInited = false;
+
 }
-
+*/
+  
 
 void
 gSprite_Init()
 {
   ps2util_graphic_Init();
-  gSprite_Init_Png("img/main2.png");
-  gSprite_Create(); // スプライト生成
-
-
-  // スプライトの登録 
-  gSprite_DefSprite(10,   1,   1, 512, 666); // タイトル  
+  //gSprite_Init_Png("img/main2.png");
+  //gSprite_Create(); // スプライト生成
+  
+   
+  /*  gSprite_DefSprite(10,   1,   1, 512, 666); // タイトル  
   gSprite_DefSprite(17,   1,  35,  33,  33); // 選択マーク
   gSprite_DefSprite(23,   1,   1, 106,  34); // スピードメーター
   gSprite_DefSprite(24,  51,  40,  18,  20); // 右矢印
@@ -124,7 +263,7 @@
   gSprite_DefSprite(53,  12, 116, 165,  140);
   gSprite_DefSprite(81, 115,   1, 148, 114); // 選択画面のコース 
   // 本当は (82, 272,...)です。二つ目のコース絵がないので 
-  gSprite_DefSprite(82, 272,   1, 148, 114);
+  gSprite_DefSprite(82, 272,   1, 148, 114);*/
 
 }
 
@@ -140,6 +279,8 @@
   sp_counter = 0;
 }
 
+
+
 void
 gSprite_Draw_Reset()
 {
@@ -149,6 +290,7 @@
 }
 
 
+
 void
 gSprite_PutSprite_Pause()
 {
--- a/gSprite.h	Wed Jun 15 23:31:59 2011 +0900
+++ b/gSprite.h	Thu Jun 16 04:05:33 2011 +0900
@@ -1,290 +1,33 @@
-//SgoexCerium.ccより
-#include "matrix_calc.h"
-#include "TaskManager.h"
-#include "SceneGraph.h"
-#include "Application.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "libps2.h"
-#include "ps2util.h"
-#include <stdbool.h>
-
-#define DEFOBJ 100
-#define SPRITE_COL 0x4f
-#define SCREEN_HALF_W 320
-#define SCREEN_HALF_H 240
-
-static SpriteTable   sptable[DEFOBJ];
-static ps2utilSprite sp[DEFOBJ]; // 表示スプライト用スタック
-static unsigned int  sp_counter;
-static bool          flag_spriteInited = false; // スプライトロードフラグ
-
-static TEXTURE *sprite_tex;
-
-
-
-extern Viewer *droot;
+#ifndef GSPRITE_H
+#define GSPRITE_H
 
-static SceneGraphPtr root;
-
-
-//SgoexCerium.ccより
-void
-flip()
-{
-    CameraPtr camera = droot->sgroot->getCamera();
-
-    droot->sgroot->flip();
-    droot->sgroot->lightCalc();
-
-    root = droot->createSceneGraph();
-    //root->xyz[0] = screen_w/2;
-    //root->xyz[1] = screen_h/2;;
-    root->xyz[0] = 0;
-    root->xyz[1] = 0;
-    root->xyz[2] = 30.0f;
-
-    /*親の回転、座標から、子の回転、座標を算出*/
-    get_matrix(root->matrix, root->angle, root->xyz, camera->matrix);
-    /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
-    get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix);
-    //出力して、次のものを出力するための準備
-    droot->setSceneData(root);
-}
-
-
-
-
+//スプライトの優先順位らしい ?
+#define SPRITE_PRIO_FOREGROUND 1
 
-/*void
-gSprite_DefSprite(int number, int tx, int ty, int tw, int th)
-{
-  sptable[number].tx = tx;
-  sptable[number].ty = ty;
-  sptable[number].tw = tw;
-  sptable[number].th = th;
-}*/
-void
-gSprite_DefSprite(int number, const char *name, float w, float h, int color, OBJECT *obj)
-{
-    SpriteTable *m = &sptable[number];
-    m->w = w;
-    m->h = h;
-    m->color = (color & 32);
-    m->mx = w / 2; //画像の中心を座標としたいらしい。
-    m->my = h / 2;
-    m->tex_w = power_of_two(m->w);
-    m->tex_h = power_of_two(m->h);
-    m->texture = (int *)name;
-
-}
-
-
-
-
-
-/*void
-gSprite_PutSprite(int number, int x, int y)
-{
-    ps2utilSprite *p = &sp[sp_counter];
-
-    ps2util_sprite_Set_basicAttribute(
-	p,
-	(unsigned short)x, (unsigned short)y,
-	(unsigned short)sptable[number].tw*2, (unsigned short)sptable[number].th*2,
-	(unsigned short)sptable[number].tx, (unsigned short)sptable[number].ty,
-	(unsigned short)sptable[number].tw, (unsigned short)sptable[number].th,
-	SPRITE_PRIO_FOREGROUND);
-
-    ps2util_sprite_Request(p);
-    sp_counter++;
-}*/
-void
-gSprite_PutSprite(int number, short x, short y, int zorder)
-{
-    SpriteTable *m = &sptable[number];
-    char *name = (char *) m->texture;
-if (!name) {
-    printf("PutSprite %d unknown\n",number);
-    return;
-}
-    SceneGraphPtr object = droot->createSceneGraph(name);
-    //object->c_xyz[0] = m->mx;
-    //object->c_xyz[1] = m->my;
-    root->addChild(object);
-
-    object->xyz[0] -= object->c_xyz[0]*my_scale;
-    object->xyz[1] -= object->c_xyz[1]*my_scale;
-    object->xyz[2] -= object->c_xyz[2];
-
-    object->xyz[0] += x+m->mx;
-    object->xyz[1] += y+m->my;
-    object->xyz[2] += zorder * 0.01;
-
-    float scale[] = {my_scale,my_scale,1};
-    //float c_xyz[] = {0,0,0};
-    //scale_matrix(object->matrix, scale, c_xyz);
-
-    /*親の回転、座標から、子の回転、座標を算出*/
-    //get_matrix_scale(object->matrix, object->angle, object->xyz, scale, root->matrix);
-
-    /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
-    // get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix);
-}
-
-
-
+typedef struct SpriteTable {
+  short dx;
+  short dy;
+  short w;
+  short h;
+  short mx;
+  short my;
+  int color;
+  int page;
+  int tex_w;
+  int tex_h;
+  int *texture;
+  int tex_id;  // for open gl                                                                                        
+} SpriteTable;
 
 
 
-/*void
-gSprite_PutSpriteEx(int number, int x, int y, float w, float h)
-{
-    ps2utilSprite *p = &sp[sp_counter];
-
-    ps2util_sprite_Set_basicAttribute(
-	p,
-	(unsigned short)x, (unsigned short)y,
-	(unsigned short)sptable[number].tw*w, (unsigned short)sptable[number].th*h,
-	(unsigned short)sptable[number].tx, (unsigned short)sptable[number].ty,
-	(unsigned short)sptable[number].tw, (unsigned short)sptable[number].th,
-	SPRITE_PRIO_FOREGROUND);
-
-    ps2util_sprite_Request(p);
-    sp_counter++;
-}*/
-void
-PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle)
-{
- if (1) {
-    PutSprite(1, x, y, number);
-    return;
- }
-
-    SpriteTable *m = &sptable[number];
-    char *name = (char *) m->texture;
-if (!name) {
-    printf("PutSpriteEx %d unknown\n",number);
-    return;
-}
-    SceneGraphPtr object = droot->createSceneGraph(name);
-    root->addChild(object);
-
-    float scale[] = {my_scale*scalex*4,my_scale*scaley*4,1};
-
-    /*親の回転、座標から、子の回転、座標を算出*/
-    object->xyz[0] = x - object->c_xyz[0] * my_scale - m->w*my_scale;
-    object->xyz[1] = y - object->c_xyz[1] * my_scale - m->h*my_scale;
-    object->xyz[2] = number * 0.01;
-    //object->c_xyz[0] = m->mx;
-    //object->c_xyz[1] = m->my;
-    object->angle[3] = angle * (3.1415926*2/4096);
-    get_matrix(object->matrix, object->angle, object->xyz, root->matrix);
-    float c_xyz[] = {0,0,0};
-    scale_matrix(object->matrix, scale, c_xyz);
-    /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
-    // get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix);
-}
-
-
-
-
-
-
-
-//ここいらはどうやら、スプライトを取得する部分。
-
-static void
-gSprite_Init_Png(const char *texname)
-{
-  if (!(sprite_tex = read_png_file(texname))) {
-    fprintf(stderr,
-	    "cannot creat texture - init_png().\n");
-    fflush(stderr);
-    exit(EXIT_FAILURE);
-  }
-
-  if (ps2util_tex_Set(sprite_tex) == -1) {
-    fprintf(stderr,
-	    "cannot set texture - init_png().\n");
-    fflush(stderr);
-    exit(EXIT_FAILURE);
-  }
+// extern とってみたけど、なにか不都合ありますか?:miya
+void gSprite_Init();
+void gSprite_Draw_Reset();
+void gSprite_PutSprite(int number, int x, int y);
+//void gSprite_PutSpriteEx(int number, int x, int y, float w, float h);
+void gSprite_PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle);
+//void gSprite_DefSprite(int number, int tx, int ty, int tw, int th);
+void gSprite_DefSprite(int number, const char *name, float w, float h, int color);//, OBJECT *obj);
 
-}
-
-static void
-gSprite_Create()
-{
-  int i;
-
-  for (i=0; i<DEFOBJ; i++) {
-    if (ps2util_sprite_Create(&sp[i], sprite_tex) == -1) {
-      fprintf(stderr,
-	      "cannot create sprite No.%d - create_sprite()\n", i);
-      fflush(stderr);
-      exit(EXIT_FAILURE);
-    }
-    ps2util_sprite_Unuse_alpha(&sp[i]);
-  }
-
-  flag_spriteInited = false;
-}
-
-
-void
-gSprite_Init()
-{
-  ps2util_graphic_Init();
-  //gSprite_Init_Png("img/main2.png");
-  //gSprite_Create(); // スプライト生成
-  
-  sgroot->createFromXMLfile("./xml_files/boss.xml");
- 
-  /*  gSprite_DefSprite(10,   1,   1, 512, 666); // タイトル  
-  gSprite_DefSprite(17,   1,  35,  33,  33); // 選択マーク
-  gSprite_DefSprite(23,   1,   1, 106,  34); // スピードメーター
-  gSprite_DefSprite(24,  51,  40,  18,  20); // 右矢印
-  gSprite_DefSprite(25,  33,  40,  17,  20); // 左矢印
-  gSprite_DefSprite(26,  56,  89,  55,  26); // km/h
-  gSprite_DefSprite(27,  62,  62,  39,  26); // Rap
-  gSprite_DefSprite(28, 430,  62,  53,  46); // 1p
-  gSprite_DefSprite(29, 460,   6,  53,  46); // 2P 
-  gSprite_DefSprite(51, 333, 116, 165,  140); // 選択画面の車 
-  gSprite_DefSprite(52, 181, 116, 165,  140);
-  gSprite_DefSprite(53,  12, 116, 165,  140);
-  gSprite_DefSprite(81, 115,   1, 148, 114); // 選択画面のコース 
-  // 本当は (82, 272,...)です。二つ目のコース絵がないので 
-  gSprite_DefSprite(82, 272,   1, 148, 114);*/
-
-}
-
-
-static void
-gSprite_Clear()
-{
-  int i;
-
-  for (i=0; i<DEFOBJ; i++) {
-    sprite_disappear(&sp[i].attribute);
-  }
-  sp_counter = 0;
-}
-
-
-
-void
-gSprite_Draw_Reset()
-{
-  if (flag_spriteInited == true) {
-    gSprite_Clear();
-  }
-}
-
-
-
-void
-gSprite_PutSprite_Pause()
-{
-}
+#endif
--- a/game.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/game.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -41,6 +41,7 @@
     if (flg == false) {
       break;
     }
+
     schedule(&game);
     
 #ifdef LINDA
--- a/libps2.h	Wed Jun 15 23:31:59 2011 +0900
+++ b/libps2.h	Thu Jun 16 04:05:33 2011 +0900
@@ -55,6 +55,7 @@
  public:
   FMATRIX transfer;         // transfer matrix
 };
+
 // sprite.hから
 typedef struct {
   //__u64 rgbaq;
--- a/ps2util.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/ps2util.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -51,7 +51,7 @@
 /*
   ps2 内の texture.c から
 */
-
+/*
 TEXTURE* read_png_file(const char *texname)
 {
   printf("trace\n");  
@@ -60,19 +60,21 @@
   
   return tex;
 }
+*/
 
-int ps2util_tex_Set(TEXTURE* tex)
+
+int ps2util_tex_Set(OBJECT* tex)
 {
   return -1;
 }
 
-int ps2util_sprite_Create(ps2utilSprite *Sp, TEXTURE *sprite_tex)
+int ps2util_sprite_Create(ps2utilSprite *Sp, OBJECT *sprite_tex)
 {
   return -1;
 }
 
 
-void ps2util_obj_Set_texture(OBJECT* car_body, TEXTURE *tex)
+void ps2util_obj_Set_texture(OBJECT* car_body, OBJECT *tex)
 {
   //none
 }
@@ -223,6 +225,8 @@
   //none
 }
 
+extern SceneGraphPtr root;
+
 //scenegra
 void ps2util_obj_Draw(OBJECT *object)
 {
@@ -288,6 +292,7 @@
   テクスチャに割り振ったメモリの解放処理?
   元ファイル:texture.c
 */
+/*
 void free_texture(TEXTURE *tex)
 {
   if (tex == NULL) return;
@@ -297,7 +302,7 @@
   free(tex->free_image);
   free(tex);
 }
-
+*/
 
 
 /*
@@ -327,12 +332,12 @@
 }
 
 
-
+/*
 void ps2util_tex_Exclude( TEXTURE* t )
 {
   //const char *test = "test";
 }
-
+*/
 
 void ps2util_sprite_Draw()
 {
--- a/ps2util.h	Wed Jun 15 23:31:59 2011 +0900
+++ b/ps2util.h	Thu Jun 16 04:05:33 2011 +0900
@@ -74,8 +74,7 @@
 
 //void ps2util_tex_Exclude( TEXTURE* t );
 
-//void free_texture(TEXTURE *tex);
-
+//void free_texture(TEXnTURE *tex);
 void ps2util_obj_Free(OBJECT* p_body);
 
 
--- a/schedule.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/schedule.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -105,8 +105,15 @@
 static void 
 play_init( Game *game )
 {
+  printf("plya_init1()\n");
+  printf("game->car_id = %d\n",game->car_id);
+  //printf("game->jiki->speed = %f\n",game->jiki->speed);
   game->jiki = car_init(game->car_id);
+
+  printf("plya_init2()\n");
   carNode_append(game->jiki);
+
+  printf("plya_init3()\n");
   field_init(game->course_id);
 }
 
@@ -134,6 +141,8 @@
 void
 sche_game_init(Game *game)
 {
+  printf("sche_game_init()\n");
+  
   game_env_init(game);
   graphic_init();
   camera_init();
@@ -189,6 +198,8 @@
 void
 sche_game_opening(Game *game)
 {
+  printf("sche_game_opening\n");
+  
   static int blink_count = 0;
   if (game->play_id==1){
     if (blink_count < 35) {
@@ -196,7 +207,8 @@
     }
     blink_count = (blink_count > 70) ? 0 : blink_count + 1;
 
-    if (pad.st != 1) { goto OPENING; }
+    //    if (pad.st != 1) { goto OPENING; }
+    if (1) { goto OPENING; }
   }
     
   set_schedule_assumption(sche_game_select_car);
@@ -221,13 +233,15 @@
 void
 sche_game_select_car(Game *game)
 {
+  printf("sche_game_select_car()\n");
   if (i==1){
     title_finish_call();
     i=2;
   }
-  gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 190, 200, 1.5, 1.5);
+  gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 190, 200, 1.5, 1.5, 0.0);
   gSprite_PutSprite(24, 460, 300);
   gSprite_PutSprite(25, 120, 300);
+
   gFont_SetString("SELECT CAR", 180, 50);
  
   if (pad.right == 1) {
@@ -240,9 +254,9 @@
   }
 
   if (game->play_id == 1)
-    if (pad.circle != 1) { goto SELECT_CAR; }
- 
+    if (pad.circle != 1) { goto SELECT_CAR; } 
     
+
   set_schedule_assumption(sche_game_select_course);
     
  SELECT_CAR:
@@ -252,7 +266,8 @@
 void
 sche_game_select_course(Game *game)
 {
-  gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 190, 200, 1.7, 1.8);
+  printf("sche_game_select_course()\n");
+  gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 190, 200, 1.7, 1.8, 0.0);
   gSprite_PutSprite(24, 460, 300);
   gSprite_PutSprite(25, 120, 300);
 
@@ -283,11 +298,12 @@
 void
 sche_game_ready(Game *game)
 {
+  printf("sche_game_ready()\n");
   static int blink_count = 0;//
 
   gSprite_PutSprite(27+game->play_id,265,10);
-  gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 50, 120, 1.5, 1.5);
-  gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 340, 120, 1.7, 1.8);
+  gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 50, 120, 1.5, 1.5 , 0.0);
+  gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 340, 120, 1.7, 1.8 , 0.0);
 	
   /* 点滅 */
   if (blink_count < 35) {
@@ -310,8 +326,12 @@
 void
 sche_game_main_init(Game *game)
 {
-  if (!game->jiki)
+  printf("sche_game_main_init()\n");
+  if (!game->jiki){
+    printf("sche_game_main_init()__________\n");
     play_init(game);
+  }
+
   RUNNIG=0;
 
   set_schedule_assumption(sche_game_main_ready);
@@ -352,7 +372,8 @@
   gFont_SetStringInt(game->rap, 50, 100);
 
   /* スピードメーター */
-  gSprite_DefSprite(23, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34);
+  //  gSprite_DefSprite(23, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34);
+  gSprite_DefSprite(23, "name", (float)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34.0, 100);
   gSprite_PutSprite(23, 400, 400);
   /* km/h */
   gSprite_PutSprite(26, 470, 350);
@@ -448,7 +469,7 @@
   car_update(game, game->jiki);
   field_update(game->jiki);
   carNode_draw();
-  camera_update(game,game->jiki->body);
+  camera_update(game,game->jiki->body->transfer);
 
   if (pad.st == 1) {
     set_schedule_assumption(sche_game_main_finish);
@@ -492,6 +513,9 @@
 void
 schedule(Game *game)
 {
+  printf("----------------------\n");
+  printf("schedule()\n");
+
   sche_func(game);
 
   if (linda_update(change_state, game) == true){
--- a/title_scene.cc	Wed Jun 15 23:31:59 2011 +0900
+++ b/title_scene.cc	Thu Jun 16 04:05:33 2011 +0900
@@ -14,28 +14,32 @@
 
 static ps2utilSprite title_sprite;
 
-static TEXTURE *title_img;
+//static TEXTURE *title_img;
 
 #define TITLE_IMG_FILE "img/title.png"
 
 
 static void
 title_init() 
-{    
+{
+  /*
   //load texture 
   title_img = read_png_file( TITLE_IMG_FILE );
   ps2util_tex_Set( title_img );
-
+  */
+  
   /*    
 	create sprite object
   */
-
+  
+  /*
     ps2util_sprite_Create( &title_sprite, title_img );
     ps2util_sprite_Set_basicAttribute( &title_sprite, 
     0, 0, 650, 500, 0, 0, 512, 256, SPRITE_PRIO_FOREGROUND );
 
     ps2util_sprite_Use_alpha( &title_sprite );
     ps2util_sprite_Request( &title_sprite );
+  */
 }
 
 void
@@ -48,8 +52,8 @@
 title_finish()
 {
   ps2util_sprite_Destroy( &title_sprite );
-  ps2util_tex_Exclude( title_img );
-  free_texture( title_img );
+  //ps2util_tex_Exclude( title_img );
+  //free_texture( title_img );
 }
 
 void