1 | #ifndef __ITEMS_HPP__ |
---|
2 | #define __ITEMS_HPP__ |
---|
3 | #include "image.hpp" |
---|
4 | #include "specs.hpp" |
---|
5 | #include "points.hpp" |
---|
6 | #include "timage.hpp" |
---|
7 | #include <stdio.h> |
---|
8 | #include <stdlib.h> |
---|
9 | |
---|
10 | #define AUTOTILE_WIDTH 6 |
---|
11 | #define AUTOTILE_HEIGHT 3 |
---|
12 | |
---|
13 | class boundary : public point_list // a list of points with |
---|
14 | { |
---|
15 | public : |
---|
16 | boundary(bFILE *fp,char *er_name); |
---|
17 | unsigned char *inside; // tells which side of the line is on the inside |
---|
18 | boundary(boundary *p); // flips the *inside list |
---|
19 | ~boundary() { if (tot) jfree(inside); } |
---|
20 | } ; |
---|
21 | |
---|
22 | class backtile |
---|
23 | { |
---|
24 | public : |
---|
25 | unsigned short next; |
---|
26 | image *im; |
---|
27 | backtile(spec_entry *e, bFILE *fp); |
---|
28 | backtile(bFILE *fp); |
---|
29 | long size() { return 2+4+im->width()*im->height(); } |
---|
30 | ~backtile() { delete im; } |
---|
31 | } ; |
---|
32 | |
---|
33 | class foretile |
---|
34 | { |
---|
35 | public : |
---|
36 | trans_image *im; |
---|
37 | unsigned short next; |
---|
38 | unsigned char damage; |
---|
39 | uchar ylevel; // for fast intersections, this is the y level offset for the ground |
---|
40 | // if ground is not level this is 255 |
---|
41 | boundary *points; |
---|
42 | |
---|
43 | image *micro_image; |
---|
44 | |
---|
45 | foretile(bFILE *fp); |
---|
46 | long size() { return im->width()*im->height()+4+2+1+points->size(); } |
---|
47 | ~foretile() { delete im; delete points; delete micro_image; } |
---|
48 | } ; |
---|
49 | |
---|
50 | class figure |
---|
51 | { |
---|
52 | public : |
---|
53 | trans_image *forward,*backward; |
---|
54 | unsigned char hit_damage,xcfg; |
---|
55 | signed char advance; |
---|
56 | point_list *hit; |
---|
57 | boundary *f_damage,*b_damage; |
---|
58 | int size(); |
---|
59 | |
---|
60 | figure(bFILE *fp, int type); |
---|
61 | int width() { return forward->width(); } |
---|
62 | int height() { return forward->height(); } |
---|
63 | |
---|
64 | /* long size(int type) // taken from spaint items |
---|
65 | { |
---|
66 | if |
---|
67 | return forward->width()*backward->height()+4+ |
---|
68 | 1+1+ // hit & xcfg |
---|
69 | touch->size()+ |
---|
70 | hit->size()+ |
---|
71 | damage->size(); |
---|
72 | }*/ |
---|
73 | |
---|
74 | ~figure() { delete forward; delete backward; |
---|
75 | delete hit; |
---|
76 | delete f_damage; delete b_damage; } |
---|
77 | } ; |
---|
78 | |
---|
79 | class char_tint |
---|
80 | { |
---|
81 | public : |
---|
82 | uchar data[256]; |
---|
83 | ~char_tint() { ; } |
---|
84 | char_tint(bFILE *fp); // should be a palette entry |
---|
85 | } ; |
---|
86 | |
---|
87 | #endif |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | |
---|