r_data.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. #ifndef __R_DATA__
  35. #define __R_DATA__
  36. #include "r_defs.h"
  37. #include "r_state.h"
  38. #include "r_patch.h"
  39. #ifdef __GNUG__
  40. #pragma interface
  41. #endif
  42. // A single patch from a texture definition, basically
  43. // a rectangular area within the texture rectangle.
  44. typedef struct
  45. {
  46. short originx, originy; // Block origin, which has already accounted
  47. const patch_t* patch; // for the internal origin of the patch.
  48. } texpatch_t;
  49. //
  50. // Texture definition.
  51. // A DOOM wall texture is a list of patches
  52. // which are to be combined in a predefined order.
  53. //
  54. typedef struct
  55. {
  56. const char* name; // Keep name for switch changing, etc.
  57. //int next, index; // killough 1/31/98: used in hashing algorithm
  58. // CPhipps - moved arrays with per-texture entries to elements here
  59. unsigned short widthmask;
  60. // CPhipps - end of additions
  61. short width, height;
  62. unsigned char overlapped;
  63. unsigned char patchcount; // All the patches[patchcount] are drawn
  64. texpatch_t patches[1]; // back-to-front into the cached texture.
  65. } texture_t;
  66. // I/O, setting up the stuff.
  67. void R_InitData (void);
  68. // Retrieval.
  69. // Floor/ceiling opaque texture tiles,
  70. // lookup by name. For animation?
  71. int R_FlatNumForName (const char* name); // killough -- const added
  72. // R_*TextureNumForName returns the texture number for the texture name, or NO_TEXTURE if
  73. // there is no texture (i.e. "-") specified.
  74. /* cph 2006/07/23 - defined value for no-texture marker (texture "-" in the WAD file) */
  75. #define NO_TEXTURE 0
  76. int R_CheckTextureNumForName (const char *name);
  77. const texture_t* R_GetTexture(int texture);
  78. int R_LoadTextureByName(const char* tex_name);
  79. #endif