Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
bsprestart is off. Would need a third pass, and already rather slow. …
Browse files Browse the repository at this point in the history
…But found a few good transparency tweaks.

Improved fog and colored light colors.
Removed 'super8' directory.
  • Loading branch information
qbism committed Feb 1, 2016
1 parent 784e035 commit f0ac44e
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 187 deletions.
1 change: 1 addition & 0 deletions cl_parse.c
Expand Up @@ -406,6 +406,7 @@ void CL_ParseServerInfo (void)
}

// local state
cl_entities[0].alphaspans = true; //qb: usually true for modern maps
cl_entities[0].model = cl.worldmodel = cl.model_precache[1];
vibration_update[0] = vibration_update[1] = false; // Manoel Kasimier
LOC_LoadLocations (); //qb: talk macro - Read a location file
Expand Down
2 changes: 1 addition & 1 deletion common.c
Expand Up @@ -1951,7 +1951,7 @@ void COM_InitFilesystem (void)
// start up with GAMENAME by default (id1)
//
AddDir (true, basedir, gamedir, GAMENAME);
AddDir (true, basedir, gamedir, "super8"); //qb: put super8 junk in own dir
//qb: no more! AddDir (true, basedir, gamedir, "super8"); //qb: put super8 junk in own dir


i = COM_CheckParm ("-game2");
Expand Down
106 changes: 34 additions & 72 deletions d_edge.c
Expand Up @@ -194,55 +194,18 @@ void D_DrawSurfaces (void)
d_zistepv = s->d_zistepv;
d_ziorigin = s->d_ziorigin;

/* if (s->flags & SURF_DRAWTURB) // && !r_overdraw && !(s->flags |= SURF_DRAWTRANSLUCENT))
{
pface = s->data;
miplevel = 0;
cacheblock = (pixel_t *)
((byte *)pface->texinfo->texture +
pface->texinfo->texture->offsets[0]);
cachewidth = 64;
D_CalcGradients (pface);
if (s->insubmodel)
{
// FIXME: we don't want to do all this for every polygon!
// TODO: store once at start of frame
currententity = s->entity; //FIXME: make this passed in to R_RotateBmodel ()
VectorSubtract (r_origin, currententity->origin, local_modelorg);
TransformVector (local_modelorg, transformed_modelorg);
R_RotateBmodel (); // FIXME: don't mess with the frustum, make entity passed in
}
Turbulent8 (pspans); // mankrip
if(!(s->flags & SURF_DRAWTRANSLUCENT))
D_DrawZSpans (pspans);
if (s->insubmodel)
{
// restore the old drawing state
// FIXME: we don't want to do this every time!
// TODO: speed up
currententity = &cl_entities[0];
VectorCopy (world_transformed_modelorg,
transformed_modelorg);
VectorCopy (base_vpn, vpn);
VectorCopy (base_vup, vup);
VectorCopy (base_vright, vright);
VectorCopy (base_modelorg, modelorg);
R_TransformFrustum ();
}
}
else */ if (r_overdraw && !(s->flags & SURF_DRAWTRANSLUCENT))
continue;
if (s->flags & SURF_DRAWTRANSLUCENT)
{
if (!r_overdraw)
continue;
}
else if (r_overdraw)
continue;

// mankrip - skyboxes - begin
// Code taken from the ToChriS engine - Author: Vic (vic@quakesrc.org) (http://hkitchen.quakesrc.org/)

else if (s->flags & SURF_DRAWSKY)
if (s->flags & SURF_DRAWSKY)
{
D_DrawSkyScans8(pspans); // mankrip
D_DrawZSpans (pspans); // mankrip - edited
Expand All @@ -260,7 +223,7 @@ void D_DrawSurfaces (void)
D_DrawSolidSurface (pspans, (int)r_clearcolor.value & 0xFF);
D_DrawZSpans (pspans); // mankrip - edited
}
else if (s->flags & SURF_DRAWTRANSLUCENT) // && !(s->flags & SURF_DRAWTURB))
else if (s->flags & SURF_DRAWTRANSLUCENT)
{
pface = s->data;
miplevel = 0;
Expand Down Expand Up @@ -299,7 +262,6 @@ void D_DrawSurfaces (void)
else D_DrawSpans16_Blend(pspans); //qb: catchall
}


if (s->insubmodel)
{
// restore the old drawing state
Expand All @@ -317,7 +279,7 @@ void D_DrawSurfaces (void)
}
}

