home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / games / doom / pmdoom / include / r_main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-17  |  3.5 KB  |  172 lines

  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.  
  22.  
  23. #ifndef __R_MAIN__
  24. #define __R_MAIN__
  25.  
  26. #include "d_player.h"
  27. #include "r_data.h"
  28.  
  29.  
  30. #ifdef __GNUG__
  31. #pragma interface
  32. #endif
  33.  
  34.  
  35. /*  */
  36. /*  POV related. */
  37. /*  */
  38. extern fixed_t        viewcos;
  39. extern fixed_t        viewsin;
  40.  
  41. extern int        viewwidth;
  42. extern int        viewheight;
  43. extern int        viewwindowx;
  44. extern int        viewwindowy;
  45.  
  46.  
  47.  
  48. extern int        centerx;
  49. extern int        centery;
  50.  
  51. extern fixed_t        centerxfrac;
  52. extern fixed_t        centeryfrac;
  53. extern fixed_t        projection;
  54.  
  55. extern int        validcount;
  56.  
  57. extern int        linecount;
  58. extern int        loopcount;
  59.  
  60.  
  61. /*  */
  62. /*  Lighting LUT. */
  63. /*  Used for z-depth cuing per column/row, */
  64. /*   and other lighting effects (sector ambient, flash). */
  65. /*  */
  66.  
  67. /*  Lighting constants. */
  68. /*  Now why not 32 levels here? */
  69. #define LIGHTLEVELS            16
  70. #define LIGHTSEGSHIFT             4
  71.  
  72. #define MAXLIGHTSCALE        48
  73. #define LIGHTSCALESHIFT        12
  74. #define MAXLIGHTZ           128
  75. #define LIGHTZSHIFT        20
  76.  
  77. extern lighttable_t*    scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
  78. extern lighttable_t*    scalelightfixed[MAXLIGHTSCALE];
  79. extern lighttable_t*    zlight[LIGHTLEVELS][MAXLIGHTZ];
  80.  
  81. extern int        extralight;
  82. extern lighttable_t*    fixedcolormap;
  83.  
  84.  
  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. /*  Blocky/low detail mode. */
  90. /* B remove this? */
  91. /*   0 = high, 1 = low */
  92. extern    int        detailshift;    
  93.  
  94.  
  95. /*  */
  96. /*  Function pointers to switch refresh/drawing functions. */
  97. /*  Used to select shadow mode etc. */
  98. /*  */
  99. extern void        (*colfunc) (void);
  100. extern void        (*basecolfunc) (void);
  101. extern void        (*fuzzcolfunc) (void);
  102. /*  No shadow effects on floors. */
  103. extern void        (*spanfunc) (void);
  104.  
  105.  
  106. /*  */
  107. /*  Utility functions. */
  108. int
  109. R_PointOnSide
  110. ( fixed_t    x,
  111.   fixed_t    y,
  112.   node_t*    node );
  113.  
  114. int
  115. R_PointOnSegSide
  116. ( fixed_t    x,
  117.   fixed_t    y,
  118.   seg_t*    line );
  119.  
  120. angle_t
  121. R_PointToAngle
  122. ( fixed_t    x,
  123.   fixed_t    y );
  124.  
  125. angle_t
  126. R_PointToAngle2
  127. ( fixed_t    x1,
  128.   fixed_t    y1,
  129.   fixed_t    x2,
  130.   fixed_t    y2 );
  131.  
  132. fixed_t
  133. R_PointToDist
  134. ( fixed_t    x,
  135.   fixed_t    y );
  136.  
  137.  
  138. fixed_t R_ScaleFromGlobalAngle (angle_t visangle);
  139.  
  140. subsector_t*
  141. R_PointInSubsector
  142. ( fixed_t    x,
  143.   fixed_t    y );
  144.  
  145. void
  146. R_AddPointToBox
  147. ( int        x,
  148.   int        y,
  149.   fixed_t*    box );
  150.  
  151.  
  152.  
  153. /*  */
  154. /*  REFRESH - the actual rendering functions. */
  155. /*  */
  156.  
  157. /*  Called by G_Drawer. */
  158. void R_RenderPlayerView (player_t *player);
  159.  
  160. /*  Called by startup code. */
  161. void R_Init (void);
  162.  
  163. /*  Called by M_Responder. */
  164. void R_SetViewSize (int blocks, int detail);
  165.  
  166. #endif
  167. /* ----------------------------------------------------------------------------- */
  168. /*  */
  169. /*  $Log:$ */
  170. /*  */
  171. /* ----------------------------------------------------------------------------- */
  172.