smth smth encore magic numbers idk
This commit is contained in:
1 parent
4847e4e3cb
commit
455bbe47c2
7 files changed
+24
-19
No files matched your search
@@ -26,6 +26,7 @@
|
||||
#include "../z_zone.h"
|
||||
#include "../v_video.h"
|
||||
#include "../r_draw.h"
|
||||
#include "../r_main.h"
|
||||
#include "../r_patch.h" // patch rotation
|
||||
|
||||
INT32 patchformat = GL_TEXFMT_AP_88; // use alpha for holes
|
||||
@@ -344,7 +345,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex, boolean noe
|
||||
|
||||
#ifdef GLENCORE
|
||||
if (encoremap && !noencore)
|
||||
grtex->mipmap.colormap += (256*32);
|
||||
grtex->mipmap.colormap += COLORMAP_REMAPOFFSET;
|
||||
#endif
|
||||
|
||||
blockwidth = texture->width;
|
||||
@@ -647,7 +648,7 @@ void HWR_GetFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
||||
|
||||
#ifdef GLENCORE
|
||||
if (!noencoremap && encoremap)
|
||||
grmip->colormap += (256*32);
|
||||
grmip->colormap += COLORMAP_REMAPOFFSET;
|
||||
#endif
|
||||
|
||||
if (!grmip->downloaded && !grmip->data)
|
||||
@@ -729,7 +730,8 @@ void HWR_GetMappedPatch(GLPatch_t *gpatch, const UINT8 *colormap)
|
||||
{
|
||||
GLMipmap_t *grmip, *newmip;
|
||||
|
||||
if (colormap == colormaps || colormap == NULL)
|
||||
// Blatant hack for encore colormapping aside...
|
||||
if (colormap == colormaps || colormap == NULL || colormap == (const UINT8*)(COLORMAP_REMAPOFFSET))
|
||||
{
|
||||
// Load the default (green) color in doom cache (temporary?) AND hardware cache
|
||||
HWR_GetPatch(gpatch);
|
||||
|
||||
@@ -5285,7 +5285,7 @@ void HWR_ProjectSprite(mobj_t *thing)
|
||||
vis->colormap = colormaps;
|
||||
#ifdef GLENCORE
|
||||
if (encoremap && !(thing->flags & MF_DONTENCOREMAP))
|
||||
vis->colormap += (256*32);
|
||||
vis->colormap += COLORMAP_REMAPOFFSET;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -5416,7 +5416,7 @@ void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||
|
||||
#ifdef GLENCORE
|
||||
if (encoremap && !(thing->flags & MF_DONTENCOREMAP))
|
||||
vis->colormap += (256*32);
|
||||
vis->colormap += COLORMAP_REMAPOFFSET;
|
||||
#endif
|
||||
|
||||
// set top/bottom coords
|
||||
|
||||
+2
-2
@@ -1696,7 +1696,7 @@ void R_DrawColumnShadowed_8(void)
|
||||
{
|
||||
dc_colormap = dc_lightlist[i].rcolormap;
|
||||
if (encoremap)
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
if (solid && dc_yl < bheight)
|
||||
dc_yl = bheight;
|
||||
continue;
|
||||
@@ -1714,7 +1714,7 @@ void R_DrawColumnShadowed_8(void)
|
||||
|
||||
dc_colormap = dc_lightlist[i].rcolormap;
|
||||
if (encoremap)
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
}
|
||||
dc_yh = realyh;
|
||||
if (dc_yl <= realyh)
|
||||
|
||||
@@ -64,6 +64,9 @@ extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
|
||||
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
|
||||
#define NUMCOLORMAPS 32
|
||||
|
||||
#define COLORMAP_SIZE (256*LIGHTLEVELS)
|
||||
#define COLORMAP_REMAPOFFSET COLORMAP_SIZE
|
||||
|
||||
// Utility functions.
|
||||
INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *node);
|
||||
INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line);
|
||||
|
||||
+2
-2
@@ -295,7 +295,7 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
||||
ds_colormap = planezlight[pindex];
|
||||
}
|
||||
if (encoremap && !currentplane->noencore)
|
||||
ds_colormap += (256*32);
|
||||
ds_colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
if (currentplane->extra_colormap)
|
||||
ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps);
|
||||
@@ -675,7 +675,7 @@ static void R_DrawSkyPlane(visplane_t *pl)
|
||||
// by INVUL inverse mapping.
|
||||
dc_colormap = colormaps;
|
||||
if (encoremap)
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
dc_texturemid = skytexturemid;
|
||||
dc_texheight = textureheight[skytexture]
|
||||
>>FRACBITS;
|
||||
|
||||
+8
-8
@@ -208,7 +208,7 @@ static void R_DrawWallSplats(void)
|
||||
pindex = MAXLIGHTSCALE - 1;
|
||||
dc_colormap = walllights[pindex];
|
||||
if (encoremap && !(seg->linedef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
if (frontsector->extra_colormap)
|
||||
dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
|
||||
@@ -573,7 +573,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||
{
|
||||
dc_colormap = rlight->rcolormap;
|
||||
if (encoremap && !(ldef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||
windowtop = windowbottom + 1;
|
||||
dc_colormap = rlight->rcolormap;
|
||||
if (encoremap && !(ldef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
}
|
||||
windowbottom = realbot;
|
||||
if (windowtop < windowbottom)
|
||||
@@ -612,7 +612,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||
|
||||
dc_colormap = walllights[pindex];
|
||||
if (encoremap && !(ldef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
if (frontsector->extra_colormap)
|
||||
dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
|
||||
@@ -1107,7 +1107,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||
{
|
||||
dc_colormap = rlight->rcolormap;
|
||||
if (encoremap && !(curline->linedef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
}
|
||||
if (solid && windowtop < bheight)
|
||||
windowtop = bheight;
|
||||
@@ -1139,7 +1139,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||
{
|
||||
dc_colormap = rlight->rcolormap;
|
||||
if (encoremap && !(curline->linedef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
}
|
||||
}
|
||||
windowbottom = sprbotscreen;
|
||||
@@ -1160,7 +1160,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||
dc_colormap = walllights[pindex];
|
||||
|
||||
if (encoremap && !(curline->linedef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
if (pfloor->flags & FF_FOG && pfloor->master->frontsector->extra_colormap)
|
||||
dc_colormap = pfloor->master->frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
|
||||
@@ -1396,7 +1396,7 @@ static void R_RenderSegLoop (void)
|
||||
|
||||
dc_colormap = walllights[pindex];
|
||||
if (encoremap && !(curline->linedef->flags & ML_TFERLINE))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
dc_x = rw_x;
|
||||
dc_iscale = 0xffffffffu / (unsigned)rw_scale;
|
||||
|
||||
|
||||
+2
-2
@@ -816,7 +816,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
||||
dc_colormap = colormaps;
|
||||
|
||||
if (encoremap && !vis->mobj->color && !(vis->mobj->flags & MF_DONTENCOREMAP))
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
dc_texturemid = vis->texturemid;
|
||||
dc_texheight = 0;
|
||||
@@ -939,7 +939,7 @@ static void R_DrawPrecipitationVisSprite(vissprite_t *vis)
|
||||
|
||||
dc_colormap = colormaps;
|
||||
if (encoremap)
|
||||
dc_colormap += (256*32);
|
||||
dc_colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
dc_iscale = FixedDiv(FRACUNIT, vis->scale);
|
||||
dc_texturemid = vis->texturemid;
|
||||
|
||||
Reference in new issue
Block a user