mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-23 10:41:51 +00:00
Merge branch 'clipmidtex' into extra-textures
This commit is contained in:
parent
3bdd8f2b04
commit
b4adb261a3
3 changed files with 17 additions and 11 deletions
|
@ -1375,6 +1375,8 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
sd->scalex_top = sd->scalex_mid = sd->scalex_bottom = FRACUNIT;
|
||||
sd->scaley_top = sd->scaley_mid = sd->scaley_bottom = FRACUNIT;
|
||||
|
||||
sd->flags = 0;
|
||||
|
||||
P_InitSideEdges(sd);
|
||||
|
||||
P_SetSidedefSector(i, (UINT16)SHORT(msd->sector));
|
||||
|
@ -2690,6 +2692,8 @@ static void P_WriteTextmap(void)
|
|||
fprintf(f, "midpeg = true;\n");
|
||||
if (wlines[i].flags & ML_MIDSOLID)
|
||||
fprintf(f, "midsolid = true;\n");
|
||||
if (wlines[i].flags & ML_CLIPMIDTEX)
|
||||
fprintf(f, "clipmidtex = true;\n");
|
||||
if (wlines[i].flags & ML_WRAPMIDTEX)
|
||||
fprintf(f, "wrapmidtex = true;\n");
|
||||
if (wlines[i].flags & ML_NONET)
|
||||
|
@ -3155,6 +3159,7 @@ static void P_LoadTextmap(void)
|
|||
sd->bottomtexture = R_TextureNumForName("-");
|
||||
sd->sector = NULL;
|
||||
sd->repeatcnt = 0;
|
||||
sd->flags = 0;
|
||||
|
||||
P_InitSideEdges(sd);
|
||||
|
||||
|
|
|
@ -631,10 +631,10 @@ typedef struct line_s
|
|||
// Don't make available to Lua or I will find where you live
|
||||
typedef enum
|
||||
{
|
||||
SIDEFLAG_CLIP_MIDTEX = 1<<4, // Like the line counterpart, but only for this side.
|
||||
SIDEFLAG_WRAP_MIDTEX = 1<<5, // Like the line counterpart, but only for this side.
|
||||
SIDEFLAG_CLIP_MIDTEX = 1 << 0, // Like the line counterpart, but only for this side.
|
||||
SIDEFLAG_WRAP_MIDTEX = 1 << 1, // Like the line counterpart, but only for this side.
|
||||
|
||||
SIDEFLAG_HASEDGETEXTURES = 1<<13 // Side has an edge texture applied (so that the renderer can quickly skip all relevant code)
|
||||
SIDEFLAG_HASEDGETEXTURES = 1 << 2 // Side has an edge texture applied (so that the renderer can quickly skip all relevant code)
|
||||
} sideflags_t;
|
||||
|
||||
enum
|
||||
|
@ -669,6 +669,7 @@ typedef struct side_s
|
|||
fixed_t scalex_top, scalex_mid, scalex_bottom;
|
||||
fixed_t scaley_top, scaley_mid, scaley_bottom;
|
||||
|
||||
// Rendering-related flags
|
||||
UINT16 flags;
|
||||
|
||||
// Texture indices.
|
||||
|
|
16
src/r_segs.c
16
src/r_segs.c
|
@ -420,14 +420,13 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
rw_scalestep = scalestep;
|
||||
spryscale = scale1 + (x1 - ds->x1)*rw_scalestep;
|
||||
|
||||
// Texture must be cached before setting colfunc_2s,
|
||||
// otherwise texture[texnum]->holes may be false when it shouldn't be
|
||||
// Texture must be cached
|
||||
R_CheckTextureCache(texnum);
|
||||
|
||||
if (vertflip) // vertically flipped?
|
||||
colfunc_2s = R_DrawFlippedMaskedColumn;
|
||||
else
|
||||
colfunc_2s = R_DrawMaskedColumn; // render the usual 2sided single-patch packed texture
|
||||
colfunc_2s = R_DrawMaskedColumn;
|
||||
|
||||
lengthcol = textures[texnum]->height;
|
||||
|
||||
|
@ -564,7 +563,9 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
left_bottom += bottom_step;
|
||||
}
|
||||
|
||||
sprtopscreen = centeryfrac - FixedMul(texture_top, spryscale);
|
||||
// NB: sprtopscreen needs to start where dc_texturemid does, so that R_DrawMaskedColumn works correctly.
|
||||
// windowtop however is set so that the column gets clipped properly.
|
||||
sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale);
|
||||
realbot = centeryfrac - FixedMul(texture_bottom, spryscale);
|
||||
|
||||
if (do_overlay_column)
|
||||
|
@ -573,7 +574,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
// set wall bounds if necessary
|
||||
if (dc_numlights || clipmidtex)
|
||||
{
|
||||
windowtop = sprtopscreen;
|
||||
windowtop = centeryfrac - FixedMul(texture_top, spryscale);
|
||||
windowbottom = realbot;
|
||||
}
|
||||
|
||||
|
@ -710,14 +711,13 @@ static void R_RenderExtraTexture(unsigned which, INT32 x1, INT32 x2, INT32 repea
|
|||
rw_scalestep = scalestep;
|
||||
spryscale = scale1 + (x1 - ds->x1)*rw_scalestep;
|
||||
|
||||
// Texture must be cached before setting colfunc_2s,
|
||||
// otherwise texture[texnum]->holes may be false when it shouldn't be
|
||||
// Texture must be cached
|
||||
R_CheckTextureCache(texnum);
|
||||
|
||||
if (vertflip) // vertically flipped?
|
||||
colfunc_2s = R_DrawFlippedMaskedColumn;
|
||||
else
|
||||
colfunc_2s = R_DrawMaskedColumn; // render the usual 2sided single-patch packed texture
|
||||
colfunc_2s = R_DrawMaskedColumn;
|
||||
|
||||
lengthcol = textures[texnum]->height;
|
||||
|
||||
|
|
Loading…
Reference in a new issue