r_main.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. // Emacs style mode select -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // DESCRIPTION:
  18. // System specific interface stuff.
  19. //
  20. //-----------------------------------------------------------------------------
  21. #ifndef __R_MAIN__
  22. #define __R_MAIN__
  23. #include "d_player.h"
  24. #include "r_data.h"
  25. #ifdef __GNUG__
  26. #pragma interface
  27. #endif
  28. //
  29. // POV related.
  30. //
  31. extern fixed_t viewcos;
  32. extern fixed_t viewsin;
  33. extern int viewwidth;
  34. extern int viewheight;
  35. extern int viewwindowx;
  36. extern int viewwindowy;
  37. extern int centerx;
  38. extern int centery;
  39. extern fixed_t centerxfrac;
  40. extern fixed_t centeryfrac;
  41. extern fixed_t projection;
  42. extern int validcount;
  43. extern int linecount;
  44. extern int loopcount;
  45. //
  46. // Lighting LUT.
  47. // Used for z-depth cuing per column/row,
  48. // and other lighting effects (sector ambient, flash).
  49. //
  50. // Lighting constants.
  51. // Now why not 32 levels here?
  52. #define LIGHTLEVELS 16
  53. #define LIGHTSEGSHIFT 4
  54. #define MAXLIGHTSCALE 48
  55. #define LIGHTSCALESHIFT 12
  56. #define MAXLIGHTZ 128
  57. #define LIGHTZSHIFT 20
  58. extern lighttable_t* scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
  59. extern lighttable_t* scalelightfixed[MAXLIGHTSCALE];
  60. extern lighttable_t* zlight[LIGHTLEVELS][MAXLIGHTZ];
  61. extern int extralight;
  62. extern lighttable_t* fixedcolormap;
  63. // Number of diminishing brightness levels.
  64. // There a 0-31, i.e. 32 LUT in the COLORMAP lump.
  65. #define NUMCOLORMAPS 32
  66. // Blocky/low detail mode.
  67. //B remove this?
  68. // 0 = high, 1 = low
  69. extern int detailshift;
  70. //
  71. // Function pointers to switch refresh/drawing functions.
  72. // Used to select shadow mode etc.
  73. //
  74. extern void (*colfunc) (void);
  75. extern void (*basecolfunc) (void);
  76. extern void (*fuzzcolfunc) (void);
  77. // No shadow effects on floors.
  78. extern void (*spanfunc) (void);
  79. //
  80. // Utility functions.
  81. int
  82. R_PointOnSide
  83. ( fixed_t x,
  84. fixed_t y,
  85. node_t* node );
  86. int
  87. R_PointOnSegSide
  88. ( fixed_t x,
  89. fixed_t y,
  90. seg_t* line );
  91. angle_t
  92. R_PointToAngle
  93. ( fixed_t x,
  94. fixed_t y );
  95. angle_t
  96. R_PointToAngle2
  97. ( fixed_t x1,
  98. fixed_t y1,
  99. fixed_t x2,
  100. fixed_t y2 );
  101. fixed_t
  102. R_PointToDist
  103. ( fixed_t x,
  104. fixed_t y );
  105. fixed_t R_ScaleFromGlobalAngle (angle_t visangle);
  106. subsector_t*
  107. R_PointInSubsector
  108. ( fixed_t x,
  109. fixed_t y );
  110. void
  111. R_AddPointToBox
  112. ( int x,
  113. int y,
  114. fixed_t* box );
  115. //
  116. // REFRESH - the actual rendering functions.
  117. //
  118. // Called by G_Drawer.
  119. void R_RenderPlayerView (player_t *player);
  120. // Called by startup code.
  121. void R_Init (void);
  122. // Called by M_Responder.
  123. void R_SetViewSize (int blocks, int detail);
  124. #endif
  125. //-----------------------------------------------------------------------------
  126. //
  127. // $Log:$
  128. //
  129. //-----------------------------------------------------------------------------