]> icculus.org git repositories - btb/d2x.git/blob - include/interp.h
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / include / interp.h
1 /*
2  *
3  * took out functions declarations from include/3d.h
4  * which are implemented in 3d/interp.c
5  *
6  */
7
8 #ifndef _INTERP_H
9 #define _INTERP_H
10
11 #include "fix.h"
12 //#include "vecmat.h" //the vector/matrix library
13 #include "gr.h"
14 #include "cfile.h"
15
16
17 //Object functions:
18
19 //gives the interpreter an array of points to use
20 void g3_set_interp_points(g3s_point *pointlist);
21
22 //calls the object interpreter to render an object.  The object renderer
23 //is really a seperate pipeline. returns true if drew
24 bool g3_draw_polygon_model(void *model_ptr,grs_bitmap **model_bitmaps,vms_angvec *anim_angles,fix light,fix *glow_values);
25
26 //init code for bitmap models
27 void g3_init_polygon_model(void *model_ptr);
28
29 //un-initialize, i.e., convert color entries back to RGB15
30 void g3_uninit_polygon_model(void *model_ptr);
31
32 //alternate interpreter for morphing object
33 bool g3_draw_morphing_model(void *model_ptr,grs_bitmap **model_bitmaps,vms_angvec *anim_angles,fix light,vms_vector *new_points);
34
35 //this remaps the 15bpp colors for the models into a new palette.  It should
36 //be called whenever the palette changes
37 void g3_remap_interp_colors(void);
38
39 #ifdef WORDS_BIGENDIAN
40 // routine to convert little to big endian in polygon model data
41 void swap_polygon_model_data(ubyte *data);
42 //routines to convert little to big endian in vectors
43 void vms_vector_swap(vms_vector *v);
44 void vms_angvec_swap(vms_angvec *v);
45 #endif
46
47 #ifdef WORDS_NEED_ALIGNMENT
48 /*
49  * A chunk struct (as used for alignment) contains all relevant data
50  * concerning a piece of data that may need to be aligned.
51  * To align it, we need to copy it to an aligned position,
52  * and update all pointers  to it.
53  * (Those pointers are actually offsets
54  * relative to start of model_data) to it.
55  */
56 typedef struct chunk {
57         ubyte *old_base; // where the offset sets off from (relative to beginning of model_data)
58         ubyte *new_base; // where the base is in the aligned structure
59         short offset; // how much to add to base to get the address of the offset
60         short correction; // how much the value of the offset must be shifted for alignment
61 } chunk;
62 #define MAX_CHUNKS 100 // increase if insufficent
63 /*
64  * finds what chunks the data points to, adds them to the chunk_list, 
65  * and returns the length of the current chunk
66  */
67 int get_chunks(ubyte *data, ubyte *new_data, chunk *list, int *no);
68 #endif //def WORDS_NEED_ALIGNMENT
69
70 #endif //_INTERP_H