| 1 |
/* Emacs style mode select -*- C -*- |
| 2 |
*----------------------------------------------------------------------------- |
| 3 |
* |
| 4 |
* |
| 5 |
* PrBoom: a Doom port merged with LxDoom and LSDLDoom |
| 6 |
* based on BOOM, a modified and improved DOOM engine |
| 7 |
* Copyright (C) 1999 by |
| 8 |
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman |
| 9 |
* Copyright (C) 1999-2000 by |
| 10 |
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze |
| 11 |
* Copyright 2005, 2006 by |
| 12 |
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko |
| 13 |
* |
| 14 |
* This program is free software; you can redistribute it and/or |
| 15 |
* modify it under the terms of the GNU General Public License |
| 16 |
* as published by the Free Software Foundation; either version 2 |
| 17 |
* of the License, or (at your option) any later version. |
| 18 |
* |
| 19 |
* This program is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with this program; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 27 |
* 02111-1307, USA. |
| 28 |
* |
| 29 |
* DESCRIPTION: |
| 30 |
* |
| 31 |
*--------------------------------------------------------------------- |
| 32 |
*/ |
| 33 |
|
| 34 |
#ifndef _GL_STRUCT_H |
| 35 |
#define _GL_STRUCT_H |
| 36 |
|
| 37 |
#include <SDL_opengl.h> |
| 38 |
|
| 39 |
extern dboolean use_gl_nodes; |
| 40 |
|
| 41 |
typedef enum { |
| 42 |
skytype_auto, |
| 43 |
skytype_none, |
| 44 |
skytype_standard, |
| 45 |
skytype_skydome, |
| 46 |
|
| 47 |
skytype_count |
| 48 |
} skytype_t; |
| 49 |
|
| 50 |
#define MAX_GLGAMMA 32 |
| 51 |
|
| 52 |
enum bleedtype { |
| 53 |
BLEED_NONE = 0x0, |
| 54 |
BLEED_CEILING = 0x1, |
| 55 |
BLEED_OCCLUDE = 0x2 |
| 56 |
}; |
| 57 |
|
| 58 |
extern int gl_drawskys; |
| 59 |
extern dboolean gl_ui_lightmode_indexed; |
| 60 |
extern dboolean gl_automap_lightmode_indexed; |
| 61 |
extern dboolean gl_menu_lightmode_indexed; |
| 62 |
void gld_FlushTextures(void); |
| 63 |
|
| 64 |
void gld_InitVertexData(); |
| 65 |
void gld_CleanVertexData(); |
| 66 |
void gld_UpdateSplitData(sector_t *sector); |
| 67 |
|
| 68 |
void gld_Init(int width, int height); |
| 69 |
void gld_InitCommandLine(void); |
| 70 |
|
| 71 |
void gld_BeginUIDraw(void); |
| 72 |
void gld_EndUIDraw(void); |
| 73 |
void gld_BeginAutomapDraw(void); |
| 74 |
void gld_EndAutomapDraw(void); |
| 75 |
void gld_BeginMenuDraw(void); |
| 76 |
void gld_EndMenuDraw(void); |
| 77 |
|
| 78 |
void gld_DrawNumPatch(int x, int y, int lump, dboolean center, int cm, enum patch_translation_e flags); |
| 79 |
void gld_DrawNumPatch_f(float x, float y, int lump, dboolean center, int cm, enum patch_translation_e flags); |
| 80 |
|
| 81 |
void gld_FillRaw(int lump, int x, int y, int src_width, int src_height, int dst_width, int dst_height, enum patch_translation_e flags); |
| 82 |
#define gld_FillRawName(name, x, y, src_width, src_height, dst_width, dst_height, flags) \ |
| 83 |
gld_FillRaw(W_GetNumForName(name), (x), (y), (src_width), (src_height), (dst_width), (dst_height), (flags)) |
| 84 |
|
| 85 |
#define gld_FillFlat(lump, x, y, width, height, flags) \ |
| 86 |
gld_FillRaw((firstflat+lump), (x), (y), 64, 64, (width), (height), (flags)) |
| 87 |
#define gld_FillFlatName(flatname, x, y, width, height, flags) \ |
| 88 |
gld_FillFlat(R_FlatNumForName(flatname), (x), (y), (width), (height), (flags)) |
| 89 |
|
| 90 |
void gld_FillPatch(int lump, int x, int y, int width, int height, enum patch_translation_e flags); |
| 91 |
#define gld_FillPatchName(name, x, y, width, height, flags) \ |
| 92 |
gld_FillPatch(W_GetNumForName(name), (x), (y), (width), (height), (flags)) |
| 93 |
|
| 94 |
void gld_DrawLine(int x0, int y0, int x1, int y1, int BaseColor); |
| 95 |
void gld_DrawLine_f(float x0, float y0, float x1, float y1, int BaseColor); |
| 96 |
void gld_DrawWeapon(int weaponlump, vissprite_t *vis, int lightlevel); |
| 97 |
void gld_FillBlock(int x, int y, int width, int height, int col); |
| 98 |
void gld_DrawShaded(int x, int y, int width, int height, int shade); |
| 99 |
void gld_SetPalette(int palette); |
| 100 |
unsigned char *gld_ReadScreen(void); |
| 101 |
|
| 102 |
void gld_CleanMemory(void); |
| 103 |
void gld_CleanStaticMemory(void); |
| 104 |
void gld_PreprocessLevel(void); |
| 105 |
|
| 106 |
void gld_Set2DMode(); |
| 107 |
void gld_InitDrawScene(void); |
| 108 |
void gld_StartDrawScene(void); |
| 109 |
void gld_AddPlane(int subsectornum, visplane_t *floor, visplane_t *ceiling); |
| 110 |
void gld_AddWall(seg_t *seg); |
| 111 |
void gld_ProjectSprite(mobj_t* thing, int lightlevel); |
| 112 |
void gld_DrawScene(player_t *player); |
| 113 |
void gld_EndDrawScene(void); |
| 114 |
void gld_Finish(); |
| 115 |
|
| 116 |
// wipe |
| 117 |
int gld_wipe_doMelt(int ticks, int *y_lookup); |
| 118 |
int gld_wipe_exitMelt(int ticks); |
| 119 |
int gld_wipe_StartScreen(void); |
| 120 |
int gld_wipe_EndScreen(void); |
| 121 |
|
| 122 |
//clipper |
| 123 |
dboolean gld_clipper_SafeCheckRange(angle_t startAngle, angle_t endAngle); |
| 124 |
void gld_clipper_SafeAddClipRange(angle_t startangle, angle_t endangle); |
| 125 |
void gld_FrustumSetup(void); |
| 126 |
dboolean gld_SphereInFrustum(float x, float y, float z, float radius); |
| 127 |
|
| 128 |
//missing flats (fake floors and ceilings) |
| 129 |
extern dboolean gl_use_stencil; |
| 130 |
sector_t* GetBestFake(sector_t *sector, int ceiling, int validcount); |
| 131 |
sector_t* GetBestBleedSector(sector_t* source, enum bleedtype type); |
| 132 |
|
| 133 |
void gld_DrawMapLines(void); |
| 134 |
|
| 135 |
//multisampling |
| 136 |
void gld_MultisamplingInit(void); |
| 137 |
void gld_MultisamplingSet(void); |
| 138 |
|
| 139 |
void gld_ProcessTexturedMap(void); |
| 140 |
void gld_ResetTexturedAutomap(void); |
| 141 |
void gld_MapDrawSubsectors(player_t *plr, int fx, int fy, fixed_t mx, fixed_t my, int fw, int fh, fixed_t scale); |
| 142 |
|
| 143 |
void gld_Init8InGLMode(void); |
| 144 |
void gld_Draw8InGL(void); |
| 145 |
|
| 146 |
// Nice map |
| 147 |
enum |
| 148 |
{ |
| 149 |
am_icon_shadow, |
| 150 |
|
| 151 |
am_icon_corpse, |
| 152 |
am_icon_normal, |
| 153 |
am_icon_health, |
| 154 |
am_icon_armor, |
| 155 |
am_icon_ammo, |
| 156 |
am_icon_key, |
| 157 |
am_icon_power, |
| 158 |
am_icon_weap, |
| 159 |
|
| 160 |
am_icon_arrow, |
| 161 |
am_icon_monster, |
| 162 |
am_icon_player, |
| 163 |
am_icon_mark, |
| 164 |
am_icon_bullet, |
| 165 |
|
| 166 |
am_icon_count |
| 167 |
}; |
| 168 |
|
| 169 |
typedef struct am_icon_s |
| 170 |
{ |
| 171 |
GLuint tex_id; |
| 172 |
const char* name; |
| 173 |
int lumpnum; |
| 174 |
} am_icon_t; |
| 175 |
extern am_icon_t am_icons[]; |
| 176 |
|
| 177 |
void gld_InitMapPics(void); |
| 178 |
void gld_AddNiceThing(int type, float x, float y, float radius, float angle, |
| 179 |
unsigned char r, unsigned char g, unsigned char b, unsigned char a); |
| 180 |
void gld_DrawNiceThings(int fx, int fy, int fw, int fh); |
| 181 |
void gld_ClearNiceThings(void); |
| 182 |
|
| 183 |
extern int gl_render_fov; |
| 184 |
|
| 185 |
#endif // _GL_STRUCT_H |