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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
3 #include "title_scene.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
4
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
5 typedef enum {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
6 TITLE_INIT,
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
7 TITLE_MAIN,
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
8 TITLE_FINISH
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
9 } TITLE_STATE;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
10
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
15
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
16 #define TITLE_IMG_FILE "img/title.png"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
17
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
18
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
19 static void
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
20 title_init()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
21 {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
22 /*
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
23 load texture
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
27
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
28 /*
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
29 create sprite object
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
30 */
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
31 /*
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
32 ps2util_sprite_Create( &title_sprite, title_img );
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
35 ps2util_sprite_Use_alpha( &title_sprite );
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
38 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
39
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
40 void
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
41 title_init_call()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
42 {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
43 title_init();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
44 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
45
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
46 static void
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
47 title_finish()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
52 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
53
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
54 void
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
55 title_finish_call()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
56 {
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
57 title_finish();
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
58 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
59
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
60 int
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
61 title_scene()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
62 {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
63 static TITLE_STATE state = TITLE_INIT;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
64 int pad;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
65
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
66 switch (state) {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
67 case TITLE_INIT:
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
68 title_init();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
69 state = TITLE_MAIN;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
70 break;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
71
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
75 break;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
76
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
77 case TITLE_FINISH:
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
78 title_finish();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
79 return -1;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
80
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
81 default:
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
82 break;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
83 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
84 return 0;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
85 }