Skip to content
Snippets Groups Projects
Commit 341139ea authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Scale the vertical offsets

parent 6e4eb629
No related branches found
No related tags found
No related merge requests found
...@@ -500,8 +500,11 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) ...@@ -500,8 +500,11 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
INT32 texnum = R_GetTextureNum(side->midtexture); // make sure the texture is actually valid INT32 texnum = R_GetTextureNum(side->midtexture); // make sure the texture is actually valid
if (texnum) { if (texnum) {
fixed_t scaley = abs(side->scaley_mid);
fixed_t offsetvalue = FixedDiv(side->rowoffset + side->offsety_mid, scaley);
// Get the midtexture's height // Get the midtexture's height
texheight = FixedDiv(textureheight[texnum], abs(side->scaley_mid)); texheight = FixedDiv(textureheight[texnum], scaley);
// Set texbottom and textop to the Z coordinates of the texture's boundaries // Set texbottom and textop to the Z coordinates of the texture's boundaries
#if 0 #if 0
...@@ -509,26 +512,26 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) ...@@ -509,26 +512,26 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
// on non-solid polyobjects should NEVER happen in the future // on non-solid polyobjects should NEVER happen in the future
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) { if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
if (linedef->flags & ML_WRAPMIDTEX && !side->repeatcnt) { // "infinite" repeat if (linedef->flags & ML_WRAPMIDTEX && !side->repeatcnt) { // "infinite" repeat
texbottom = back->floorheight + side->rowoffset + side->offsety_mid; texbottom = back->floorheight + offsetvalue;
textop = back->ceilingheight + side->rowoffset + side->offsety_mid; textop = back->ceilingheight + offsetvalue;
} else if (linedef->flags & ML_MIDTEX) { } else if (linedef->flags & ML_MIDTEX) {
texbottom = back->floorheight + side->rowoffset + side->offsety_mid; texbottom = back->floorheight + offsetvalue;
textop = texbottom + texheight*(side->repeatcnt+1); textop = texbottom + texheight*(side->repeatcnt+1);
} else { } else {
textop = back->ceilingheight + side->rowoffset + side->offsety_mid; textop = back->ceilingheight + offsetvalue;
texbottom = textop - texheight*(side->repeatcnt+1); texbottom = textop - texheight*(side->repeatcnt+1);
} }
} else } else
#endif #endif
{ {
if (linedef->flags & ML_WRAPMIDTEX && !side->repeatcnt) { // "infinite" repeat if (linedef->flags & ML_WRAPMIDTEX && !side->repeatcnt) { // "infinite" repeat
texbottom = openbottom + side->rowoffset + side->offsety_mid; texbottom = openbottom + offsetvalue;
textop = opentop + side->rowoffset + side->offsety_mid; textop = opentop + offsetvalue;
} else if (linedef->flags & ML_MIDPEG) { } else if (linedef->flags & ML_MIDPEG) {
texbottom = openbottom + side->rowoffset + side->offsety_mid; texbottom = openbottom + offsetvalue;
textop = texbottom + texheight*(side->repeatcnt+1); textop = texbottom + texheight*(side->repeatcnt+1);
} else { } else {
textop = opentop + side->rowoffset + side->offsety_mid; textop = opentop + offsetvalue;
texbottom = textop - texheight*(side->repeatcnt+1); texbottom = textop - texheight*(side->repeatcnt+1);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment