Mercurial > hg > old > magoroku_racing
annotate title_scene.c @ 90:8edae89a3877
compile on Mac OS X
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 May 2011 16:41:21 +0900 |
parents | 6910aeb52843 |
children | cb6c6de125dc |
rev | line source |
---|---|
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
1 //#include "libps2.h" |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
2 //#include "ps2util.h" |
0 | 3 #include "title_scene.h" |
4 | |
5 typedef enum { | |
6 TITLE_INIT, | |
7 TITLE_MAIN, | |
8 TITLE_FINISH | |
9 } TITLE_STATE; | |
10 | |
11 | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
12 //static ps2utilSprite title_sprite; |
0 | 13 |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
14 //static TEXTURE *title_img; |
0 | 15 |
16 #define TITLE_IMG_FILE "img/title.png" | |
17 | |
18 | |
19 static void | |
20 title_init() | |
21 { | |
22 /* | |
23 load texture | |
24 */ | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
25 // title_img = read_png_file( TITLE_IMG_FILE ); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
26 // ps2util_tex_Set( title_img ); |
0 | 27 |
28 /* | |
29 create sprite object | |
30 */ | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
31 /* |
0 | 32 ps2util_sprite_Create( &title_sprite, title_img ); |
33 ps2util_sprite_Set_basicAttribute( &title_sprite, | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
34 0, 0, 650, 500, 0, 0, 512, 256, SPRITE_PRIO_FOREGROUND ); |
0 | 35 ps2util_sprite_Use_alpha( &title_sprite ); |
36 ps2util_sprite_Request( &title_sprite ); | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
37 */ |
0 | 38 } |
39 | |
40 void | |
41 title_init_call() | |
42 { | |
43 title_init(); | |
44 } | |
45 | |
46 static void | |
47 title_finish() | |
48 { | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
49 // ps2util_sprite_Destroy( &title_sprite ); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
50 // ps2util_tex_Exclude( title_img ); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
51 // free_texture( title_img ); |
0 | 52 } |
53 | |
54 void | |
55 title_finish_call() | |
56 { | |
2 | 57 title_finish(); |
0 | 58 } |
59 | |
60 int | |
61 title_scene() | |
62 { | |
63 static TITLE_STATE state = TITLE_INIT; | |
64 int pad; | |
65 | |
66 switch (state) { | |
67 case TITLE_INIT: | |
68 title_init(); | |
69 state = TITLE_MAIN; | |
70 break; | |
71 | |
72 case TITLE_MAIN: | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
73 // pad = sjoy_get_ps2_button( JOYPAD_1 ); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
74 // state = (pad & SJOY_PS2_START) ? TITLE_FINISH : TITLE_MAIN; |
0 | 75 break; |
76 | |
77 case TITLE_FINISH: | |
78 title_finish(); | |
79 return -1; | |
80 | |
81 default: | |
82 break; | |
83 } | |
84 return 0; | |
85 } |