2001-04-15 04:54:44 +00:00
|
|
|
/*
|
|
|
|
d_local.h
|
|
|
|
|
2001-05-10 17:26:03 +00:00
|
|
|
Private rasterization driver defs
|
2001-04-15 04:54:44 +00:00
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2001-05-10 17:26:03 +00:00
|
|
|
#ifndef _D_LOCAL_H
|
|
|
|
#define _D_LOCAL_H
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
#include "QF/model.h"
|
|
|
|
#include "QF/qtypes.h"
|
2001-04-15 04:54:44 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// TODO: fine-tune this; it's based on providing some overage even if there
|
|
|
|
// is a 2k-wide scan, with subdivision every 8, for 256 spans of 12 bytes each
|
|
|
|
//
|
|
|
|
#define SCANBUFFERPAD 0x1000
|
|
|
|
|
|
|
|
#define R_SKY_SMASK 0x007F0000
|
|
|
|
#define R_SKY_TMASK 0x007F0000
|
|
|
|
|
|
|
|
#define DS_SPAN_LIST_END -128
|
|
|
|
|
|
|
|
#define SURFCACHE_SIZE_AT_320X200 600*1024
|
|
|
|
|
|
|
|
typedef struct surfcache_s
|
|
|
|
{
|
|
|
|
struct surfcache_s *next;
|
|
|
|
struct surfcache_s **owner; // NULL is an empty chunk of memory
|
|
|
|
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
|
|
|
|
int dlight;
|
|
|
|
int size; // including header
|
2001-05-10 17:26:03 +00:00
|
|
|
unsigned int width;
|
2010-01-13 06:42:26 +00:00
|
|
|
unsigned int height; // DEBUG needed only for debug
|
2001-04-15 04:54:44 +00:00
|
|
|
float mipscale;
|
|
|
|
struct texture_s *texture; // checked for animating textures
|
|
|
|
byte data[4]; // width*height elements
|
|
|
|
} surfcache_t;
|
|
|
|
|
|
|
|
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
2021-04-02 13:17:32 +00:00
|
|
|
typedef struct sspan_s {
|
2001-04-15 04:54:44 +00:00
|
|
|
int u, v, count;
|
|
|
|
} sspan_t;
|
|
|
|
|
2001-05-10 06:01:11 +00:00
|
|
|
extern struct cvar_s *d_subdiv16;
|
2001-04-15 04:54:44 +00:00
|
|
|
|
|
|
|
extern float scale_for_mip;
|
|
|
|
|
|
|
|
extern qboolean d_roverwrapped;
|
|
|
|
extern surfcache_t *sc_rover;
|
|
|
|
extern surfcache_t *d_initial_rover;
|
|
|
|
|
|
|
|
extern float d_sdivzstepu, d_tdivzstepu, d_zistepu;
|
|
|
|
extern float d_sdivzstepv, d_tdivzstepv, d_zistepv;
|
|
|
|
extern float d_sdivzorigin, d_tdivzorigin, d_ziorigin;
|
|
|
|
|
2001-05-10 17:26:03 +00:00
|
|
|
extern fixed16_t sadjust, tadjust;
|
|
|
|
extern fixed16_t bbextents, bbextentt;
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2001-08-25 02:47:11 +00:00
|
|
|
// FIXME: Better way of handling D_DrawSpans depths?
|
2012-02-14 08:28:09 +00:00
|
|
|
struct espan_s;
|
|
|
|
void D_DrawSpans (struct espan_s *pspans);
|
|
|
|
void D_DrawSpans8 (struct espan_s *pspans);
|
|
|
|
void D_DrawSpans16 (struct espan_s *pspans);
|
|
|
|
void D_DrawZSpans (struct espan_s *pspans);
|
|
|
|
void Turbulent (struct espan_s *pspan);
|
2001-04-15 04:54:44 +00:00
|
|
|
void D_SpriteDrawSpans (sspan_t *pspan);
|
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
void D_DrawSkyScans (struct espan_s *pspan);
|
2001-04-15 04:54:44 +00:00
|
|
|
|
|
|
|
void R_ShowSubDiv (void);
|
2001-10-23 16:55:23 +00:00
|
|
|
extern void (*prealspandrawer)(void);
|
2001-04-15 04:54:44 +00:00
|
|
|
surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel);
|
|
|
|
|
2018-10-09 03:35:01 +00:00
|
|
|
int D_MipLevelForScale (float scale) __attribute__((pure));
|
2001-04-15 04:54:44 +00:00
|
|
|
|
|
|
|
#ifdef USE_INTEL_ASM
|
2018-10-09 03:35:01 +00:00
|
|
|
void D_PolysetAff8Start (void);
|
|
|
|
void D_PolysetAff8End (void);
|
2001-04-15 04:54:44 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
extern short *d_pzbuffer;
|
2012-10-20 16:10:00 +00:00
|
|
|
extern int d_zrowbytes, d_zwidth;
|
2001-04-15 04:54:44 +00:00
|
|
|
|
|
|
|
extern int *d_pscantable;
|
2012-02-14 08:28:09 +00:00
|
|
|
extern int d_scantable[];
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2001-08-25 02:47:11 +00:00
|
|
|
extern int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2001-08-25 02:47:11 +00:00
|
|
|
extern int d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift;
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2001-08-25 02:47:11 +00:00
|
|
|
extern byte *d_viewbuffer;
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
extern short *zspantable[];
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2001-08-25 02:47:11 +00:00
|
|
|
extern int d_minmip;
|
|
|
|
extern float d_scalemip[3];
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
extern void (*d_drawspans) (struct espan_s *pspan);
|
2001-04-15 04:54:44 +00:00
|
|
|
|
2002-11-05 19:12:51 +00:00
|
|
|
void D_RasterizeAliasPolySmooth (void);
|
|
|
|
void D_PolysetCalcGradients (int skinwidth);
|
|
|
|
void D_PolysetScanLeftEdge (int height);
|
|
|
|
struct spanpackage_s;
|
|
|
|
void D_PolysetDrawSpans8 (struct spanpackage_s * pspanpackage);
|
|
|
|
void D_DrawTurbulent8Span (void);
|
|
|
|
|
2001-05-10 17:26:03 +00:00
|
|
|
#endif // _D_LOCAL_H
|