home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / quake_src / d_local.h < prev    next >
C/C++ Source or Header  |  2000-06-17  |  3KB  |  116 lines

  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3.  
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  12.  
  13. See the GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. */
  20. // d_local.h:  private rasterization driver defs
  21.  
  22. #include "r_shared.h"
  23. #ifndef _D_LOCAL_H_
  24. #define _D_LOCAL_H_
  25. #endif
  26.  
  27. //
  28. // TODO: fine-tune this; it's based on providing some overage even if there
  29. // is a 2k-wide scan, with subdivision every 8, for 256 spans of 12 bytes each
  30. //
  31. #define SCANBUFFERPAD   0x1000
  32.  
  33. #define R_SKY_SMASK 0x007F0000
  34. #define R_SKY_TMASK 0x007F0000
  35.  
  36. #define DS_SPAN_LIST_END  -128
  37.  
  38. #define SURFCACHE_SIZE_AT_320X200 600*1024
  39.  
  40. typedef struct surfcache_s
  41. {
  42.   struct surfcache_s  *next;
  43.   struct surfcache_s  **owner;    // NULL is an empty chunk of memory
  44.   int         lightadj[MAXLIGHTMAPS]; // checked for strobe flush
  45.   int         dlight;
  46.   int         size;   // including header
  47.   unsigned      width;
  48.   unsigned      height;   // DEBUG only needed for debug
  49.   float       mipscale;
  50.   struct texture_s  *texture; // checked for animating textures
  51.   byte        data[4];  // width*height elements
  52. } surfcache_t;
  53.  
  54. // !!! if this is changed, it must be changed in asm_draw.h too !!!
  55. typedef struct sspan_s
  56. {
  57.   int       u, v, count;
  58. } sspan_t;
  59.  
  60. extern cvar_t d_subdiv16;
  61.  
  62. extern float  scale_for_mip;
  63.  
  64. extern qboolean   d_roverwrapped;
  65. extern surfcache_t  *sc_rover;
  66. extern surfcache_t  *d_initial_rover;
  67.  
  68. extern float  d_sdivzstepu, d_tdivzstepu, d_zistepu;
  69. extern float  d_sdivzstepv, d_tdivzstepv, d_zistepv;
  70. extern float  d_sdivzorigin, d_tdivzorigin, d_ziorigin;
  71.  
  72. #ifndef _R_LOCAL_H_
  73. extern fixed16_t sadjust, tadjust;
  74. extern fixed16_t bbextents, bbextentt;
  75. #endif
  76.  
  77. void D_DrawSpans8 (espan_t *pspans);
  78. void D_DrawSpans16 (espan_t *pspans);
  79. void D_DrawZSpans (espan_t *pspans);
  80. void Turbulent8 (espan_t *pspan);
  81. void D_SpriteDrawSpans (sspan_t *pspan);
  82.  
  83. void D_DrawSkyScans8 (espan_t *pspan);
  84. void D_DrawSkyScans16 (espan_t *pspan);
  85.  
  86. void R_ShowSubDiv (void);
  87. /* never used??? void (*prealspandrawer)(void);*/
  88. surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel);
  89.  
  90. extern int D_MipLevelForScale (float scale);
  91.  
  92. #if id386
  93. extern void D_PolysetAff8Start (void);
  94. extern void D_PolysetAff8End (void);
  95. #endif
  96.  
  97. extern short *d_pzbuffer;
  98. extern unsigned int d_zrowbytes, d_zwidth;
  99.  
  100. extern int  *d_pscantable;
  101. extern int  d_scantable[MAXHEIGHT];
  102.  
  103. extern int  d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
  104.  
  105. extern int  d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift;
  106.  
  107. extern pixel_t  *d_viewbuffer;
  108.  
  109. extern short  *zspantable[MAXHEIGHT];
  110.  
  111. extern int    d_minmip;
  112. extern float  d_scalemip[3];
  113.  
  114. extern void (*d_drawspans) (espan_t *pspan);
  115.  
  116.