diff --git a/src/hwrenderer/data/flatvertices.cpp b/src/hwrenderer/data/flatvertices.cpp index cfa929d31..0fba9a50f 100644 --- a/src/hwrenderer/data/flatvertices.cpp +++ b/src/hwrenderer/data/flatvertices.cpp @@ -118,120 +118,6 @@ static F3DFloor *Find3DFloor(sector_t *target, sector_t *model) // //========================================================================== -int FFlatVertexGenerator::CreateSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor) -{ - int idx = vbo_shadowdata.Reserve(sub->numlines); - for(unsigned int k=0; knumlines; k++, idx++) - { - vbo_shadowdata[idx].SetFlatVertex(sub->firstline[k].v1, plane); - if (sub->sector->transdoor && floor) vbo_shadowdata[idx].z -= 1.f; - } - return idx; -} - -//========================================================================== -// -// Creates the vertices for one plane in one subsector -// -//========================================================================== - -int FFlatVertexGenerator::CreateSectorVertices(sector_t *sec, const secplane_t &plane, int floor) -{ - int rt = vbo_shadowdata.Size(); - // First calculate the vertices for the sector itself - for(int j=0; jsubsectorcount; j++) - { - subsector_t *sub = sec->subsectors[j]; - CreateSubsectorVertices(sub, plane, floor); - } - return rt; -} - -//========================================================================== -// -// -// -//========================================================================== - -int FFlatVertexGenerator::CreateVertices(int h, sector_t *sec, const secplane_t &plane, int floor) -{ - // First calculate the vertices for the sector itself - sec->vboheight[h] = sec->GetPlaneTexZ(h); - sec->vboindex[h] = CreateSectorVertices(sec, plane, floor); - - // Next are all sectors using this one as heightsec - TArray &fakes = sec->e->FakeFloor.Sectors; - for (unsigned g=0; gvboindex[2+h] = CreateSectorVertices(fsec, plane, false); - } - - // and finally all attached 3D floors - TArray &xf = sec->e->XFloor.attached; - for (unsigned g=0; gflags & FF_RENDERPLANES) - { - bool dotop = (ffloor->top.model == sec) && (ffloor->top.isceiling == h); - bool dobottom = (ffloor->bottom.model == sec) && (ffloor->bottom.isceiling == h); - - if (dotop || dobottom) - { - auto ndx = CreateSectorVertices(fsec, plane, false); - if (dotop) ffloor->top.vindex = ndx; - if (dobottom) ffloor->bottom.vindex = ndx; - } - } - } - sec->vbocount[h] = vbo_shadowdata.Size() - sec->vboindex[h]; - return sec->vboindex[h]; -} - - -//========================================================================== -// -// -// -//========================================================================== - -void FFlatVertexGenerator::CreateFlatVertices() -{ - for (int h = sector_t::floor; h <= sector_t::ceiling; h++) - { - for(auto &sec : level.sectors) - { - CreateVertices(h, &sec, sec.GetSecPlane(h), h == sector_t::floor); - } - } - - // We need to do a final check for Vavoom water and FF_FIX sectors. - // No new vertices are needed here. The planes come from the actual sector - for (auto &sec : level.sectors) - { - for(auto ff : sec.e->XFloor.ffloors) - { - if (ff->top.model == &sec) - { - ff->top.vindex = sec.vboindex[ff->top.isceiling]; - } - if (ff->bottom.model == &sec) - { - ff->bottom.vindex = sec.vboindex[ff->top.isceiling]; - } - } - } -} - -//========================================================================== -// -// Creates the vertices for one plane in one subsector -// -//========================================================================== - int FFlatVertexGenerator::CreateIndexedSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor, int vi, FFlatVertexGenerator::FIndexGenerationInfo &gen) { if (sub->numlines < 3) return -1; diff --git a/src/hwrenderer/data/flatvertices.h b/src/hwrenderer/data/flatvertices.h index 2f0b1d5f4..9f4661261 100644 --- a/src/hwrenderer/data/flatvertices.h +++ b/src/hwrenderer/data/flatvertices.h @@ -88,11 +88,6 @@ public: void OutputResized(int width, int height); private: - int CreateSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor); - int CreateSectorVertices(sector_t *sec, const secplane_t &plane, int floor); - int CreateVertices(int h, sector_t *sec, const secplane_t &plane, int floor); - void CreateFlatVertices(); - int CreateIndexedSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor, int vi, FIndexGenerationInfo &gen); int CreateIndexedSectorVertices(sector_t *sec, const secplane_t &plane, int floor, FIndexGenerationInfo &gen); int CreateIndexedVertices(int h, sector_t *sec, const secplane_t &plane, int floor, TArray &gen);