SRB2/src/hardware/hw_glob.h

140 lines
3.3 KiB
C
Raw Normal View History

2020-01-23 23:12:15 +00:00
// SONIC ROBO BLAST 2
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
2021-05-07 15:45:56 +00:00
// Copyright (C) 1999-2021 by Sonic Team Junior.
2014-03-15 16:59:03 +00:00
//
2020-01-23 23:12:15 +00:00
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
2020-01-23 23:12:15 +00:00
/// \file hw_glob.h
2014-03-15 16:59:03 +00:00
/// \brief globals (shared data & code) for hw_ modules
#ifndef _HWR_GLOB_H_
#define _HWR_GLOB_H_
#include "hw_defs.h"
#include "hw_main.h"
#include "../m_misc.h"
2019-11-09 01:58:41 +00:00
#include "../p_setup.h"
2014-03-15 16:59:03 +00:00
// the original aspect ratio of Doom graphics isn't square
#define ORIGINAL_ASPECT (320.0f/200.0f)
// Uncomment this to enable the OpenGL loading screen
//#define HWR_LOADING_SCREEN
2014-03-15 16:59:03 +00:00
// -----------
// structures
// -----------
// a vertex of a Doom 'plane' polygon
typedef struct
{
float x;
float y;
float z;
} polyvertex_t;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
// a convex 'plane' polygon, clockwise order
typedef struct
{
INT32 numpts;
polyvertex_t pts[0];
} poly_t;
#ifdef _MSC_VER
#pragma warning(default : 4200)
#endif
// holds extra info for 3D render, for each subsector in subsectors[]
typedef struct
{
poly_t *planepoly; // the generated convex polygon
} extrasubsector_t;
// needed for sprite rendering
// equivalent of the software renderer's vissprites
2020-07-06 04:15:08 +00:00
typedef struct gl_vissprite_s
2014-03-15 16:59:03 +00:00
{
float x1, x2;
float z1, z2;
float gz, gzt;
float tz;
2020-06-27 14:22:00 +00:00
float tracertz; // for MF2_LINKDRAW sprites, this contains tracer's tz for use in sorting
float scale;
float shadowheight, shadowscale;
float spritexscale, spriteyscale;
float spritexoffset, spriteyoffset;
UINT32 renderflags;
UINT8 rotateflags;
boolean flip, vflip;
2014-03-15 16:59:03 +00:00
boolean precip; // Tails 08-25-2002
boolean rotated;
UINT8 translucency; //alpha level 0-255
//Hurdler: 25/04/2000: now support colormap in hardware mode
2014-03-15 16:59:03 +00:00
UINT8 *colormap;
2015-11-23 17:01:10 +00:00
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
patch_t *gpatch;
mobj_t *mobj; // NOTE: This is a precipmobj_t if precip is true !!! Watch out.
2020-07-06 04:15:08 +00:00
} gl_vissprite_t;
2014-03-15 16:59:03 +00:00
// --------
// hw_bsp.c
// --------
extern extrasubsector_t *extrasubsectors;
extern size_t addsubsector;
void HWR_InitPolyPool(void);
void HWR_FreePolyPool(void);
2020-08-08 08:16:47 +00:00
void HWR_FreeExtraSubsectors(void);
2014-03-15 16:59:03 +00:00
// --------
// hw_cache.c
// --------
2020-08-15 01:27:16 +00:00
void HWR_InitMapTextures(void);
void HWR_LoadMapTextures(size_t pnumtextures);
void HWR_FreeMapTextures(void);
2020-08-08 08:16:47 +00:00
patch_t *HWR_GetCachedGLPatchPwad(UINT16 wad, UINT16 lump);
patch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum);
void HWR_GetPatch(patch_t *patch);
void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap);
void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
patch_t *HWR_GetPic(lumpnum_t lumpnum);
GLMapTexture_t *HWR_GetTexture(INT32 tex);
void HWR_GetLevelFlat(levelflat_t *levelflat);
void HWR_GetRawFlat(lumpnum_t flatlumpnum);
2020-08-08 08:16:47 +00:00
void HWR_FreeTexture(patch_t *patch);
2020-11-22 21:18:26 +00:00
void HWR_FreeTextureData(patch_t *patch);
2020-08-08 08:16:47 +00:00
void HWR_FreeTextureColormaps(patch_t *patch);
2020-08-15 01:27:16 +00:00
void HWR_ClearAllTextures(void);
void HWR_FreeColormapCache(void);
2014-03-15 16:59:03 +00:00
void HWR_UnlockCachedPatch(GLPatch_t *gpatch);
2020-08-08 08:16:47 +00:00
2014-03-15 16:59:03 +00:00
void HWR_SetPalette(RGBA_t *palette);
2020-08-08 08:16:47 +00:00
2014-03-15 16:59:03 +00:00
// --------
// hw_draw.c
// --------
extern INT32 patchformat;
extern INT32 textureformat;
#endif //_HW_GLOB_