fix oopsie in R_Render2sidedMultiPatchColumn
This commit is contained in:
1 parent
c0fe43ff0c
commit
5d2aebc269
2 files changed
+9
-6
No files matched your search
+3
-4
@@ -248,14 +248,13 @@ static void R_DrawWallSplats(void)
|
||||
// way we don't have to store extra post_t info with each column for
|
||||
// multi-patch textures. They are not normally needed as multi-patch
|
||||
// textures don't have holes in it. At least not for now.
|
||||
static INT32 column2s_length; // column->length : for multi-patch on 2sided wall = texture->height
|
||||
|
||||
static void R_Render2sidedMultiPatchColumn(column_t *column)
|
||||
{
|
||||
INT32 topscreen, bottomscreen;
|
||||
|
||||
topscreen = sprtopscreen; // + spryscale*column->topdelta; topdelta is 0 for the wall
|
||||
bottomscreen = topscreen + spryscale * column2s_length;
|
||||
bottomscreen = topscreen + spryscale * lengthcol;
|
||||
|
||||
dc_yl = (sprtopscreen+FRACUNIT-1)>>FRACBITS;
|
||||
dc_yh = (bottomscreen-1)>>FRACBITS;
|
||||
@@ -388,7 +387,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||
else
|
||||
{
|
||||
colfunc_2s = R_Render2sidedMultiPatchColumn; // render multipatch with no holes (no post_t info)
|
||||
column2s_length = textures[texnum]->height;
|
||||
lengthcol = textures[texnum]->height;
|
||||
}
|
||||
|
||||
// Setup lighting based on the presence/lack-of 3D floors.
|
||||
@@ -959,7 +958,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||
else
|
||||
{
|
||||
colfunc_2s = R_Render2sidedMultiPatchColumn; //render multipatch with no holes (no post_t info)
|
||||
column2s_length = textures[texnum]->height;
|
||||
lengthcol = textures[texnum]->height;
|
||||
}
|
||||
|
||||
// Set heights according to plane, or slope, whichever
|
||||
|
||||
+6
-2
@@ -689,13 +689,13 @@ static void R_DrawFlippedMaskedColumn(column_t *column)
|
||||
dc_yl = mceilingclip[dc_x]+1;
|
||||
if (dc_yl < 0)
|
||||
dc_yl = 0;
|
||||
if (dc_yh >= vid.height)
|
||||
if (dc_yh >= vid.height) // dc_yl must be < vid.height, so reduces number of checks in tight loop
|
||||
dc_yh = vid.height - 1;
|
||||
|
||||
if (dc_yl <= dc_yh && dc_yh > 0 && column->length != 0)
|
||||
{
|
||||
dc_source = ZZ_Alloc(column->length);
|
||||
dc_sourcelength = column->length;
|
||||
dc_sourcelength = dc_texheight = column->length;
|
||||
|
||||
for (s = (UINT8 *)column+2+column->length, d = dc_source; d < dc_source+column->length; --s)
|
||||
*d++ = *s;
|
||||
@@ -704,6 +704,10 @@ static void R_DrawFlippedMaskedColumn(column_t *column)
|
||||
// Still drawn by R_DrawColumn.
|
||||
if (ylookup[dc_yl])
|
||||
colfunc();
|
||||
#ifdef PARANOIA
|
||||
else
|
||||
I_Error("R_DrawMaskedColumn: Invalid ylookup for dc_yl %d", dc_yl);
|
||||
#endif
|
||||
Z_Free(dc_source);
|
||||
}
|
||||
column = (column_t *)((UINT8 *)column + column->length + 4);
|
||||
|
||||
Reference in new issue
Block a user