FS2_Open
Open source remastering of the Freespace 2 engine
tmapper.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _TMAPPER_H
13 #define _TMAPPER_H
14 
15 #include "globalincs/pstypes.h"
16 
17 /*
18 struct vertex;
19 
20 // call this to reinit the scanline function pointers.
21 extern void tmapper_setup();
22 
23 // Used to tell the tmapper what the current lighting values are
24 // if the TMAP_FLAG_RAMP or TMAP_FLAG_RGB are set and the TMAP_FLAG_GOURAUD
25 // isn't set.
26 void tmapper_set_light(vertex *v, uint flags);
27 
28 // DO NOT CALL grx_tmapper DIRECTLY!!!! Only use the
29 // gr_tmapper equivalent!!!!
30 extern void grx_tmapper( int nv, vertex * verts[], uint flags );
31 */
32 
33 #define TMAP_MAX_VERTS 25 // Max number of vertices per polygon
34 
35 // Flags to pass to g3_draw_??? routines
36 #define TMAP_FLAG_TEXTURED (1<<0) // Uses texturing (Interpolate uv's)
37 #define TMAP_FLAG_CORRECT (1<<1) // Perspective correct (Interpolate sw)
38 #define TMAP_FLAG_RAMP (1<<2) // Use RAMP lighting (interpolate L)
39 #define TMAP_FLAG_RGB (1<<3) // Use RGB lighting (interpolate RGB)
40 #define TMAP_FLAG_GOURAUD (1<<4) // Lighting values differ on each vertex.
41  // If this is not set, then the texture mapper will use
42  // the lighting parameters in each vertex, otherwise it
43  // will use the ones specified in tmapper_set_??
44 #define TMAP_FLAG_XPARENT (1<<5) // texture could have transparency
45 #define TMAP_FLAG_TILED (1<<6) // This means uv's can be > 1.0
46 #define TMAP_FLAG_NEBULA (1<<7) // Must be used with RAMP and GOURAUD. Means l 0-1 is 0-31 palette entries
47 
48 //#define TMAP_HIGHEST_FLAG_BIT 7 // The highest bit used in the TMAP_FLAGS
49 //#define TMAP_MAX_SCANLINES (1<<(TMAP_HIGHEST_FLAG_BIT+1))
50 
51 // Add any entries that don't work for software under here:
52 // Make sure to disable them at top of grx_tmapper
53 #define TMAP_FLAG_ALPHA (1<<8) // Has an alpha component
54 #define TMAP_FLAG_BATCH_TRANSFORMS (1<<9) // Use batched transform data transmitted via texture/uniform buffer
55 
56 // Interface specific stuff (for separate filtering, sizing, etc.), replaces old TMAP_FLAG_BITMAP_SECTION
57 #define TMAP_FLAG_INTERFACE (1<<10)
58 
59 // flags for full nebula effect
60 #define TMAP_FLAG_PIXEL_FOG (1<<11) // fog the polygon based upon the average pixel colors of the backbuffer behind it
61 
62 // RT Flags added to determine whats being drawn for HT&L
63 #define TMAP_HTL_3D_UNLIT (1<<12)
64 #define TMAP_HTL_2D (1<<13) // I don't think this flag is being used (Swifty)
65 
66 //tristrips, for trails mostly, might find other uses eventualy
67 #define TMAP_FLAG_TRISTRIP (1<<14)
68 #define TMAP_FLAG_TRILIST (1<<15)
69 #define TMAP_FLAG_QUADLIST (1<<16)
70 #define TMAP_FLAG_QUADSTRIP (1<<17)
71 
72 // use greyscale texture
73 #define TMAP_FLAG_BW_TEXTURE (1<<18)
74 
75 // use animated Shader - Valathil
76 #define TMAP_ANIMATED_SHADER (1<<19)
77 
78 // use soft particle shader - Swifty
79 #define TMAP_FLAG_SOFT_QUAD (1<<20)
80 
81 // use framebuffer distortion mapping with generated distortion map - Valathil
82 #define TMAP_FLAG_DISTORTION_THRUSTER (1<<21)
83 
84 // use framebuffer distortion mapping - Valathil
85 #define TMAP_FLAG_DISTORTION (1<<22)
86 
87 #define TMAP_FLAG_DESATURATE (1<<23)
88 
89 #define TMAP_FLAG_POINTLIST (1<<24)
90 #define TMAP_FLAG_LINESTRIP (1<<25)
91 #define TMAP_FLAG_LINES (1<<26)
92 #define TMAP_FLAG_VERTEX_GEN (1<<27)
93 
94 #define TMAP_ADDRESS_WRAP 1
95 #define TMAP_ADDRESS_MIRROR 2
96 #define TMAP_ADDRESS_CLAMP 3
97 
98 //WMC - moved this here so it'd be in 2d.h and 3d.h
99 //bitmap_2d_list,
100 //x and y: the 2d position of the upper left hand corner
101 //w and h: the hidth and hight of the bitmap (some functions
102 //will overide these, others will only overide if givein an invalid size like 0 or -1)
104  bitmap_2d_list(int X=0, int Y=0, int W=-1, int H=-1):x(X),y(Y),w(W),h(H){}
105  int x;
106  int y;
107  int w;
108  int h;
109 };
110 
111 //texture_rect
112 //defines a rectangular reagon within a texture
113 //similar to the above structure only all values are relitive
114 //from 0,0 in the upper left to 1,1 in the lowwer right
115 //out of range values are valid
117  texture_rect_list(float u0In=0.0f, float v0In=0.0f, float u1In=1.0f, float v1In=1.0f):u0(u0In),v0(v0In),u1(u1In),v1(v1In){}
118  float u0;
119  float v0;
120  float u1;
121  float v1;
122 };
123 
125  bitmap_rect_list(float X, float Y, float W, float H):texture_rect(X,Y,W,H){}
126  bitmap_rect_list(int X=0, int Y=0, int W=-1, int H=-1, float TX=0.0f, float TY=0.0f, float TW=1.0f, float TH=1.0f):screen_rect(X,Y,W,H),texture_rect(TX,TY,TW,TH){}
129 };
130 
131 #endif
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
bitmap_2d_list screen_rect
Definition: tmapper.h:127
GLclampf f
Definition: Glext.h:7097
bitmap_rect_list(float X, float Y, float W, float H)
Definition: tmapper.h:125
bitmap_rect_list(int X=0, int Y=0, int W=-1, int H=-1, float TX=0.0f, float TY=0.0f, float TW=1.0f, float TH=1.0f)
Definition: tmapper.h:126
GLdouble u1
Definition: Glext.h:7779
GLfloat v0
Definition: Glext.h:5638
bitmap_2d_list(int X=0, int Y=0, int W=-1, int H=-1)
Definition: tmapper.h:104
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
GLfloat GLfloat v1
Definition: Glext.h:5639
GLubyte GLubyte GLubyte GLubyte w
Definition: Glext.h:5679
texture_rect_list texture_rect
Definition: tmapper.h:128
texture_rect_list(float u0In=0.0f, float v0In=0.0f, float u1In=1.0f, float v1In=1.0f)
Definition: tmapper.h:117
GLint y
Definition: Gl.h:1505