r_main.h 3.8 KB

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