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