mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Implement brightmaps for span drawers, fix column loop bug
This commit is contained in:
parent
04c1a9dcb1
commit
daab86f461
5 changed files with 642 additions and 388 deletions
|
|
@ -110,6 +110,7 @@ INT32 dc_numlights = 0, dc_maxlights, dc_texheight;
|
||||||
|
|
||||||
INT32 ds_y, ds_x1, ds_x2;
|
INT32 ds_y, ds_x1, ds_x2;
|
||||||
lighttable_t *ds_colormap;
|
lighttable_t *ds_colormap;
|
||||||
|
lighttable_t *ds_fullbright;
|
||||||
lighttable_t *ds_translation; // Lactozilla: Sprite splat drawer
|
lighttable_t *ds_translation; // Lactozilla: Sprite splat drawer
|
||||||
|
|
||||||
fixed_t ds_xfrac, ds_yfrac, ds_xstep, ds_ystep;
|
fixed_t ds_xfrac, ds_yfrac, ds_xstep, ds_ystep;
|
||||||
|
|
@ -119,6 +120,7 @@ UINT16 ds_flatwidth, ds_flatheight;
|
||||||
boolean ds_powersoftwo;
|
boolean ds_powersoftwo;
|
||||||
|
|
||||||
UINT8 *ds_source; // points to the start of a flat
|
UINT8 *ds_source; // points to the start of a flat
|
||||||
|
UINT8 *ds_brightmap; // start of brightmap flat
|
||||||
UINT8 *ds_transmap; // one of the translucency tables
|
UINT8 *ds_transmap; // one of the translucency tables
|
||||||
|
|
||||||
// Vectors for Software's tilted slope drawers
|
// Vectors for Software's tilted slope drawers
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ extern INT32 dc_texheight;
|
||||||
|
|
||||||
extern INT32 ds_y, ds_x1, ds_x2;
|
extern INT32 ds_y, ds_x1, ds_x2;
|
||||||
extern lighttable_t *ds_colormap;
|
extern lighttable_t *ds_colormap;
|
||||||
|
extern lighttable_t *ds_fullbright;
|
||||||
extern lighttable_t *ds_translation;
|
extern lighttable_t *ds_translation;
|
||||||
|
|
||||||
extern fixed_t ds_xfrac, ds_yfrac, ds_xstep, ds_ystep;
|
extern fixed_t ds_xfrac, ds_yfrac, ds_xstep, ds_ystep;
|
||||||
|
|
@ -68,6 +69,7 @@ extern UINT16 ds_flatwidth, ds_flatheight;
|
||||||
extern boolean ds_powersoftwo;
|
extern boolean ds_powersoftwo;
|
||||||
|
|
||||||
extern UINT8 *ds_source;
|
extern UINT8 *ds_source;
|
||||||
|
extern UINT8 *ds_brightmap;
|
||||||
extern UINT8 *ds_transmap;
|
extern UINT8 *ds_transmap;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
||||||
886
src/r_draw8.c
886
src/r_draw8.c
File diff suppressed because it is too large
Load diff
|
|
@ -235,7 +235,9 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentplane->slope)
|
if (currentplane->slope)
|
||||||
|
{
|
||||||
ds_colormap = colormaps;
|
ds_colormap = colormaps;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pindex = distance >> LIGHTZSHIFT;
|
pindex = distance >> LIGHTZSHIFT;
|
||||||
|
|
@ -244,8 +246,13 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
||||||
ds_colormap = planezlight[pindex];
|
ds_colormap = planezlight[pindex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ds_fullbright = colormaps;
|
||||||
|
|
||||||
if (encoremap && !currentplane->noencore)
|
if (encoremap && !currentplane->noencore)
|
||||||
|
{
|
||||||
ds_colormap += COLORMAP_REMAPOFFSET;
|
ds_colormap += COLORMAP_REMAPOFFSET;
|
||||||
|
ds_fullbright += COLORMAP_REMAPOFFSET;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentplane->extra_colormap)
|
if (currentplane->extra_colormap)
|
||||||
ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps);
|
ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps);
|
||||||
|
|
@ -970,6 +977,30 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
R_CheckFlatLength(ds_flatwidth * ds_flatheight);
|
R_CheckFlatLength(ds_flatwidth * ds_flatheight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ds_brightmap = NULL;
|
||||||
|
|
||||||
|
if (type == LEVELFLAT_TEXTURE)
|
||||||
|
{
|
||||||
|
// Get the span's brightmap.
|
||||||
|
// FLATS not supported, SORRY!!
|
||||||
|
INT32 texNum = R_GetTextureNum(levelflat->u.texture.num);
|
||||||
|
INT32 bmNum = R_GetTextureBrightmap(texNum);
|
||||||
|
|
||||||
|
if (bmNum != 0)
|
||||||
|
{
|
||||||
|
texture_t *brightmap = textures[bmNum];
|
||||||
|
|
||||||
|
if (brightmap->flat == NULL)
|
||||||
|
{
|
||||||
|
ds_brightmap = R_GenerateTextureAsFlat(bmNum);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ds_brightmap = (UINT8 *)brightmap->flat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
||||||
&& viewangle != pl->viewangle+pl->plangle)
|
&& viewangle != pl->viewangle+pl->plangle)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -444,6 +444,7 @@ static void R_RasterizeFloorSplat(floorsplat_t *pSplat, vector2_t *verts, visspr
|
||||||
}
|
}
|
||||||
|
|
||||||
ds_colormap = vis->colormap;
|
ds_colormap = vis->colormap;
|
||||||
|
ds_fullbright = colormaps;
|
||||||
ds_translation = R_GetSpriteTranslation(vis);
|
ds_translation = R_GetSpriteTranslation(vis);
|
||||||
if (ds_translation == NULL)
|
if (ds_translation == NULL)
|
||||||
ds_translation = colormaps;
|
ds_translation = colormaps;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue