]> icculus.org git repositories - taylor/freespace2.git/blob - include/tmapscanline.h
remove cpu detection stuff
[taylor/freespace2.git] / include / tmapscanline.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Graphics/TmapScanline.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for tmapscanline.cpp.
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:15  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
25  * 2     10/07/98 10:53a Dave
26  * Initial checkin.
27  * 
28  * 1     10/07/98 10:49a Dave
29  * 
30  * 25    5/13/98 2:53p John
31  * Made subspace effect work under software.  Had to add new inner loop to
32  * tmapper.  Added glows to end of subspace effect.  Made subspace effect
33  * levels use gamepalette-subspace palette.
34  * 
35  * 24    4/10/98 5:20p John
36  * Changed RGB in lighting structure to be ubytes.  Removed old
37  * not-necessary 24 bpp software stuff.
38  * 
39  * 23    3/22/98 2:33p John
40  * Took out fx_v/v_right.  Made fx_u etc get calculated in tmapper.
41  * 
42  * 22    3/10/98 4:19p John
43  * Cleaned up graphics lib.  Took out most unused gr functions.   Made D3D
44  * & Glide have popups and print screen.  Took out all >8bpp software
45  * support.  Made Fred zbuffer.  Made zbuffer allocate dynamically to
46  * support Fred.  Made zbuffering key off of functions rather than one
47  * global variable.
48  * 
49  * 21    12/15/97 11:32a John
50  * New Laser Code
51  * 
52  * 20    12/02/97 4:00p John
53  * Added first rev of thruster glow, along with variable levels of
54  * translucency, which retquired some restructing of palman.
55  * 
56  * 19    11/30/97 3:57p John
57  * Made fixed 32-bpp translucency.  Made BmpMan always map translucent
58  * color into 255 even if you aren't supposed to remap and make it's
59  * palette black.
60  * 
61  * 18    11/21/97 11:32a John
62  * Added nebulas.   Fixed some warpout bugs.
63  * 
64  * 17    10/16/97 10:55a John
65  * added tmapper to draw a monochrome alpha blended bitmap.
66  * 
67  * 16    3/14/97 3:55p John
68  * Made tiled tmapper not always be zbuffered.
69  * 
70  * 15    3/13/97 10:32a John
71  * Added code for tiled 256x256 textures in certain models.
72  * 
73  * 14    3/05/97 7:15p John
74  * took out the old z stop tmapper used for briefing. 
75  * 
76  * 13    1/20/97 4:17p John
77  * 
78  * 12    1/06/97 2:44p John
79  * Added in slow (but correct) zbuffering
80  * 
81  * 11    12/10/96 10:37a John
82  * Restructured texture mapper to remove some overhead from each scanline
83  * setup.  This gave about a 30% improvement drawing trans01.pof, which is
84  * a really complex model.  In the process, I cleaned up the scanline
85  * functions and separated them into different modules for each pixel
86  * depth.   
87  * 
88  * 10    11/26/96 6:50p John
89  * Added some more hicolor primitives.  Made windowed mode run as current
90  * bpp, if bpp is 8,16,or 32.
91  * 
92  * 9     11/07/96 6:19p John
93  * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp
94  * mode.
95  * 
96  * 8     11/05/96 4:05p John
97  * Added roller.  Added code to draw a distant planet.  Made bm_load
98  * return -1 if invalid bitmap.
99  * 
100  * 7     10/31/96 7:20p John
101  * Added per,tiled tmapper.  Made models tile if they use 64x64 textures.
102  * 
103  * 6     10/26/96 1:40p John
104  * Added some now primitives to the 2d library and
105  * cleaned up some old ones.
106  *
107  * $NoKeywords: $
108  */
109
110
111 #ifndef _TMAPSCANLINE_H
112 #define _TMAPSCANLINE_H
113
114
115 typedef struct tmapper_vertex {
116         float sx, sy, sw, u, v, b;
117 } tmapper_vertex;
118
119 typedef struct tmapper_data {
120         // These are filled once for each texture map being drawn.
121         // The inner loop cannot change any of these!!
122         int             nv;                                             // number of vertices
123         ubyte           *pixptr;
124         bitmap  *bp;
125         int             src_offset;
126         uint            flags;
127         float           FixedScale;                             // constant for asm inner loop
128         float           FixedScale8;                    // constant for asm inner loop
129         float           One;                                            // constant for asm inner loop
130
131         // This are filled in by the outer loop before each scan line.
132         int             loop_count;
133         tmapper_vertex  l, r, dl, dr, deltas;
134         int             lx, rx, y;
135         float           clipped_left;                   // how many pixels were clipped off the left in 2d.
136
137         // These are used internally by the assembly texture mapper.
138         fix             fx_l, fx_l_right, fx_dl_dx;
139         fix             fx_u, fx_v, fx_du_dx, fx_dv_dx;
140         float           fl_dudx_wide;
141         float           fl_dvdx_wide;
142         float           fl_dwdx_wide;
143         uint            dest_row_data;
144         int             num_big_steps;
145         uint            uv_delta[2];
146         float           FloatTemp;
147         uint            Subdivisions;
148         uint            WidthModLength;
149         uint            BlendLookup;
150         uint            FadeLookup;
151         uint            DeltaU;
152         uint            DeltaV;
153         uint            DeltaUFrac, DeltaVFrac;
154    uint         UFixed;
155         uint            VFixed;
156    ushort       FPUCW;
157         ushort  OldFPUCW;
158         int             InnerLooper;
159         uint            pScreenBits;
160         int             fx_w;
161         int             fx_dwdx;
162
163         uint            saved_esp;
164         uint            lookup;
165
166 } tmapper_data;
167
168 extern tmapper_data Tmap;
169
170 extern void tmapscan_generic();
171 extern void tmapscan_generic8();
172 //extern void tmapscan_pnn();
173 extern void tmapscan_pln();
174 extern void tmapscan_lln();
175 extern void tmapscan_flat();
176 extern void tmapscan_nebula8();
177 extern void tmapscan_flat_z();
178
179 extern void tmapscan_flat8();
180 extern void tmapscan_lln8();
181 extern void tmapscan_lnt8();
182 extern void tmapscan_lnn8();
183 extern void tmapscan_lnt8();
184 extern void tmapscan_lln8_tiled();
185 extern void tmapscan_llt8_tiled();
186 extern void tmapscan_pln8();
187 extern void tmapscan_plt8();
188
189 extern void tmapscan_lnaa8();
190
191 extern void tmapscan_pln8_tiled();
192
193 extern void tmapscan_lnn8_tiled_256x256();
194 extern void tmapscan_pnn8_tiled_256x256_subspace();
195
196 extern void tmapscan_flat_gouraud();
197
198 extern void tmapscan_nebula8();
199
200 #endif
201