2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
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
10 * $Logfile: /Freespace2/code/Graphics/TMAPPER.H $
15 * Header file for Tmapper.h
18 * Revision 1.2 2002/06/09 04:41:15 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 4 6/29/99 10:35a Dave
26 * Interface polygon bitmaps! Whee!
28 * 3 12/06/98 2:36p Dave
29 * Drastically improved nebula fogging.
31 * 2 10/07/98 10:53a Dave
34 * 1 10/07/98 10:49a Dave
36 * 17 4/10/98 5:20p John
37 * Changed RGB in lighting structure to be ubytes. Removed old
38 * not-necessary 24 bpp software stuff.
40 * 16 4/09/98 7:58p John
41 * Cleaned up tmapper code a bit. Put NDEBUG around some ndebug stuff.
42 * Took out XPARENT flag settings in all the alpha-blended texture stuff.
44 * 15 4/09/98 4:38p John
45 * Made non-darkening and transparent textures work under Glide. Fixed
46 * bug with Jim's computer not drawing any bitmaps.
48 * 14 3/23/98 5:00p John
49 * Improved missile trails. Made smooth alpha under hardware. Made end
50 * taper. Made trail touch weapon.
52 * 13 11/21/97 11:32a John
53 * Added nebulas. Fixed some warpout bugs.
55 * 12 10/15/97 5:08p John
56 * added flag for alpha tmap
58 * 11 3/10/97 5:20p John
59 * Differentiated between Gouraud and Flat shading. Since we only do flat
60 * shading as of now, we don't need to interpolate L in the outer loop.
61 * This should save a few percent.
63 * 10 3/05/97 7:15p John
64 * took out the old z stop tmapper used for briefing.
66 * 9 12/10/96 10:37a John
67 * Restructured texture mapper to remove some overhead from each scanline
68 * setup. This gave about a 30% improvement drawing trans01.pof, which is
69 * a really complex model. In the process, I cleaned up the scanline
70 * functions and separated them into different modules for each pixel
73 * 8 11/07/96 2:17p John
74 * Took out the OldTmapper stuff.
76 * 7 11/05/96 4:05p John
77 * Added roller. Added code to draw a distant planet. Made bm_load
78 * return -1 if invalid bitmap.
80 * 6 10/26/96 1:40p John
81 * Added some now primitives to the 2d library and
82 * cleaned up some old ones.
90 #define TMAP_MAX_VERTS 25 // Max number of vertices per polygon
92 // Flags to pass to g3_draw_??? routines
93 #define TMAP_FLAG_TEXTURED (1<<0) // Uses texturing (Interpolate uv's)
94 #define TMAP_FLAG_CORRECT (1<<1) // Perspective correct (Interpolate sw)
95 #define TMAP_FLAG_RAMP (1<<2) // Use RAMP lighting (interpolate L)
96 #define TMAP_FLAG_RGB (1<<3) // Use RGB lighting (interpolate RGB)
97 #define TMAP_FLAG_GOURAUD (1<<4) // Lighting values differ on each vertex.
98 // If this is not set, then the texture mapper will use
99 // the lighting parameters in each vertex, otherwise it
100 // will use the ones specified in tmapper_set_??
101 #define TMAP_FLAG_XPARENT (1<<5) // texture could have transparency
102 #define TMAP_FLAG_TILED (1<<6) // This means uv's can be > 1.0
103 #define TMAP_FLAG_NEBULA (1<<7) // Must be used with RAMP and GOURAUD. Means l 0-1 is 0-31 palette entries
106 #define TMAP_HIGHEST_FLAG_BIT 7 // The highest bit used in the TMAP_FLAGS
107 #define TMAP_MAX_SCANLINES (1<<(TMAP_HIGHEST_FLAG_BIT+1))
109 // Add any entries that don't work for software under here:
110 // Make sure to disable them at top of grx_tmapper
111 #define TMAP_FLAG_ALPHA (1<<8) // Has an alpha component
112 #define TMAP_FLAG_NONDARKENING (1<<9) // RGB=255,255,255 doesn't darken
114 // flags for full nebula effect
115 #define TMAP_FLAG_PIXEL_FOG (1<<10) // fog the polygon based upon the average pixel colors of the backbuffer behind it
118 #define TMAP_FLAG_BITMAP_SECTION (1<<11)
119 // user interface bitmap
120 #define TMAP_FLAG_BITMAP_INTERFACE (1<<12)