Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | pmbaty | 1 | |
2 | #ifndef BRENDER_H |
||
3 | #define BRENDER_H |
||
4 | |||
5 | #include "br_inline_funcs.h" |
||
6 | #include "br_types.h" |
||
7 | |||
8 | extern struct br_font* BrFontFixed3x5; |
||
9 | extern struct br_font* BrFontProp4x6; |
||
10 | extern struct br_font* BrFontProp7x9; |
||
11 | |||
12 | // BrActor |
||
13 | br_actor* BrActorLoad(char* filename); |
||
14 | br_uint_32 BrActorLoadMany(char* filename, br_actor** actors, br_uint_16 num); |
||
15 | br_uint_32 BrActorSave(char* filename, br_actor* ptr); |
||
16 | br_actor* BrActorAllocate(br_uint_8 type, void* type_data); |
||
17 | br_actor* BrActorAdd(br_actor* parent, br_actor* a); |
||
18 | void BrActorRelink(br_actor* parent, br_actor* a); |
||
19 | br_actor* BrActorRemove(br_actor* a); |
||
20 | void BrActorFree(br_actor* a); |
||
21 | br_uint_32 BrActorEnum(br_actor* parent, br_actor_enum_cbfn* callback, void* arg); |
||
22 | br_bounds* BrActorToBounds(br_bounds* b, br_actor* ap); |
||
23 | br_uint_16 BrActorToActorMatrix34(br_matrix34* m, br_actor* a, br_actor* b); |
||
24 | |||
25 | void BrLightEnable(br_actor* l); |
||
26 | void BrLightDisable(br_actor* l); |
||
27 | |||
28 | // BrAllocator |
||
29 | br_allocator* BrAllocatorSet(br_allocator* newal); |
||
30 | |||
31 | // BrClip |
||
32 | void BrClipPlaneEnable(br_actor* c); |
||
33 | void BrClipPlaneDisable(br_actor* c); |
||
34 | |||
35 | // BrDev |
||
36 | void BrDevPaletteSetOld(br_pixelmap* pm); |
||
37 | void BrDevPaletteSetEntryOld(int i, br_colour colour); |
||
38 | |||
39 | // BrEnvironment |
||
40 | br_actor* BrEnvironmentSet(br_actor* a); |
||
41 | |||
42 | // BrFileSystem |
||
43 | br_filesystem* BrFilesystemSet(br_filesystem* newfs); |
||
44 | |||
45 | // BrMap |
||
46 | br_pixelmap* BrMapAdd(br_pixelmap* pixelmap); |
||
47 | br_pixelmap* BrMapRemove(br_pixelmap* pixelmap); |
||
48 | br_pixelmap* BrMapFind(char* pattern); |
||
49 | br_uint_32 BrMapAddMany(br_pixelmap** items, int n); |
||
50 | br_map_find_cbfn* BrMapFindHook(br_map_find_cbfn* hook); |
||
51 | void BrMapUpdate(br_pixelmap* map, br_uint_16 flags); |
||
52 | |||
53 | // BrMaterial |
||
54 | br_material* BrMaterialAllocate(char* name); |
||
55 | br_material* BrMaterialLoad(char* filename); |
||
56 | br_uint_32 BrMaterialLoadMany(char* filename, br_material** materials, br_uint_16 num); |
||
57 | br_material* BrMaterialAdd(br_material* material); |
||
58 | br_material* BrMaterialRemove(br_material* material); |
||
59 | void BrMaterialUpdate(br_material* mat, br_uint_16 flags); |
||
60 | br_material* BrMaterialFind(char* pattern); |
||
61 | void BrMaterialFree(br_material* m); |
||
62 | br_uint_32 BrMaterialAddMany(br_material** items, int n); |
||
63 | br_uint_32 BrMaterialEnum(char* pattern, br_material_enum_cbfn* callback, void* arg); |
||
64 | br_material_find_cbfn* BrMaterialFindHook(br_material_find_cbfn* hook); |
||
65 | |||
66 | // BrMatrix236 |
||
67 | void BrMatrix23Copy(br_matrix23* A, br_matrix23* B); |
||
68 | void BrMatrix23Identity(br_matrix23* mat); |
||
69 | void BrMatrix23Mul(br_matrix23* A, br_matrix23* B, br_matrix23* C); |
||
70 | void BrMatrix23PostScale(br_matrix23* mat, br_scalar sx, br_scalar sy); |
||
71 | |||
72 | // BrMatrix34 |
||
73 | void BrMatrix34Identity(br_matrix34* mat); |
||
74 | void BrMatrix34Pre(br_matrix34* mat, br_matrix34* A); |
||
75 | void BrMatrix34ApplyV(br_vector3* A, br_vector3* B, br_matrix34* C); |
||
76 | br_scalar BrMatrix34Inverse(br_matrix34* B, br_matrix34* A); |
||
77 | void BrMatrix34LPInverse(br_matrix34* A, br_matrix34* B); |
||
78 | void BrMatrix34ApplyP(br_vector3* A, br_vector3* B, br_matrix34* C); |
||
79 | void BrMatrix34Scale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz); |
||
80 | void BrMatrix34PostTranslate(br_matrix34* mat, br_scalar x, br_scalar y, br_scalar z); |
||
81 | void BrMatrix34Mul(br_matrix34* A, br_matrix34* B, br_matrix34* C); |
||
82 | void BrMatrix34Copy(br_matrix34* A, br_matrix34* B); |
||
83 | void BrMatrix34PreRotateY(br_matrix34* mat, br_angle ry); |
||
84 | void BrMatrix34RotateY(br_matrix34* mat, br_angle ry); |
||
85 | void BrMatrix34PostScale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz); |
||
86 | void BrMatrix34PreScale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz); |
||
87 | void BrMatrix34PreTransform(br_matrix34* mat, br_transform* xform); |
||
88 | void BrMatrix34PostTransform(br_matrix34* mat, br_transform* xform); |
||
89 | void BrMatrix34PreRotateX(br_matrix34* mat, br_angle rx); |
||
90 | void BrMatrix34TApplyV(br_vector3* A, br_vector3* B, br_matrix34* C); |
||
91 | void BrMatrix34LPNormalise(br_matrix34* A, br_matrix34* B); |
||
92 | void BrMatrix34PreRotate(br_matrix34* mat, br_angle r, br_vector3* axis); |
||
93 | void BrMatrix34Rotate(br_matrix34* mat, br_angle r, br_vector3* a); |
||
94 | void BrMatrix34PreTranslate(br_matrix34* mat, br_scalar x, br_scalar y, br_scalar z); |
||
95 | void BrMatrix34Post(br_matrix34* mat, br_matrix34* A); |
||
96 | void BrMatrix34PostShearX(br_matrix34* mat, br_scalar sy, br_scalar sz); |
||
97 | void BrMatrix34PostShearY(br_matrix34* mat, br_scalar sx, br_scalar sz); |
||
98 | void BrMatrix34PostShearZ(br_matrix34* mat, br_scalar sx, br_scalar sy); |
||
99 | void BrMatrix34PreScale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz); |
||
100 | void BrMatrix34PreShearX(br_matrix34* mat, br_scalar sy, br_scalar sz); |
||
101 | void BrMatrix34PreRotateY(br_matrix34* mat, br_angle ry); |
||
102 | void BrMatrix34PreRotateZ(br_matrix34* mat, br_angle rz); |
||
103 | void BrMatrix34RollingBall(br_matrix34* mat, int dx, int dy, int radius); |
||
104 | |||
105 | // BrMatrix4 |
||
106 | void BrMatrix4Copy(br_matrix4* A, br_matrix4* B); |
||
107 | br_scalar BrMatrix4Inverse(br_matrix4* A, br_matrix4* B); |
||
108 | void BrMatrix4TApply(br_vector4* A, br_vector4* B, br_matrix4* C); |
||
109 | void BrMatrix4ApplyP(br_vector4* A, br_vector3* B, br_matrix4* C); |
||
110 | void BrMatrix4Perspective(br_matrix4* mat, br_angle field_of_view, br_scalar aspect, br_scalar hither, br_scalar yon); |
||
111 | void BrMatrix4Scale(br_matrix4* mat, br_scalar sx, br_scalar sy, br_scalar sz); |
||
112 | void BrMatrix4Mul(br_matrix4* A, br_matrix4* B, br_matrix4* C); |
||
113 | void BrMatrix4Copy34(br_matrix4* A, br_matrix34* B); |
||
114 | |||
115 | // BrMem |
||
116 | void BrMemFree(void* block); |
||
117 | void* BrMemAllocate(br_size_t size, br_uint_8 type); |
||
118 | void* BrMemCalloc(int nelems, br_size_t size, br_uint_8 type); |
||
119 | |||
120 | // BrModel |
||
121 | br_model* BrModelAllocate(char* name, int nvertices, int nfaces); |
||
122 | br_model* BrModelAdd(br_model* model); |
||
123 | br_uint_32 BrModelAddMany(br_model** items, int n); |
||
124 | br_model* BrModelRemove(br_model* model); |
||
125 | br_model* BrModelLoad(char* filename); |
||
126 | void BrModelFree(br_model* model); |
||
127 | void BrModelUpdate(br_model* model, br_uint_16 flags); |
||
128 | br_uint_32 BrModelLoadMany(char* filename, br_model** models, br_uint_16 num); |
||
129 | br_uint_32 BrModelSaveMany(char* filename, br_model** models, br_uint_16 num); |
||
130 | br_model_find_cbfn* BrModelFindHook(br_model_find_cbfn* hook); |
||
131 | |||
132 | // BrPixelmap |
||
133 | br_pixelmap* BrPixelmapLoad(char* filename); |
||
134 | br_uint_32 BrPixelmapLoadMany(char* filename, br_pixelmap** pixelmaps, br_uint_16 num); |
||
135 | br_uint_32 BrPixelmapSave(char* filename, br_pixelmap* ptr); |
||
136 | br_uint_32 BrPixelmapSaveMany(char* filename, br_pixelmap** pixelmaps, br_uint_16 num); |
||
137 | void BrPixelmapFree(br_pixelmap* src); |
||
138 | br_pixelmap* BrPixelmapMatch(br_pixelmap* src, br_uint_8 match_type); |
||
139 | br_pixelmap* BrPixelmapAllocateSub(br_pixelmap* src, br_int_32 x, br_int_32 y, br_int_32 w, br_int_32 h); |
||
140 | void BrPixelmapFill(br_pixelmap* dst, br_uint_32 colour); |
||
141 | void BrPixelmapRectangleCopy(br_pixelmap* dst, br_int_32 dx, br_int_32 dy, br_pixelmap* src, br_int_32 sx, br_int_32 sy, br_int_32 w, br_int_32 h); |
||
142 | void BrPixelmapCopy(br_pixelmap* dst, br_pixelmap* src); |
||
143 | void BrPixelmapLine(br_pixelmap* dst, br_int_32 x1, br_int_32 y1, br_int_32 x2, br_int_32 y2, br_uint_32 colour); |
||
144 | void BrPixelmapRectangleFill(br_pixelmap* dst, br_int_32 x, br_int_32 y, br_int_32 w, br_int_32 h, br_uint_32 colour); |
||
145 | void BrPixelmapPixelSet(br_pixelmap* dst, br_int_32 x, br_int_32 y, br_uint_32 colour); |
||
146 | br_pixelmap* BrPixelmapAllocate(br_uint_8 type, br_int_32 w, br_int_32 h, void* pixels, int flags); |
||
147 | void BrPixelmapDoubleBuffer(br_pixelmap* dst, br_pixelmap* src); |
||
148 | void BrPixelmapText(br_pixelmap* dst, br_int_32 x, br_int_32 y, br_uint_32 colour, br_font* font, char* text); |
||
149 | void BrPixelmapTextF(br_pixelmap* dst, br_int_32 x, br_int_32 y, br_uint_32 colour, br_font* font, char* fmt, ...); |
||
150 | br_uint_16 BrPixelmapTextWidth(br_pixelmap* dst, br_font* font, char* text); |
||
151 | |||
152 | // BrRes |
||
153 | void* BrResAllocate(void* vparent, br_size_t size, br_uint_8 res_class); |
||
154 | br_resource_class* BrResClassAdd(br_resource_class* rclass); |
||
155 | void* BrResRemove(void* vres); |
||
156 | void BrResFree(void* vres); |
||
157 | br_uint_32 BrResCheck(void* vres, int no_tag); |
||
158 | br_uint_32 BrResSize(void* vres); |
||
159 | char* BrResStrDup(void* vparent, char* str); |
||
160 | |||
161 | // BrTable |
||
162 | br_pixelmap* BrTableAdd(br_pixelmap* pixelmap); |
||
163 | br_pixelmap* BrTableFind(char* pattern); |
||
164 | br_pixelmap* BrTableRemove(br_pixelmap* pixelmap); |
||
165 | br_uint_32 BrTableAddMany(br_pixelmap** items, int n); |
||
166 | void BrTableUpdate(br_pixelmap* table, br_uint_16 flags); |
||
167 | br_uint_32 BrTableEnum(char* pattern, br_table_enum_cbfn* callback, void* arg); |
||
168 | br_table_find_cbfn* BrTableFindHook(br_table_find_cbfn* hook); |
||
169 | |||
170 | // BrTransform |
||
171 | void BrTransformToMatrix34(br_matrix34* mat, br_transform* xform); |
||
172 | |||
173 | // BrV1db |
||
174 | void BrV1dbBeginWrapper_Float(void); |
||
175 | |||
176 | // BrVector3 |
||
177 | // void BrVector3Cross(br_vector3* v1, br_vector3* v2, br_vector3* v3); |
||
178 | void BrVector3SetFloat(br_vector3* v1, float f1, float f2, float f3); |
||
179 | // void BrVector3Sub(br_vector3* v1, br_vector3* v2, br_vector3* v3); |
||
180 | // void BrVector3Accumulate(br_vector3* v1, br_vector3* v2); |
||
181 | // void BrVector3Normalise(br_vector3* v1, br_vector3* v2); |
||
182 | |||
183 | // BrTransform |
||
184 | void BrTransformToTransform(br_transform* dest, br_transform* src); |
||
185 | |||
186 | // Logging |
||
187 | void BrFailure(const char* s, ...); |
||
188 | void BrFatal(const char* name, int line, const char* s, ...); |
||
189 | |||
190 | // Z-buffer |
||
191 | void BrZbBegin(br_uint_8 colour_type, br_uint_8 depth_type); |
||
192 | |||
193 | void BrZbSceneRenderBegin(br_actor* world, br_actor* camera, br_pixelmap* colour_buffer, br_pixelmap* depth_buffer); |
||
194 | void BrZbSceneRenderAdd(br_actor* tree); |
||
195 | void BrZbSceneRenderEnd(void); |
||
196 | |||
197 | void BrZbModelRender(br_actor* actor, br_model* model, br_material* material, br_uint_8 style, int on_screen, int use_custom); |
||
198 | |||
199 | br_pixelmap* DOSGfxBegin(char* setup_string); |
||
200 | |||
201 | // Various |
||
202 | br_uint_32 BrOnScreenCheck(br_bounds3* bounds); |
||
203 | |||
204 | int BrWriteModeSet(int mode); |
||
205 | br_uint_32 BrSwap32(br_uint_32 l); |
||
206 | br_diaghandler* BrDiagHandlerSet(br_diaghandler* newdh); |
||
207 | |||
208 | #endif |