r_main.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. * Renderer main interface.
  31. *
  32. *-----------------------------------------------------------------------------*/
  33. #ifndef __R_MAIN__
  34. #define __R_MAIN__
  35. #include "d_player.h"
  36. #include "r_data.h"
  37. #ifdef __GNUG__
  38. #pragma interface
  39. #endif
  40. //
  41. // Lighting LUT.
  42. // Used for z-depth cuing per column/row,
  43. // and other lighting effects (sector ambient, flash).
  44. //
  45. // Lighting constants.
  46. #define LIGHTLEVELS 16
  47. #define LIGHTSEGSHIFT 4
  48. #define MAXLIGHTSCALE 48
  49. #define LIGHTSCALESHIFT 12
  50. #define MAXLIGHTZ 128
  51. #define LIGHTZSHIFT 20
  52. // Number of diminishing brightness levels.
  53. // There a 0-31, i.e. 32 LUT in the COLORMAP lump.
  54. #define NUMCOLORMAPS 32
  55. extern const int viewheight;
  56. extern const int centery;
  57. extern const fixed_t projection;
  58. extern const fixed_t iprojection;
  59. //Global vars.
  60. extern int numnodes;
  61. extern const mapnode_t *nodes;
  62. extern fixed_t viewx, viewy, viewz;
  63. extern angle_t viewangle;
  64. extern short *floorclip, *ceilingclip;
  65. extern const lighttable_t *fullcolormap;
  66. extern const lighttable_t *colormaps;
  67. extern const lighttable_t* fixedcolormap;
  68. extern int extralight; // bumped light from gun blasts
  69. extern const texture_t **textures; // proff - 04/05/2000 removed static for OpenGL
  70. extern fixed_t *textureheight; //needed for texture pegging (and TFE fix - killough)
  71. extern short *flattranslation; // for global animation
  72. extern short *texturetranslation;
  73. extern fixed_t basexscale, baseyscale;
  74. extern fixed_t viewcos, viewsin;
  75. //
  76. // Utility functions.
  77. //
  78. angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
  79. subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
  80. //
  81. // REFRESH - the actual rendering functions.
  82. //
  83. void R_RenderPlayerView(player_t *player); // Called by G_Drawer.
  84. void R_Init(void); // Called by startup code.
  85. void R_SetupFrame (player_t *player);
  86. #endif