r_main.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. //
  38. // POV related.
  39. //
  40. extern int displaywidth;
  41. extern int displayheight;
  42. extern fixed_t viewcos;
  43. extern fixed_t viewsin;
  44. extern int viewwidth;
  45. extern int viewheight;
  46. extern int viewwindowx;
  47. extern int viewwindowy;
  48. extern int centerx;
  49. extern int centery;
  50. extern fixed_t centerxfrac;
  51. extern fixed_t centeryfrac;
  52. extern fixed_t viewheightfrac; //e6y: for correct clipping of things
  53. extern fixed_t projection;
  54. // proff 11/06/98: Added for high-res
  55. extern fixed_t projectiony;
  56. extern int validcount;
  57. //
  58. // Rendering stats
  59. //
  60. extern int rendered_visplanes, rendered_segs, rendered_vissprites;
  61. extern boolean rendering_stats;
  62. //
  63. // Lighting LUT.
  64. // Used for z-depth cuing per column/row,
  65. // and other lighting effects (sector ambient, flash).
  66. //
  67. // Lighting constants.
  68. #define LIGHTLEVELS 16
  69. #define LIGHTSEGSHIFT 4
  70. #define MAXLIGHTSCALE 48
  71. #define LIGHTSCALESHIFT 12
  72. #define MAXLIGHTZ 128
  73. #define LIGHTZSHIFT 20
  74. // killough 3/20/98: Allow colormaps to be dynamic (e.g. underwater)
  75. extern const lighttable_t *(*zlight)[MAXLIGHTZ];
  76. extern const lighttable_t *fullcolormap;
  77. extern int numcolormaps; // killough 4/4/98: dynamic number of maps
  78. extern const lighttable_t **colormaps;
  79. // killough 3/20/98, 4/4/98: end dynamic colormaps
  80. extern int extralight;
  81. extern const lighttable_t *fixedcolormap;
  82. // Number of diminishing brightness levels.
  83. // There a 0-31, i.e. 32 LUT in the COLORMAP lump.
  84. #define NUMCOLORMAPS 32
  85. //
  86. // Utility functions.
  87. //
  88. PUREFUNC int R_PointOnSide(fixed_t x, fixed_t y, const node_t *node);
  89. PUREFUNC int R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line);
  90. angle_t R_PointToAngle(fixed_t x, fixed_t y);
  91. angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
  92. subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
  93. //
  94. // REFRESH - the actual rendering functions.
  95. //
  96. extern int testNewRenderer; // JDC
  97. void IR_RenderPlayerView (player_t* player); // JDC: new version
  98. void R_RenderPlayerView(player_t *player); // Called by G_Drawer.
  99. void R_Init(void); // Called by startup code.
  100. void R_SetViewSize(int blocks); // Called by M_Responder.
  101. void R_ExecuteSetViewSize(void); // cph - called by D_Display to complete a view resize
  102. #endif