Prepare new maemo release
[maemo-rb.git] / apps / plugins / doom / r_data.h
blob905928fac7ff70ecefab39f21d0670fce9ab22fe
1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
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
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 * 02111-1307, USA.
27 * DESCRIPTION:
28 * Refresh module, data I/O, caching, retrieval of graphics
29 * by name.
31 *-----------------------------------------------------------------------------*/
34 #ifndef __R_DATA__
35 #define __R_DATA__
37 #include "r_defs.h"
38 #include "r_state.h"
40 #ifdef __GNUG__
41 #pragma interface
42 #endif
44 // A single patch from a texture definition, basically
45 // a rectangular area within the texture rectangle.
46 typedef struct
48 int originx, originy; // Block origin, which has already accounted
49 int patch; // for the internal origin of the patch.
51 texpatch_t;
54 // Texture definition.
55 // A DOOM wall texture is a list of patches
56 // which are to be combined in a predefined order.
59 typedef struct
61 char name[8]; // Keep name for switch changing, etc.
62 int next, index; // killough 1/31/98: used in hashing algorithm
63 // CPhipps - moved arrays with per-texture entries to elements here
64 unsigned widthmask;
65 size_t compositesize;
66 byte *composite;
67 short *columnlump;
68 unsigned *columnofs;
69 // CPhipps - end of additions
70 short width, height;
71 short patchcount; // All the patches[patchcount] are drawn
72 texpatch_t patches[1]; // back-to-front into the cached texture.
74 texture_t;
76 // Retrieve column data for span blitting.
77 const byte*
78 R_GetColumn
79 ( int tex,
80 int col );
83 // I/O, setting up the stuff.
84 void R_InitData (void);
85 void R_PrecacheLevel (void);
88 // Retrieval.
89 // Floor/ceiling opaque texture tiles,
90 // lookup by name. For animation?
91 int R_FlatNumForName (const char* name); // killough -- const added
94 // Called by P_Ticker for switches and animations,
95 // returns the texture number for the texture name.
96 int R_TextureNumForName (const char *name); // killough -- const added
97 int R_CheckTextureNumForName (const char *name);
99 void R_InitTranMap(int); // killough 3/6/98: translucency initialization
100 int R_ColormapNumForName(const char *name); // killough 4/4/98
102 extern const byte *main_tranmap, *tranmap;
104 /* Proff - Added for OpenGL - cph - const char* param */
105 void R_SetPatchNum(patchnum_t *patchnum, const char *name);
107 #endif