From fc978c79bbcaf36fb17ed73c69d720ebec9c677c Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Fri, 28 Mar 2014 23:28:00 +0000 Subject: [PATCH] OpenGL wall Y offset Fixed wall textures breaking when Y offset of the wall was too high. --- src/hardware/hw_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 91ce389e..8cfa1150 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1420,6 +1420,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) texturevpegtop += gr_sidedef->rowoffset; + // This is so that it doesn't overflow and screw up the wall, it doesn't need to go higher than the texture's height anyway + texturevpegtop %= SHORT(textures[texturetranslation[gr_sidedef->toptexture]]->height)<scaleY; wallVerts[0].t = wallVerts[1].t = (texturevpegtop + worldtop - worldhigh) * grTex->scaleY; wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; @@ -1459,6 +1462,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) texturevpegbottom += gr_sidedef->rowoffset; + // This is so that it doesn't overflow and screw up the wall, it doesn't need to go higher than the texture's height anyway + texturevpegbottom %= SHORT(textures[texturetranslation[gr_sidedef->bottomtexture]]->height)<scaleY; wallVerts[0].t = wallVerts[1].t = (texturevpegbottom + worldlow - worldbottom) * grTex->scaleY; wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;