annotate gSprite.h @ 153:0a375e9c4288 gongo tip

close
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 30 Jul 2011 14:45:21 +0900
parents d1ddd095ab03
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
1 #ifndef GSPRITE_H
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
2 #define GSPRITE_H
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
3
124
e085768
parents: 122
diff changeset
4 #include "Magoroku.h"
e085768
parents: 122
diff changeset
5
e085768
parents: 122
diff changeset
6 //+415.692169
126
030394675d8e succes compile
e085768
parents: 125
diff changeset
7 #define TEST_Z_GRID -700 // とりあえず
124
e085768
parents: 122
diff changeset
8
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
9 // enum_SpriteNameの略
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
10 // 数値に意味が無いんだったら、普通に0から始めましょう
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
11 enum eSpName {
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
12 TITLE = 10,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
13 SELECT = 17,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
14 SP_METER = 23,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
15 R_ARROW = 24,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
16 L_ARROW = 25,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
17 KM = 26, // Km/h
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
18 RAP = 27,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
19 PLAYER_1 = 28,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
20 PLAYER_2 = 29,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
21
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
22 SELECT_CAR_1 = 51,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
23 SELECT_CAR_2 = 52,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
24 SELECT_CAR_3 = 53,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
25
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
26 SELECT_CORSE_1 = 81,
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
27 SELECT_CORSE_2 = 82,
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
28
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
29 /*
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
30 CAR_ASURADA,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
31 CAR_KART,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
32 CAR_ASURADA_GSX,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
33 CAR_KURUMA,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
34 */
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
35 CHOICE_CAR, // プレイヤーが選択した車.
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
36
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
37 COURSE1_1,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
38 COURSE1_2,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
39 COURSE1_3,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
40
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
41 COURSE2_1,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
42 COURSE2_2,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
43 COURSE2_3,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
44
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
45 COURSE3_1,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
46 COURSE3_2,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
47 COURSE3_3,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
48
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
49 COURSE4_1,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
50 COURSE4_2,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
51 COURSE4_3,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
52
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
53 COURSE5_1,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
54 COURSE5_2,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
55 COURSE5_3,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
56
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
57 COURSE6_1,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
58 COURSE6_2,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
59 COURSE6_3,
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
60
146
d1ddd095ab03 draw dot hit cource -rainbow-
e085768
parents: 130
diff changeset
61 HIT_TEST,
d1ddd095ab03 draw dot hit cource -rainbow-
e085768
parents: 130
diff changeset
62
d1ddd095ab03 draw dot hit cource -rainbow-
e085768
parents: 130
diff changeset
63 SP_TABLE_MAX_NUM // spTableの最大数+1になるはず
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
64 };
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
65
125
c62fec1dd2f8 outPutPicture
e085768
parents: 124
diff changeset
66
c62fec1dd2f8 outPutPicture
e085768
parents: 124
diff changeset
67
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
68 //スプライトの優先順位らしい ?
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
69 #define SPRITE_PRIO_FOREGROUND 1
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
70
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
71 typedef struct SpriteTable {
119
f2e2460b4011 draw_title
e085768
parents: 116
diff changeset
72 // short dx;
f2e2460b4011 draw_title
e085768
parents: 116
diff changeset
73 // short dy;
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
74 short w;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
75 short h;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
76 short mx;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
77 short my;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
78 int color;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
79 int page;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
80 int tex_w;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
81 int tex_h;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
82 int *texture;
119
f2e2460b4011 draw_title
e085768
parents: 116
diff changeset
83 int tex_id; // for open gl
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
84
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
85 } SpriteTable;
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 96
diff changeset
86
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
87
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
88
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
89 // extern とってみたけど、なにか不都合ありますか?:miya
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
90 void gSprite_Init();
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
91 void gSprite_Draw_Reset();
124
e085768
parents: 122
diff changeset
92
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
93 void gSprite_PutSprite(bool ScreenPos,int number, int x, int y, int z);
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
94
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
95 void gSprite_PutSpriteEx(bool ScreenPos, int number, int x, int y, int z, float scalex, float scaley, float angle);
124
e085768
parents: 122
diff changeset
96
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
97
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
98 void gSprite_DefSprite(int number, const char *name, float w, float h, int color);
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
99
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
100 #endif
119
f2e2460b4011 draw_title
e085768
parents: 116
diff changeset
101
f2e2460b4011 draw_title
e085768
parents: 116
diff changeset
102 void flip();
124
e085768
parents: 122
diff changeset
103
e085768
parents: 122
diff changeset
104 // rootのポインターを返す
e085768
parents: 122
diff changeset
105 SceneGraphPtr getRootPtr( void );
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
106
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
107 /*
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
108 float get_cameraPos(int n);
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
109 n==0 retrun x
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
110 n==1 return y
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
111 n==2 return z
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
112 n==3 ?
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
113 */
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
114 float get_cameraPos( int n );
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
115
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
116 // 引数の座標にカメラが追従する
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
117 void set_cameraPos( FVECTOR, FVECTOR );
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
118
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
119 void gSprite_PutObject(int number,OBJECT *obj);
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
120
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
121
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
122 // Viewer *drootにxmlファイルを追加
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
123 void call_createFromXMLfile( char *filename );
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
124
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
125 // createScenGraphe()する
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
126 /*
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
127 OBJECT* call_createSceneGraph( char *filename );
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
128 OBJECT* call_createSceneGraph( void );
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
129 */
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
131 // テスト用関数
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
132 void cameraControl( void );