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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCLUDED_POLYGON
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_POLYGON
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include <SDL.h>
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
5 #include <libxml/parser.h>
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
6 #include "polygon_pack.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
7 #include "SpanPack.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
8 #include "texture.h"
1129
a8bffdb5d2e3 bus error
yutaka@localhost.localdomain
parents: 1128
diff changeset
9 #include "TaskManager.h"
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
10
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
11 class Polygon {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
12 public:
1130
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
13
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
14 long long size;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
15 const char *name;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
16 const char *parent_name;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17
1130
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
18 float *matrix;
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
19 float *real_matrix;
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
20 texture_list *texture_info;
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
21
1125
b733c7903d07 remove old code
yutaka@localhost.localdomain
parents: 1055
diff changeset
22 PolygonPackPtr pp;
b733c7903d07 remove old code
yutaka@localhost.localdomain
parents: 1055
diff changeset
23 int pp_num;
b733c7903d07 remove old code
yutaka@localhost.localdomain
parents: 1055
diff changeset
24
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
25 float xyz[4]; // position
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 float angle[4]; // angle
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
27 float c_xyz[4]; // center of rotation
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
28 float *anim;
1050
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 915
diff changeset
29 float scale[3];
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
30
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 Polygon(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 void parameter_change(char *name, float x, float y, float z, float ax, float ay, float az);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34 //void load_texture(char *image_name);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 //void draw(float *stack);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36 //void draw(SceneGraphPack *sgp);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37 //void draw(PolygonPack *pp);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38 //void draw(SpanPack *sp);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39 Uint32 get_rgb(int tx, int ty);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41 public:
1130
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
42 void*
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
43 polygon_allocate(int size)
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
44 {
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
45 void *buff = 0;
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
46 if (size==0) return 0;
1133
kaito@dolphins
parents: 1130
diff changeset
47 #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN)
kaito@dolphins
parents: 1130
diff changeset
48 buff = malloc(size);
kaito@dolphins
parents: 1130
diff changeset
49 #else
kaito@dolphins
parents: 1130
diff changeset
50 posix_memalign(&buff, DEFAULT_ALIGNMENT, size);
kaito@dolphins
parents: 1130
diff changeset
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
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
54 return buff;
1133
kaito@dolphins
parents: 1130
diff changeset
55
1130
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
56 }
root@dolphins.cr.ie.u-ryukyu.ac.jp
parents: 1129
diff changeset
57
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
58 void position_init(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
59
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
60 void tree_draw();
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
61 void pickup_coordinate(char *cont);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
62 void pickup_normal(char *cont);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
63 void pickup_model(char *cont);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
70 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
71
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
72 #endif