Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
  • 1392-2-2-15-attempting-to-draw-a-hud-graphic-with-the-same-lump-name-as-a-lua-script-crashes-the
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results
Show changes
Commits on Source (3)
===============================================================================
Universal Doom Map Format Sonic Robo Blast 2 extensions v1.0 19.02.2024
Universal Doom Map Format Sonic Robo Blast 2 extensions v1.1 03.05.2024
Copyright (c) 2024 Sonic Team Junior
uses Universal Doom Map Format Specification v1.1 as a template,
......@@ -80,6 +80,7 @@ Sonic Robo Blast 2 defines the following standardized fields:
noskew = <bool>; // Middle texture is not skewed.
midpeg = <bool>; // Middle texture is pegged.
midsolid = <bool>; // Middle texture is solid.
clipmidtex = <bool>; // Line's mid textures are clipped to floor and ceiling.
wrapmidtex = <bool>; // Line's mid textures are wrapped.
nonet = <bool>; // Special only takes effect in singleplayer games.
netonly = <bool>; // Special only takes effect in multiplayer games.
......@@ -143,6 +144,8 @@ Sonic Robo Blast 2 defines the following standardized fields:
offsetx_bottom = <float>; // X offset for lower texture. Default = 0.0.
offsety_bottom = <float>; // Y offset for lower texture. Default = 0.0.
clipmidtex = <bool>; // Side's mid textures are clipped to floor and ceiling.
comment = <string>; // A comment. Implementors should attach no special
// semantic meaning to this field.
}
......@@ -305,6 +308,9 @@ Sonic Robo Blast 2 defines the following standardized fields:
Changelog
=======================================
1.1: 03.05.2024
Added clipmidtex property to lines and sides.
1.0: 19.02.2024
Initial version.
......
......@@ -4540,6 +4540,7 @@ const char *const ML_LIST[] = {
"EFFECT6",
"BOUNCY",
"TFERLINE",
"CLIPMIDTEX",
NULL
};
......
......@@ -103,48 +103,53 @@ typedef struct
// LineDef attributes.
//
// Solid, is an obstacle.
#define ML_IMPASSIBLE 1
enum
{
// Solid, is an obstacle.
ML_IMPASSIBLE = 1<<0,
// Blocks monsters only.
#define ML_BLOCKMONSTERS 2
// Blocks monsters only.
ML_BLOCKMONSTERS = 1<<1,
// Backside will not be present at all if not two sided.
#define ML_TWOSIDED 4
// Backside will not be present at all if not two sided.
ML_TWOSIDED = 1<<2,
// If a texture is pegged, the texture will have
// the end exposed to air held constant at the
// top or bottom of the texture (stairs or pulled
// down things) and will move with a height change
// of one of the neighbor sectors.
// Unpegged textures allways have the first row of
// the texture at the top pixel of the line for both
// top and bottom textures (use next to windows).
// If a texture is pegged, the texture will have
// the end exposed to air held constant at the
// top or bottom of the texture (stairs or pulled
// down things) and will move with a height change
// of one of the neighbor sectors.
// Unpegged textures allways have the first row of
// the texture at the top pixel of the line for both
// top and bottom textures (use next to windows).
// upper texture unpegged
#define ML_DONTPEGTOP 8
// upper texture unpegged
ML_DONTPEGTOP = 1<<3,
// lower texture unpegged
#define ML_DONTPEGBOTTOM 16
// lower texture unpegged
ML_DONTPEGBOTTOM = 1<<4,
#define ML_SKEWTD 32
ML_SKEWTD = 1<<5,
// Don't let Knuckles climb on this line
#define ML_NOCLIMB 64
// Don't let Knuckles climb on this line
ML_NOCLIMB = 1<<6,
#define ML_NOSKEW 128
#define ML_MIDPEG 256
#define ML_MIDSOLID 512
#define ML_WRAPMIDTEX 1024
ML_NOSKEW = 1<<7,
ML_MIDPEG = 1<<8,
ML_MIDSOLID = 1<<9,
ML_WRAPMIDTEX = 1<<10,
#define ML_NETONLY 2048 // Apply effect only in netgames
#define ML_NONET 4096 // Apply effect only in single player games
#define ML_EFFECT6 8192
ML_NETONLY = 1<<11, // Apply effect only in netgames
ML_NONET = 1<<12, // Apply effect only in single player games
ML_EFFECT6 = 1<<13,
// Bounce off walls!
#define ML_BOUNCY 16384
// Bounce off walls!
ML_BOUNCY = 1<<14,
#define ML_TFERLINE 32768
ML_TFERLINE = 1<<15,
ML_CLIPMIDTEX = 1<<16
};
// Sector definition, from editing.
typedef struct
......
......@@ -1023,7 +1023,7 @@ static void HWR_RenderMidtexture(INT32 gl_midtexture, float cliplow, float cliph
}
// The cut-off values of a linedef can always be constant, since every line has an absoulute front and or back sector
if (gl_curline->polyseg)
if (gl_curline->polyseg && ((gl_linedef->flags & ML_CLIPMIDTEX) || (gl_sidedef->flags & SIDEFLAG_CLIP_MIDTEX)) == 0)
{
lowcut = polybottom;
highcut = polytop;
......
......@@ -213,6 +213,7 @@ enum side_e {
side_sector,
side_special,
side_repeatcnt,
side_clipmidtex,
side_text
};
......@@ -241,6 +242,7 @@ static const char *const side_opt[] = {
"sector",
"special",
"repeatcnt",
"clipmidtex",
"text",
NULL};
......@@ -1311,6 +1313,9 @@ static int side_get(lua_State *L)
case side_repeatcnt:
lua_pushinteger(L, side->repeatcnt);
return 1;
case side_clipmidtex:
lua_pushinteger(L, side->flags & SIDEFLAG_CLIP_MIDTEX);
return 1;
// TODO: 2.3: Delete
case side_text:
{
......@@ -1413,6 +1418,12 @@ static int side_set(lua_State *L)
case side_repeatcnt:
side->repeatcnt = luaL_checkinteger(L, 3);
break;
case side_clipmidtex:
if (luaL_checkboolean(L, 3))
side->flags |= SIDEFLAG_CLIP_MIDTEX;
else
side->flags &= ~SIDEFLAG_CLIP_MIDTEX;
break;
}
return 0;
}
......
......@@ -1393,6 +1393,8 @@ static UINT32 GetSideDiff(const side_t *si, const side_t *spawnsi)
diff |= LD_SDBOTSCALEY;
if (si->repeatcnt != spawnsi->repeatcnt)
diff |= LD_SDREPEATCNT;
if (si->flags != spawnsi->flags)
diff |= LD_SDFLAGS;
return diff;
}
......@@ -1436,6 +1438,8 @@ static void ArchiveSide(const side_t *si, UINT32 diff)
WRITEFIXED(save_p, si->scaley_bottom);
if (diff & LD_SDREPEATCNT)
WRITEINT16(save_p, si->repeatcnt);
if (diff & LD_SDFLAGS)
WRITEUINT16(save_p, si->flags);
}
static void ArchiveLines(void)
......@@ -1493,7 +1497,7 @@ static void ArchiveLines(void)
if (diff & LD_DIFF2)
WRITEUINT8(save_p, diff2);
if (diff & LD_FLAG)
WRITEINT16(save_p, li->flags);
WRITEUINT32(save_p, li->flags);
if (diff & LD_SPECIAL)
WRITEINT16(save_p, li->special);
if (diff & LD_CLLCOUNT)
......@@ -1576,6 +1580,8 @@ static void UnArchiveSide(side_t *si)
si->scaley_bottom = READFIXED(save_p);
if (diff & LD_SDREPEATCNT)
si->repeatcnt = READINT16(save_p);
if (diff & LD_SDFLAGS)
si->flags = READUINT16(save_p);
}
static void UnArchiveLines(void)
......@@ -1601,7 +1607,7 @@ static void UnArchiveLines(void)
li = &lines[i];
if (diff & LD_FLAG)
li->flags = READINT16(save_p);
li->flags = READUINT32(save_p);
if (diff & LD_SPECIAL)
li->special = READINT16(save_p);
if (diff & LD_CLLCOUNT)
......
......@@ -1363,6 +1363,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_SetSidedefSector(i, (UINT16)SHORT(msd->sector));
// Special info stored in texture fields!
......@@ -1943,6 +1945,8 @@ static void ParseTextmapSidedefParameter(UINT32 i, const char *param, const char
P_SetSidedefSector(i, atol(val));
else if (fastcmp(param, "repeatcnt"))
sides[i].repeatcnt = atol(val);
else if (fastcmp(param, "clipmidtex") && fastcmp("true", val))
sides[i].flags |= SIDEFLAG_CLIP_MIDTEX;
}
static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char *val)
......@@ -2025,10 +2029,10 @@ static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char
lines[i].flags |= ML_MIDPEG;
else if (fastcmp(param, "midsolid") && fastcmp("true", val))
lines[i].flags |= ML_MIDSOLID;
else if (fastcmp(param, "clipmidtex") && fastcmp("true", val))
lines[i].flags |= ML_CLIPMIDTEX;
else if (fastcmp(param, "wrapmidtex") && fastcmp("true", val))
lines[i].flags |= ML_WRAPMIDTEX;
/*else if (fastcmp(param, "effect6") && fastcmp("true", val))
lines[i].flags |= ML_EFFECT6;*/
else if (fastcmp(param, "nonet") && fastcmp("true", val))
lines[i].flags |= ML_NONET;
else if (fastcmp(param, "netonly") && fastcmp("true", val))
......@@ -2615,6 +2619,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)
......@@ -2670,6 +2676,8 @@ static void P_WriteTextmap(void)
fprintf(f, "texturemiddle = \"%.*s\";\n", 8, textures[wsides[i].midtexture]->name);
if (wsides[i].repeatcnt != 0)
fprintf(f, "repeatcnt = %d;\n", wsides[i].repeatcnt);
if (wsides[i].flags & SIDEFLAG_CLIP_MIDTEX)
fprintf(f, "clipmidtex = true;\n");
fprintf(f, "}\n");
fprintf(f, "\n");
}
......@@ -3072,6 +3080,7 @@ static void P_LoadTextmap(void)
sd->bottomtexture = R_TextureNumForName("-");
sd->sector = NULL;
sd->repeatcnt = 0;
sd->flags = 0;
TextmapParse(sidesPos[i], i, ParseTextmapSidedefParameter);
......
......@@ -584,7 +584,7 @@ typedef struct line_s
angle_t angle; // Precalculated angle between dx and dy
// Animation related.
INT16 flags;
UINT32 flags;
INT16 special;
taglist_t tags;
INT32 args[NUMLINEARGS];
......@@ -614,6 +614,12 @@ typedef struct line_s
UINT32 secportal; // transferred sector portal
} line_t;
// Don't make available to Lua or I will find where you live
typedef enum
{
SIDEFLAG_CLIP_MIDTEX = 1 << 0, // Like the line counterpart, but only for this side.
} sideflags_t;
typedef struct
{
// add this to the calculated texture column
......@@ -622,13 +628,16 @@ typedef struct
// add this to the calculated texture top
fixed_t rowoffset;
// per-texture offsets for UDMF
// per-texture offsets
fixed_t offsetx_top, offsetx_mid, offsetx_bottom;
fixed_t offsety_top, offsety_mid, offsety_bottom;
fixed_t scalex_top, scalex_mid, scalex_bottom;
fixed_t scaley_top, scaley_mid, scaley_bottom;
// Rendering-related flags
UINT16 flags;
// Texture indices.
// We do not maintain names here.
INT32 toptexture, bottomtexture, midtexture;
......
......@@ -114,6 +114,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
fixed_t wall_scaley;
fixed_t scalestep;
fixed_t scale1;
fixed_t texture_top, texture_bottom, texture_height;
boolean clipmidtex;
// Calculate light table.
// Use different light tables
......@@ -276,12 +278,17 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
else
back = backsector;
clipmidtex = (ldef->flags & ML_CLIPMIDTEX) || (sidedef->flags & SIDEFLAG_CLIP_MIDTEX);
texture_height = textureheight[texnum];
if (sidedef->repeatcnt)
repeats = 1 + sidedef->repeatcnt;
else if (ldef->flags & ML_WRAPMIDTEX)
{
fixed_t high, low;
height = FixedDiv(texture_height, wall_scaley);
if (front->ceilingheight > back->ceilingheight)
high = back->ceilingheight;
else
......@@ -292,8 +299,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
else
low = back->floorheight;
repeats = (high - low)/textureheight[texnum];
if ((high-low)%textureheight[texnum])
repeats = (high - low)/height;
if ((high-low)%height)
repeats++; // tile an extra time to fill the gap -- Monster Iestyn
}
else
......@@ -301,6 +308,33 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
for (times = 0; times < repeats; times++)
{
fixed_t left_top = 0, left_bottom = 0;
fixed_t right_top = 0, right_bottom = 0;
fixed_t top_step = 0, bottom_step = 0;
// Get left and right ends of wall for clipping it
if (clipmidtex)
{
// For this to work correctly with polyobjects, it needs to use its own back sector, rather than the seg's front sector
sector_t *sec_front = curline->polyseg ?
curline->polyseg->lines[0]->backsector :
frontsector;
// calculate both left ends
left_top = P_GetSectorCeilingZAt(sec_front, ds->leftpos.x, ds->leftpos.y) - viewz;
left_bottom = P_GetSectorFloorZAt(sec_front, ds->leftpos.x, ds->leftpos.y) - viewz;
// calculate right ends now
right_top = P_GetSectorCeilingZAt(sec_front, ds->rightpos.x, ds->rightpos.y) - viewz;
right_bottom = P_GetSectorFloorZAt(sec_front, ds->rightpos.x, ds->rightpos.y) - viewz;
top_step = (right_top - left_top) / range;
bottom_step = (right_bottom - left_bottom) / range;
left_top += top_step * (x1 - ds->x1);
left_bottom += bottom_step * (x1 - ds->x1);
}
if (times > 0)
{
rw_scalestep = scalestep;
......@@ -314,17 +348,17 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
}
}
dc_texheight = textureheight[texnum]>>FRACBITS;
dc_texheight = texture_height>>FRACBITS;
// draw the columns
for (dc_x = x1; dc_x <= x2; dc_x++)
{
dc_texturemid = ds->maskedtextureheight[dc_x];
if (curline->linedef->flags & ML_MIDPEG)
dc_texturemid += (textureheight[texnum])*times + textureheight[texnum];
if (ldef->flags & ML_MIDPEG)
dc_texturemid += texture_height*times + texture_height;
else
dc_texturemid -= (textureheight[texnum])*times;
dc_texturemid -= texture_height*times;
// Check for overflows first
overflow_test = (INT64)centeryfrac - (((INT64)dc_texturemid*spryscale)>>FRACBITS);
......@@ -341,29 +375,53 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
}
}
spryscale += rw_scalestep;
if (clipmidtex)
{
left_top += top_step;
left_bottom += bottom_step;
}
continue;
}
// calculate lighting
if (dc_numlights)
texture_top = dc_texturemid;
texture_bottom = texture_top - texture_height;
// If the texture is meant to be clipped
if (clipmidtex)
{
lighttable_t **xwalllights;
texture_top = min(FixedMul(left_top, wall_scaley), texture_top);
texture_bottom = max(FixedMul(left_bottom, wall_scaley), texture_bottom);
sprtopscreen = windowtop = (centeryfrac - FixedMul(dc_texturemid, spryscale));
left_top += top_step;
left_bottom += bottom_step;
}
realbot = FixedMul(textureheight[texnum], spryscale) + sprtopscreen;
dc_iscale = FixedMul(ds->invscale[dc_x], wall_scaley);
// 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);
// set wall bounds if necessary
if (dc_numlights || clipmidtex)
{
windowtop = centeryfrac - FixedMul(texture_top, spryscale);
windowbottom = realbot;
}
// draw the texture
col = R_GetColumn(texnum, maskedtexturecol[dc_x] >> FRACBITS);
dc_iscale = FixedMul(ds->invscale[dc_x], wall_scaley);
col = R_GetColumn(texnum, maskedtexturecol[dc_x] >> FRACBITS);
// draw light list if there is one
if (dc_numlights)
{
for (i = 0; i < dc_numlights; i++)
{
lighttable_t **xwalllights;
rlight = &dc_lightlist[i];
if ((rlight->flags & FOF_NOSHADE))
if (rlight->flags & FOF_NOSHADE)
continue;
if (rlight->lightnum < 0)
......@@ -373,7 +431,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
else
xwalllights = scalelight[rlight->lightnum];
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
pindex = FixedMul(FixedMul(spryscale, wall_scaley), LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE - 1;
......@@ -418,7 +476,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
}
// calculate lighting
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
pindex = FixedMul(FixedMul(spryscale, wall_scaley), LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE - 1;
......@@ -428,11 +486,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (frontsector->extra_colormap)
dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale);
dc_iscale = FixedMul(ds->invscale[dc_x], wall_scaley);
// draw the texture
col = R_GetColumn(texnum, maskedtexturecol[dc_x] >> FRACBITS);
colfunc_2s(col, lengthcol);
spryscale += rw_scalestep;
......