else if (s->flags & SURF_DRAWSKYBOX)
else if (s->flags & SURF_DRAWSKYBOX)
{
extern byte r_skypixels[6][1024*1024]; //qb: increased to 1024x1024

Expand Down Expand Up @@ -347,44 +309,44 @@ void D_DrawSurfaces (void)
D_DrawZSpans (pspans); // mankrip - edited
}
// Manoel Kasimier - skyboxes - end
else if (!r_overdraw)
{
if (s->insubmodel)
{
// FIXME: we don't want to do all this for every polygon!
// TODO: store once at start of frame
currententity = s->entity; //FIXME: make this passed in to
// R_RotateBmodel ()
VectorSubtract (r_origin, currententity->origin, local_modelorg);
TransformVector (local_modelorg, transformed_modelorg);

R_RotateBmodel (); // FIXME: don't mess with the frustum,
// make entity passed in
}

pface = s->data;
else if (!r_overdraw)
{
if (s->insubmodel)
{
// FIXME: we don't want to do all this for every polygon!
// TODO: store once at start of frame
currententity = s->entity; //FIXME: make this passed in to
// R_RotateBmodel ()
VectorSubtract (r_origin, currententity->origin, local_modelorg);
TransformVector (local_modelorg, transformed_modelorg);

R_RotateBmodel (); // FIXME: don't mess with the frustum,
// make entity passed in
}

pface = s->data;

if (s->flags & SURF_DRAWTURB)
{
{
miplevel = 0;
cacheblock = (pixel_t *) ((byte *)pface->texinfo->texture + pface->texinfo->texture->offsets[0]);
cachewidth = 64;
D_CalcGradients (pface);
Turbulent8 (pspans);
}
else
{
}
else
{
miplevel = D_MipLevelForScale (s->nearzi * scale_for_mip * pface->texinfo->mipadjust);
pcurrentcache = D_CacheSurface (pface, miplevel);
cacheblock = (pixel_t *)pcurrentcache->data;
cachewidth = pcurrentcache->width;
D_CalcGradients (pface);
(*d_drawspans) (pspans);
}
(*d_drawspans) (pspans);
}
D_DrawZSpans (pspans);

if (s->insubmodel)
{
if (s->insubmodel)
{
// restore the old drawing state
// FIXME: we don't want to do this every time!
// TODO: speed up
Expand Down
2 changes: 1 addition & 1 deletion d_scan.c
Expand Up @@ -411,7 +411,7 @@ void Turbulent8 (espan_t *pspan)
r_turb_t = r_turb_t & ((CYCLE<<16)-1);

// Manoel Kasimier - translucent water - begin
if (1) //(r_overdraw)
if (r_overdraw)
{
if (r_wateralpha.value <= 0.41) // 33%
{
Expand Down
4 changes: 2 additions & 2 deletions r_bsp.c
Expand Up @@ -349,7 +349,7 @@ void R_DrawSolidClippedSubmodelPolygons (model_t *pmodel, int alphamask)
if ((psurf->flags & SURF_DRAWTRANSLUCENT))
currententity->alphaspans = true;

if (!r_overdraw && currententity->alphaspans)
if (!r_overdraw && psurf->flags & SURF_DRAWTRANSLUCENT)
continue; //qb: kick out fence surfaces in this case
}
// find which side of the node we are on
Expand Down Expand Up @@ -442,7 +442,7 @@ void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags, int alphamask)
if ((psurf->flags & SURF_DRAWTRANSLUCENT))
currententity->alphaspans = true;

if (!r_overdraw && currententity->alphaspans)
if (!r_overdraw && psurf->flags & SURF_DRAWTRANSLUCENT)
continue; //qb: kick out fence surfaces in this case
}

Expand Down
23 changes: 20 additions & 3 deletions r_draw.c
Expand Up @@ -585,15 +585,32 @@ void R_RenderFace (msurface_t *fa, int clipflags)
if ((fa->flags & SURF_DRAWSKY) && r_drawskybox)
return; //qb: Is there a cheap way to hide faces that are behind sky faces but facing view. Crazy mappers!

if (fa->flags & SURF_DRAWTRANSLUCENT)

if (fa->flags & SURF_DRAWTRANSLUCENT)
{
if (!r_overdraw)
return;
}
else if (r_overdraw)
return;
// }
// Manoel Kasimier - translucent water - end

/*
if (currententity == &cl_entities[0])
if (currententity->alphaspans)
{
if (!r_overdraw)
return;
}
else if (fa->flags & SURF_DRAWTRANSLUCENT)
{
if (!r_overdraw)
return;
}
else if (r_overdraw)
if (currententity == &cl_entities[0])
return;
*/

// skip out if no more surfs
if ((surface_p) >= surf_max)
Expand Down

0 comments on commit f0ac44e

Please sign in to comment.