diff --git a/src/rendering/hwrenderer/scene/hw_drawlist.cpp b/src/rendering/hwrenderer/scene/hw_drawlist.cpp index 1d729e110..41778065e 100644 --- a/src/rendering/hwrenderer/scene/hw_drawlist.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawlist.cpp @@ -304,8 +304,8 @@ void HWDrawList::SortWallIntoPlane(HWDrawInfo* di, SortNode * head, SortNode * s w->tcs[HWWall::UPLFT].v = ws->tcs[HWWall::LOLFT].v = w->tcs[HWWall::UPRGT].v = ws->tcs[HWWall::LORGT].v = newtexv; w->lightuv[HWWall::UPLFT].v = ws->lightuv[HWWall::LOLFT].v = w->lightuv[HWWall::UPRGT].v = ws->lightuv[HWWall::LORGT].v = newlmv; } - w->MakeVertices(di, false); - ws->MakeVertices(di, false); + w->MakeVertices(di, *screen->RenderState(), false); + ws->MakeVertices(di, *screen->RenderState(), false); } SortNode * sort2 = SortNodes.GetNew(); @@ -451,8 +451,8 @@ void HWDrawList::SortWallIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sor w->zbottom[0]=ws->zbottom[1]=izb; w->tcs[HWWall::LOLFT].u = w->tcs[HWWall::UPLFT].u = ws->tcs[HWWall::LORGT].u = ws->tcs[HWWall::UPRGT].u = iu; w->lightuv[HWWall::LOLFT].u = w->lightuv[HWWall::UPLFT].u = ws->lightuv[HWWall::LORGT].u = ws->lightuv[HWWall::UPRGT].u = iu; - ws->MakeVertices(di, false); - w->MakeVertices(di, false); + ws->MakeVertices(di, *screen->RenderState(), false); + w->MakeVertices(di, *screen->RenderState(), false); SortNode * sort2=SortNodes.GetNew(); memset(sort2,0,sizeof(SortNode)); diff --git a/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp b/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp index 8a862e29a..597cf014d 100644 --- a/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp @@ -81,7 +81,7 @@ void HWDrawInfo::AddMirrorSurface(HWWall *w) auto tcs = newwall->tcs; tcs[HWWall::LOLFT].u = tcs[HWWall::LORGT].u = tcs[HWWall::UPLFT].u = tcs[HWWall::UPRGT].u = v.X; tcs[HWWall::LOLFT].v = tcs[HWWall::LORGT].v = tcs[HWWall::UPLFT].v = tcs[HWWall::UPRGT].v = v.Z; - newwall->MakeVertices(this, false); + newwall->MakeVertices(this, *screen->RenderState(), false); bool hasDecals = newwall->seg->sidedef && newwall->seg->sidedef->AttachedDecals; if (hasDecals && Level->HasDynamicLights && !isFullbrightScene()) diff --git a/src/rendering/hwrenderer/scene/hw_drawstructs.h b/src/rendering/hwrenderer/scene/hw_drawstructs.h index 21de87b44..38f8ec750 100644 --- a/src/rendering/hwrenderer/scene/hw_drawstructs.h +++ b/src/rendering/hwrenderer/scene/hw_drawstructs.h @@ -214,7 +214,7 @@ public: void SetupLights(HWDrawInfo *di, FDynLightData &lightdata); - void MakeVertices(HWDrawInfo *di, bool nosplit); + void MakeVertices(HWDrawInfo *di, FRenderState& state, bool nosplit); void SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowmirror); void SkyLine(HWDrawInfo *di, sector_t *sec, line_t *line); diff --git a/src/rendering/hwrenderer/scene/hw_walls.cpp b/src/rendering/hwrenderer/scene/hw_walls.cpp index 88ed52068..d0bfec9cd 100644 --- a/src/rendering/hwrenderer/scene/hw_walls.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls.cpp @@ -346,7 +346,7 @@ void HWWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent) { SetupLights(di, lightdata); } - MakeVertices(di, !!(flags & HWWall::HWF_TRANSLUCENT)); + MakeVertices(di, state, !!(flags & HWWall::HWF_TRANSLUCENT)); } state.SetNormal(glseg.Normal()); @@ -523,7 +523,7 @@ void HWWall::PutWall(HWDrawInfo *di, bool translucent) { SetupLights(di, lightdata); } - MakeVertices(di, translucent); + MakeVertices(di, *screen->RenderState(), translucent); } @@ -567,7 +567,7 @@ void HWWall::PutPortal(HWDrawInfo *di, int ptype, int plane) { HWPortal * portal = nullptr; - MakeVertices(di, false); + MakeVertices(di, *screen->RenderState(), false); switch (ptype) { // portals don't go into the draw list. diff --git a/src/rendering/hwrenderer/scene/hw_walls_vertex.cpp b/src/rendering/hwrenderer/scene/hw_walls_vertex.cpp index e6cd1896f..c66e11105 100644 --- a/src/rendering/hwrenderer/scene/hw_walls_vertex.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls_vertex.cpp @@ -23,6 +23,7 @@ #include "r_defs.h" #include "flatvertices.h" +#include "hw_renderstate.h" #include "hwrenderer/scene/hw_drawinfo.h" #include "hwrenderer/scene/hw_drawstructs.h" @@ -282,12 +283,12 @@ int HWWall::CountVertices() // //========================================================================== -void HWWall::MakeVertices(HWDrawInfo *di, bool nosplit) +void HWWall::MakeVertices(HWDrawInfo *di, FRenderState& state, bool nosplit) { if (vertcount == 0) { bool split = (gl_seamless && !nosplit && seg->sidedef != nullptr && !(seg->sidedef->Flags & WALLF_POLYOBJ) && !(flags & HWF_NOSPLIT)); - auto ret = screen->mVertexData->AllocVertices(split ? CountVertices() : 4); + auto ret = state.AllocVertices(split ? CountVertices() : 4); vertindex = ret.second; vertcount = CreateVertices(ret.first, split); }