Mercurial > hg > old > magoroku_racing
comparison 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 (2011-05-19) |
parents | 6910aeb52843 |
children | cb6c6de125dc |
comparison
equal
deleted
inserted
replaced
89:aff757cc46d7 | 90:8edae89a3877 |
---|---|
1 /* | 1 //#include "libps2.h" |
2 * $Id$ | 2 //#include "ps2util.h" |
3 */ | |
4 #include "libps2.h" | |
5 #include "ps2util.h" | |
6 #include "title_scene.h" | 3 #include "title_scene.h" |
7 | 4 |
8 typedef enum { | 5 typedef enum { |
9 TITLE_INIT, | 6 TITLE_INIT, |
10 TITLE_MAIN, | 7 TITLE_MAIN, |
11 TITLE_FINISH | 8 TITLE_FINISH |
12 } TITLE_STATE; | 9 } TITLE_STATE; |
13 | 10 |
14 | 11 |
15 static ps2utilSprite title_sprite; | 12 //static ps2utilSprite title_sprite; |
16 | 13 |
17 static TEXTURE *title_img; | 14 //static TEXTURE *title_img; |
18 | 15 |
19 #define TITLE_IMG_FILE "img/title.png" | 16 #define TITLE_IMG_FILE "img/title.png" |
20 | 17 |
21 | 18 |
22 static void | 19 static void |
23 title_init() | 20 title_init() |
24 { | 21 { |
25 /* | 22 /* |
26 load texture | 23 load texture |
27 */ | 24 */ |
28 title_img = read_png_file( TITLE_IMG_FILE ); | 25 // title_img = read_png_file( TITLE_IMG_FILE ); |
29 ps2util_tex_Set( title_img ); | 26 // ps2util_tex_Set( title_img ); |
30 | 27 |
31 /* | 28 /* |
32 create sprite object | 29 create sprite object |
33 */ | 30 */ |
31 /* | |
34 ps2util_sprite_Create( &title_sprite, title_img ); | 32 ps2util_sprite_Create( &title_sprite, title_img ); |
35 ps2util_sprite_Set_basicAttribute( &title_sprite, | 33 ps2util_sprite_Set_basicAttribute( &title_sprite, |
36 0, 0, 650, 500, 0, 0, 512, 256, SPRITE_PRIO_FOREGROUND ); | 34 0, 0, 650, 500, 0, 0, 512, 256, SPRITE_PRIO_FOREGROUND ); |
37 ps2util_sprite_Use_alpha( &title_sprite ); | 35 ps2util_sprite_Use_alpha( &title_sprite ); |
38 ps2util_sprite_Request( &title_sprite ); | 36 ps2util_sprite_Request( &title_sprite ); |
37 */ | |
39 } | 38 } |
40 | 39 |
41 void | 40 void |
42 title_init_call() | 41 title_init_call() |
43 { | 42 { |
45 } | 44 } |
46 | 45 |
47 static void | 46 static void |
48 title_finish() | 47 title_finish() |
49 { | 48 { |
50 ps2util_sprite_Destroy( &title_sprite ); | 49 // ps2util_sprite_Destroy( &title_sprite ); |
51 ps2util_tex_Exclude( title_img ); | 50 // ps2util_tex_Exclude( title_img ); |
52 free_texture( title_img ); | 51 // free_texture( title_img ); |
53 } | 52 } |
54 | 53 |
55 void | 54 void |
56 title_finish_call() | 55 title_finish_call() |
57 { | 56 { |
69 title_init(); | 68 title_init(); |
70 state = TITLE_MAIN; | 69 state = TITLE_MAIN; |
71 break; | 70 break; |
72 | 71 |
73 case TITLE_MAIN: | 72 case TITLE_MAIN: |
74 pad = sjoy_get_ps2_button( JOYPAD_1 ); | 73 // pad = sjoy_get_ps2_button( JOYPAD_1 ); |
75 state = (pad & SJOY_PS2_START) ? TITLE_FINISH : TITLE_MAIN; | 74 // state = (pad & SJOY_PS2_START) ? TITLE_FINISH : TITLE_MAIN; |
76 break; | 75 break; |
77 | 76 |
78 case TITLE_FINISH: | 77 case TITLE_FINISH: |
79 title_finish(); | 78 title_finish(); |
80 return -1; | 79 return -1; |