annotate Renderer/test_render/Span.h @ 283:15bfacccde99 draft

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