Mercurial > hg > Game > Cerium
annotate Renderer/Engine/polygon.h @ 1254:34944900f266 draft
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Nov 2011 16:56:11 +0900 |
parents | b8adf4e95e96 |
children | ab9b7d21b32b |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_POLYGON |
2 #define INCLUDED_POLYGON | |
3 | |
539 | 4 #include <SDL.h> |
283 | 5 #include <libxml/parser.h> |
539 | 6 #include "polygon_pack.h" |
7 #include "SpanPack.h" | |
8 #include "texture.h" | |
1129 | 9 #include "TaskManager.h" |
283 | 10 |
11 class Polygon { | |
12 public: | |
1130 | 13 |
283 | 14 long long size; |
15 const char *name; | |
16 const char *parent_name; | |
17 | |
1130 | 18 float *matrix; |
19 float *real_matrix; | |
20 texture_list *texture_info; | |
21 | |
1125 | 22 PolygonPackPtr pp; |
23 int pp_num; | |
24 | |
283 | 25 float xyz[4]; // position |
26 float angle[4]; // angle | |
27 float c_xyz[4]; // center of rotation | |
28 float *anim; | |
1050 | 29 float scale[3]; |
539 | 30 |
283 | 31 Polygon(void); |
32 | |
33 void parameter_change(char *name, float x, float y, float z, float ax, float ay, float az); | |
34 //void load_texture(char *image_name); | |
35 //void draw(float *stack); | |
36 //void draw(SceneGraphPack *sgp); | |
37 //void draw(PolygonPack *pp); | |
38 //void draw(SpanPack *sp); | |
39 Uint32 get_rgb(int tx, int ty); | |
40 | |
41 public: | |
1130 | 42 void* |
43 polygon_allocate(int size) | |
44 { | |
45 void *buff = 0; | |
46 if (size==0) return 0; | |
1133 | 47 #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN) |
48 buff = malloc(size); | |
49 #else | |
50 posix_memalign(&buff, DEFAULT_ALIGNMENT, size); | |
51 #endif | |
1142
801d57ae1e29
cut compile CreatePolygonTask on spe side because not enough spe memory. We have to use code loading.
yutaka@localhost.localdomain
parents:
1133
diff
changeset
|
52 if (buff==0) |
801d57ae1e29
cut compile CreatePolygonTask on spe side because not enough spe memory. We have to use code loading.
yutaka@localhost.localdomain
parents:
1133
diff
changeset
|
53 printf("Polygon:Can't allocate memory\n"); |
1130 | 54 return buff; |
1133 | 55 |
1130 | 56 } |
57 | |
283 | 58 void position_init(void); |
59 | |
60 void tree_draw(); | |
61 void pickup_coordinate(char *cont); | |
62 void pickup_normal(char *cont); | |
63 void pickup_model(char *cont); | |
64 void pickup_texture(char *cont); | |
1205
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1142
diff
changeset
|
65 |
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1142
diff
changeset
|
66 void font_coordinate(int baseline, int row, int width); |
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1142
diff
changeset
|
67 void font_texture(float row,float width); |
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1142
diff
changeset
|
68 void font_normal(); |
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1142
diff
changeset
|
69 void font_model(); |
283 | 70 }; |
71 | |
72 #endif |