| 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 |
* Refresh module, data I/O, caching, retrieval of graphics |
| 31 |
* by name. |
| 32 |
* |
| 33 |
*-----------------------------------------------------------------------------*/ |
| 34 |
|
| 35 |
|
| 36 |
#ifndef __R_DATA__ |
| 37 |
#define __R_DATA__ |
| 38 |
|
| 39 |
#include "r_defs.h" |
| 40 |
#include "r_state.h" |
| 41 |
#include "r_patch.h" |
| 42 |
|
| 43 |
// A single patch from a texture definition, basically |
| 44 |
// a rectangular area within the texture rectangle. |
| 45 |
typedef struct |
| 46 |
{ |
| 47 |
int originx, originy; // Block origin, which has already accounted |
| 48 |
int patch; // for the internal origin of the patch. |
| 49 |
} texpatch_t; |
| 50 |
|
| 51 |
// |
| 52 |
// Texture definition. |
| 53 |
// A DOOM wall texture is a list of patches |
| 54 |
// which are to be combined in a predefined order. |
| 55 |
// |
| 56 |
|
| 57 |
typedef struct |
| 58 |
{ |
| 59 |
char name[8]; // Keep name for switch changing, etc. |
| 60 |
int next, index; // killough 1/31/98: used in hashing algorithm |
| 61 |
// CPhipps - moved arrays with per-texture entries to elements here |
| 62 |
unsigned widthmask; |
| 63 |
// CPhipps - end of additions |
| 64 |
short width, height; |
| 65 |
short patchcount; // All the patches[patchcount] are drawn |
| 66 |
texpatch_t patches[1]; // back-to-front into the cached texture. |
| 67 |
} texture_t; |
| 68 |
|
| 69 |
extern int numtextures; |
| 70 |
extern texture_t **textures; |
| 71 |
|
| 72 |
|
| 73 |
const byte *R_GetTextureColumn(const rpatch_t *texpatch, int col); |
| 74 |
|
| 75 |
|
| 76 |
// I/O, setting up the stuff. |
| 77 |
void R_InitData (void); |
| 78 |
void R_PrecacheLevel (void); |
| 79 |
|
| 80 |
|
| 81 |
// Retrieval. |
| 82 |
// Floor/ceiling opaque texture tiles, |
| 83 |
// lookup by name. For animation? |
| 84 |
int R_FlatNumForName (const char* name); // killough -- const added |
| 85 |
|
| 86 |
|
| 87 |
// R_*TextureNumForName returns the texture number for the texture name, or NO_TEXTURE if |
| 88 |
// there is no texture (i.e. "-") specified. |
| 89 |
/* cph 2006/07/23 - defined value for no-texture marker (texture "-" in the WAD file) */ |
| 90 |
#define NO_TEXTURE 0 |
| 91 |
int PUREFUNC R_TextureNumForName (const char *name); // killough -- const added; cph - now PUREFUNC |
| 92 |
int PUREFUNC R_SafeTextureNumForName (const char *name, int snum); |
| 93 |
int PUREFUNC R_CheckTextureNumForName (const char *name); |
| 94 |
|
| 95 |
int R_ColormapNumForName(const char *name); // killough 4/4/98 |
| 96 |
|
| 97 |
extern const byte *main_tranmap, *tranmap; |
| 98 |
|
| 99 |
/* Proff - Added for OpenGL - cph - const char* param */ |
| 100 |
void R_SetPatchNum(patchnum_t *patchnum, const char *name); |
| 101 |
// e6y: Added for "GRNROCK" mostly |
| 102 |
void R_SetFloorNum(patchnum_t *patchnum, const char *name); |
| 103 |
int R_SetSpriteByIndex(patchnum_t *patchnum, spritenum_t item); |
| 104 |
int R_SetSpriteByName(patchnum_t *patchnum, const char *name); |
| 105 |
int R_SetPatchByName(patchnum_t *patchnum, const char *name); |
| 106 |
int R_NumPatchForSpriteIndex(spritenum_t item); |
| 107 |
|
| 108 |
#endif |