aboutsummaryrefslogtreecommitdiff
path: root/src/r_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/r_data.h')
-rw-r--r--src/r_data.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/r_data.h b/src/r_data.h
new file mode 100644
index 0000000..98f15b4
--- /dev/null
+++ b/src/r_data.h
@@ -0,0 +1,109 @@
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#ifdef __GNUG__
44#pragma interface
45#endif
46
47// A single patch from a texture definition, basically
48// a rectangular area within the texture rectangle.
49typedef struct
50{
51 int originx, originy; // Block origin, which has already accounted
52 int patch; // for the internal origin of the patch.
53} texpatch_t;
54
55//
56// Texture definition.
57// A DOOM wall texture is a list of patches
58// which are to be combined in a predefined order.
59//
60
61typedef struct
62{
63 char name[8]; // Keep name for switch changing, etc.
64 int next, index; // killough 1/31/98: used in hashing algorithm
65 // CPhipps - moved arrays with per-texture entries to elements here
66 unsigned widthmask;
67 // CPhipps - end of additions
68 short width, height;
69 short patchcount; // All the patches[patchcount] are drawn
70 texpatch_t patches[1]; // back-to-front into the cached texture.
71} texture_t;
72
73extern int numtextures;
74extern texture_t **textures;
75
76
77const byte *R_GetTextureColumn(const rpatch_t *texpatch, int col);
78
79
80// I/O, setting up the stuff.
81void R_InitData (void);
82void R_PrecacheLevel (void);
83
84
85// Retrieval.
86// Floor/ceiling opaque texture tiles,
87// lookup by name. For animation?
88int R_FlatNumForName (const char* name); // killough -- const added
89
90
91// R_*TextureNumForName returns the texture number for the texture name, or NO_TEXTURE if
92// there is no texture (i.e. "-") specified.
93/* cph 2006/07/23 - defined value for no-texture marker (texture "-" in the WAD file) */
94#define NO_TEXTURE 0
95int PUREFUNC R_TextureNumForName (const char *name); // killough -- const added; cph - now PUREFUNC
96int PUREFUNC R_SafeTextureNumForName (const char *name, int snum);
97int PUREFUNC R_CheckTextureNumForName (const char *name);
98
99void R_InitTranMap(int); // killough 3/6/98: translucency initialization
100int R_ColormapNumForName(const char *name); // killough 4/4/98
101/* cph 2001/11/17 - new func to do lighting calcs and get suitable colour map */
102const lighttable_t* R_ColourMap(int lightlevel, fixed_t spryscale);
103
104extern const byte *main_tranmap, *tranmap;
105
106/* Proff - Added for OpenGL - cph - const char* param */
107void R_SetPatchNum(patchnum_t *patchnum, const char *name);
108
109#endif