annotate Renderer/Engine/Span.h @ 539:3bc98f6d31ff draft

Reorganization..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2009 09:39:35 +0900
parents Renderer/test_render/Span.h@15bfacccde99
children d4f83f5d2d32
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_SPAN
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_SPAN
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 "Tapestry.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
5 #include "types.h"
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
6
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
7 #define MAX_TILE_LIST 64
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
8
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
9 #if 0
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
10 typedef struct tile {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
11 void *tile;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
12 int tix, tiy;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
13 //int padding; // 16バイト倍数にする用
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
14 } TileInfo, *TileInfoPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
15
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
16 typedef struct tile_list {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17 int size;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18 struct tile_list *next;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 int pad[2];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20 TileInfo tileinfo[MAX_TILE_LIST];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
21
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
22 void init(void) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
23 size = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
24 next = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
25 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 } TileInfoList, *TileInfoListPtr; // 4*4+64*sizeof(Tile) = 16+768
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
27 #endif
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
28
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
29 class Span {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
30 public:
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 uint32 *tex_addr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 int tex_width;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 int tex_height;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34 int x;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 int y;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36 int length_x;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37 float start_z;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38 float end_z;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39 float tex_x1;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40 float tex_x2;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41 float tex_y1;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
42 float tex_y2;
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
43 float normal_x;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
44 float normal_y;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
45 float normal_z;
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
46
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
47 #if 0
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
48 TileInfoListPtr tilelist;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
49 #endif
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
50
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
51 #if 0
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
52 void init(void) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
53 tilelist = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
54 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
55
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
56 void reinit(void) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
57 TileInfoListPtr tlist = this->tilelist;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
58 TileInfoListPtr t;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
59
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
60 while (tlist) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
61 t = tlist->next;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
62 free(tlist);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
63 tlist = t;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
64 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
65
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
66 tilelist = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
67 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
68 #endif
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
69 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
70
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
71 typedef Span* SpanPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
72
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
73 #endif