Go to the documentation of this file.
24 #define AFFINE_SPANLET_SIZE 16
25 #define AFFINE_SPANLET_SIZE_BITS 4
144 tturb = (tturb >> 16) & 63;
145 sturb = (sturb >> 16) & 63;
156 if (*
pz <= (
izi >> 16))
214 tturb = (tturb >> 16) & 63;
215 sturb = (sturb >> 16) & 63;
226 if (*
pz <= (
izi >> 16))
258 tturb = (tturb >> 16) & 63;
259 sturb = (sturb >> 16) & 63;
271 if (*
pz <= (
izi >> 16))
302 tturb = (tturb >> 16) & 63;
303 sturb = (sturb >> 16) & 63;
341 tturb = (tturb >> 16) & 63;
342 sturb = (sturb >> 16) & 63;
529 if (*
pz <= (
izi >> 16))
601 if (*
pz <= (
izi >> 16))
639 if (*
pz <= (
izi >> 16))
665 float frac, clipdist, *pclipnormal;
666 float *in, *instep, *outstep, *vert2;
668 clipdist = pclipplane->
dist;
669 pclipnormal = pclipplane->
normal;
686 for (
i = 0;
i < nump;
i++, instep +=
sizeof (
vec5_t) /
sizeof (
float))
688 dists[
i] =
DotProduct(instep, pclipnormal) - clipdist;
692 dists[nump] = dists[0];
693 memcpy(instep, in,
sizeof (
vec5_t));
700 for (
i = 0;
i < nump;
i++, instep +=
sizeof (
vec5_t) /
sizeof (
float))
704 memcpy(outstep, instep,
sizeof (
vec5_t));
705 outstep +=
sizeof (
vec5_t) /
sizeof (
float);
709 if (dists[
i] == 0 || dists[
i + 1] == 0)
712 if ((dists[
i] > 0) == (dists[
i + 1] > 0))
716 frac = dists[
i] / (dists[
i] - dists[
i + 1]);
718 vert2 = instep +
sizeof (
vec5_t) /
sizeof (
float);
720 outstep[0] = instep[0] + frac*(vert2[0] - instep[0]);
721 outstep[1] = instep[1] + frac*(vert2[1] - instep[1]);
722 outstep[2] = instep[2] + frac*(vert2[2] - instep[2]);
723 outstep[3] = instep[3] + frac*(vert2[3] - instep[3]);
724 outstep[4] = instep[4] + frac*(vert2[4] - instep[4]);
726 outstep +=
sizeof (
vec5_t) /
sizeof (
float);
742 float sdivzspanletstepu, tdivzspanletstepu, zispanletstepu;
776 du = (float)pspan->
u;
777 dv = (
float)pspan->
v;
783 z = (float)0x10000 /
zi;
817 sdivz += sdivzspanletstepu;
818 tdivz += tdivzspanletstepu;
819 zi += zispanletstepu;
820 z = (float)0x10000 /
zi;
853 z = (float)0x10000 /
zi;
907 int i,
v, itop, ibottom, lmaxindex;
910 float du,
dv, vtop, vbottom, slope;
929 vbottom = ceil(pnext->
v);
933 du = pnext->
u - pvert->
u;
934 dv = pnext->
v - pvert->
v;
937 u_step = (
int)(slope * 0x10000);
939 u = (
int)((pvert->
u + (slope * (vtop - pvert->
v))) * 0x10000) +
942 ibottom = (
int)vbottom;
944 for (
v = itop;
v < ibottom;
v++)
959 }
while (
i != lmaxindex);
970 int i,
v, itop, ibottom;
973 float du,
dv, vtop, vbottom, slope, uvert, unext, vvert, vnext;
998 vbottom = ceil(vnext);
1017 u_step = (
int)(slope * 0x10000);
1019 u = (
int)((uvert + (slope * (vtop - vvert))) * 0x10000) +
1022 ibottom = (
int)vbottom;
1024 for (
v = itop;
v < ibottom;
v++)
1026 pspan->
count = (
u >> 16) - pspan->
u;
1115 for (
i = 0;
i < 4;
i++)
1127 for (
i = 0;
i < nump;
i++)
1135 pout = &outverts[
i];
1147 pv +=
sizeof (
vec5_t) /
sizeof (pv[0]);
1162 int i, lindex, lnumverts;
1167 float tmins[2] = { 0, 0 };
1178 for (
i = 0;
i<lnumverts;
i++)
1247 vec3_t p_normal, p_saxis, p_taxis;
1302 if (pverts->
v < ymin)
1308 if (pverts->
v > ymax)
1330 pverts[nump] = pverts[0];
1372 s =
s->nextalphasurface;
void R_DrawSpanlet66Stipple(void)
void R_DrawAlphaSurfaces(void)
int R_ClipPolyFace(int nump, clipplane_t *pclipplane)
void R_PolygonCalculateGradients(void)
vec5_t r_clip_verts[2][MAXWORKINGVERTS+2]
CONST PIXELFORMATDESCRIPTOR int
static vec3_t transformed
#define VectorSubtract(a, b, c)
void R_DrawSpanletTurbulentBlended33(void)
surfcache_t * D_CacheSurface(msurface_t *surface, int miplevel)
static float spancountminus1
void R_IMFlatShadedQuad(vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha)
msurface_t * r_alpha_surfaces
void R_DrawSpanletTurbulentStipple66(void)
void R_PolygonScanRightEdge(void)
void CrossProduct(vec3_t v1, vec3_t v2, vec3_t cross)
void R_BuildPolygonFromSurface(msurface_t *fa)
#define DitherKernel2(u, v, X, Y)
#define AFFINE_SPANLET_SIZE_BITS
void(* Sys_Error)(int err_level, char *str,...)
static espan_t * s_polygon_spans
void R_ClipAndDrawPoly(float alpha, int isturbulent, qboolean textured)
void R_DrawSpanlet66(void)
vec_t VectorNormalize(vec3_t v)
int d_scantable[MAXHEIGHT]
void R_DrawSpanletTurbulentStipple33(void)
void R_DrawSpanletOpaque(void)
GLfloat GLfloat GLfloat alpha
void R_PolygonDrawSpans(espan_t *pspan, int iswater)
spanletvars_t s_spanletvars
void R_DrawSpanletTurbulentBlended66(void)
void R_DrawSpanlet33Stipple(void)
void(* drawspanlet)(void)
clipplane_t view_clipplanes[4]
void R_DrawSpanlet33(void)
void R_DrawSpanletConstant33(void)
static int r_polyblendcolor
#define AFFINE_SPANLET_SIZE
void TransformVector(vec3_t in, vec3_t out)
static void R_DrawPoly(int iswater)
void R_PolygonScanLeftEdge(void)