- initial commit of Genesis3D 1.6
[genesis3d.git] / G3D / World / SURFACE.H
1 /****************************************************************************************/\r
2 /*  Surface.h                                                                           */\r
3 /*                                                                                      */\r
4 /*  Author: John Pollard                                                                */\r
5 /*  Description: Creates the surfaces for a BSP from the GFX data                       */\r
6 /*                                                                                      */\r
7 /*  The contents of this file are subject to the Genesis3D Public License               */\r
8 /*  Version 1.01 (the "License"); you may not use this file except in                   */\r
9 /*  compliance with the License. You may obtain a copy of the License at                */\r
10 /*  http://www.genesis3d.com                                                            */\r
11 /*                                                                                      */\r
12 /*  Software distributed under the License is distributed on an "AS IS"                 */\r
13 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */\r
14 /*  the License for the specific language governing rights and limitations              */\r
15 /*  under the License.                                                                  */\r
16 /*                                                                                      */\r
17 /*  The Original Code is Genesis3D, released March 25, 1999.                            */\r
18 /*  Genesis3D Version 1.1 released November 15, 1999                                 */\r
19 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */\r
20 /*                                                                                      */\r
21 /****************************************************************************************/\r
22 #ifndef GE_SURFACE_H\r
23 #define GE_SURFACE_H\r
24 \r
25 #include <Assert.h>\r
26 #include <Windows.h>\r
27 \r
28 #include "BaseType.h"\r
29 #include "PtrTypes.h"\r
30 #include "Vec3d.h"\r
31 #include "DCommon.h"\r
32 \r
33 #ifdef __cplusplus\r
34 extern "C" {\r
35 #endif\r
36 \r
37 //================================================================================\r
38 //      Structure defines\r
39 //================================================================================\r
40 \r
41 // Surface info carries extra info about a face thats not in GFX_Face (File format face)\r
42 typedef struct Surf_SurfInfo\r
43 {\r
44         DRV_LInfo       LInfo;                                                  // For RDriver use only...\r
45 \r
46         geVec3d         T2WVecs[2];\r
47         geVec3d         TexOrg;\r
48 \r
49         geVec3d         VMins;\r
50         geVec3d         VMaxs;\r
51         \r
52         int32           VisFrame;\r
53         \r
54         int32           TexInfo;\r
55         \r
56         int32           XStep;                                                  // Lightmap step values (1:21:10 fixed)\r
57         int32           YStep;\r
58         int32           XScale;\r
59         int32           YScale;\r
60 \r
61         geFloat         ShiftU;\r
62         geFloat         ShiftV;\r
63         \r
64         int32           NumLTypes;                                              // Number of lightmap types this face has...\r
65         int32           DLightFrame;                                    // == Globals->CurFrame if dlighted\r
66         uint32          DLights;                                                // Bit set for each DLight\r
67         uint32          Flags;                                                  // Surface Flags (NOTE - This is not the flags from the utilities)\r
68 \r
69 } Surf_SurfInfo;\r
70 \r
71 typedef struct Surf_TexVert\r
72 {\r
73         geFloat         u, v;\r
74         geFloat         r, g, b, a;\r
75 } Surf_TexVert;\r
76 \r
77 // Lit vertex\r
78 typedef struct\r
79 {\r
80         geFloat X, Y, Z;                                                                        // 3d vertex\r
81         geFloat u, v;                                                                           // Uv's\r
82         geFloat r, g, b, a;                                                             // color\r
83 } Surf_LVertex;\r
84 \r
85 // Transformed Lit vertex\r
86 typedef struct\r
87 {\r
88         geFloat x, y, z;                                                                        // screen points\r
89         geFloat u, v;                                                                           // Uv's\r
90         geFloat r, g, b, a;                                                             // color\r
91 } Surf_TLVertex;\r
92 \r
93 //      Surface Flags\r
94 #define         SURFINFO_TRANS                          (1<<0)          // Surface is transparent\r
95 #define         SURFINFO_LTYPED                         (1<<1)          // This surface has more than one ltype\r
96 #define         SURFINFO_LIGHTMAP                       (1<<2)          // This surface has a lightmap\r
97 #define         SURFINFO_WAVY                           (1<<3)          // This surface is a wavy surface\r
98 \r
99 //================================================================================\r
100 //      Function defines\r
101 //================================================================================\r
102 geBoolean Surf_EngineInit(geEngine *Engine);\r
103 void Surf_EngineShutdown(geEngine *Engine);\r
104 geBoolean Surf_SetEngine(geEngine *Engine);\r
105 geBoolean Surf_SetWorld(geWorld *World);\r
106 geBoolean Surf_SetGBSP(World_BSP *BSP);\r
107 geBoolean Surf_WorldInit(geWorld *World);\r
108 void Surf_WorldShutdown(geWorld *World);\r
109 \r
110 BOOL Surf_InSurfBoundingBox(Surf_SurfInfo *Surf, geVec3d *Pos, geFloat Box);\r
111 \r
112 #ifdef __cplusplus\r
113 }\r
114 #endif\r
115 \r
116 #endif\r