OpenGL Multi-Property FOF's

Multi-Property FOF's have their multiple side properties display in
OpenGL.
This commit is contained in:
Sryder13 2014-04-17 13:02:34 +01:00
parent 5b324924ff
commit 098eb28036

View file

@ -1724,6 +1724,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
ffloor_t * rover; ffloor_t * rover;
fixed_t highcut = 0, lowcut = 0; fixed_t highcut = 0, lowcut = 0;
INT32 texnum;
line_t * newline = NULL; // Multi-Property FOF
highcut = gr_frontsector->ceilingheight < gr_backsector->ceilingheight ? gr_frontsector->ceilingheight : gr_backsector->ceilingheight; highcut = gr_frontsector->ceilingheight < gr_backsector->ceilingheight ? gr_frontsector->ceilingheight : gr_backsector->ceilingheight;
lowcut = gr_frontsector->floorheight > gr_backsector->floorheight ? gr_frontsector->floorheight : gr_backsector->floorheight; lowcut = gr_frontsector->floorheight > gr_backsector->floorheight ? gr_frontsector->floorheight : gr_backsector->floorheight;
@ -1736,6 +1739,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
if (*rover->topheight < lowcut || *rover->bottomheight > highcut) if (*rover->topheight < lowcut || *rover->bottomheight > highcut)
continue; continue;
texnum = texturetranslation[sides[rover->master->sidenum[0]].midtexture];
if (rover->master->flags & ML_TFERLINE)
{
size_t linenum = gr_curline->linedef-gr_backsector->lines[0];
newline = rover->master->frontsector->lines[0] + linenum;
texnum = texturetranslation[sides[newline->sidenum[0]].midtexture];
}
h = *rover->topheight; h = *rover->topheight;
l = *rover->bottomheight; l = *rover->bottomheight;
@ -1757,10 +1768,19 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
} }
else if (drawtextured) else if (drawtextured)
{ {
grTex = HWR_GetTexture(texturetranslation[sides[rover->master->sidenum[0]].midtexture]); grTex = HWR_GetTexture(texnum);
if (newline)
{
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset)) * grTex->scaleY;
}
else
{
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY;
}
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY;
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
} }
@ -1803,11 +1823,11 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
} }
if (gr_frontsector->numlights) if (gr_frontsector->numlights)
HWR_SplitWall(gr_frontsector, wallVerts, texturetranslation[sides[rover->master->sidenum[0]].midtexture], &Surf, rover->flags); HWR_SplitWall(gr_frontsector, wallVerts, texnum, &Surf, rover->flags);
else else
{ {
if (blendmode != PF_Masked) if (blendmode != PF_Masked)
HWR_AddTransparentWall(wallVerts, &Surf, texturetranslation[sides[rover->master->sidenum[0]].midtexture], blendmode, false, lightnum, colormap); HWR_AddTransparentWall(wallVerts, &Surf, texnum, blendmode, false, lightnum, colormap);
else else
HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap); HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap);
} }
@ -1824,6 +1844,15 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
if (*rover->topheight < lowcut || *rover->bottomheight > highcut) if (*rover->topheight < lowcut || *rover->bottomheight > highcut)
continue; continue;
texnum = texturetranslation[sides[rover->master->sidenum[0]].midtexture];
if (rover->master->flags & ML_TFERLINE)
{
size_t linenum = gr_curline->linedef-gr_backsector->lines[0];
newline = rover->master->frontsector->lines[0] + linenum;
texnum = texturetranslation[sides[newline->sidenum[0]].midtexture];
}
h = *rover->topheight; h = *rover->topheight;
l = *rover->bottomheight; l = *rover->bottomheight;
if (h > highcut) if (h > highcut)
@ -1845,10 +1874,19 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
} }
else if (drawtextured) else if (drawtextured)
{ {
grTex = HWR_GetTexture(texturetranslation[sides[rover->master->sidenum[0]].midtexture]); grTex = HWR_GetTexture(texnum);
if (newline)
{
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset)) * grTex->scaleY;
}
else
{
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY;
}
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY;
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
} }
@ -1891,11 +1929,11 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
} }
if (gr_backsector->numlights) if (gr_backsector->numlights)
HWR_SplitWall(gr_backsector, wallVerts, texturetranslation[sides[rover->master->sidenum[0]].midtexture], &Surf, rover->flags); HWR_SplitWall(gr_backsector, wallVerts, texnum, &Surf, rover->flags);
else else
{ {
if (blendmode != PF_Masked) if (blendmode != PF_Masked)
HWR_AddTransparentWall(wallVerts, &Surf, texturetranslation[sides[rover->master->sidenum[0]].midtexture], blendmode, false, lightnum, colormap); HWR_AddTransparentWall(wallVerts, &Surf, texnum, blendmode, false, lightnum, colormap);
else else
HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap); HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap);
} }