- make SectionGeometry create some data.

This commit is contained in:
Christoph Oelckers 2021-12-12 18:07:19 +01:00
parent ca19c265f8
commit 411e3e6f9c
5 changed files with 128 additions and 23 deletions

View file

@ -679,7 +679,7 @@ nexti:;
// calculate the rest.
auto texture = tileGetTexture(plane ? sectorp->ceilingpicnum : sectorp->floorpicnum);
UVCalculator uvcalc(sectorp, plane, texture, offset);
UVCalculator1 uvcalc(sectorp, plane, texture, offset);
entry.texcoords.Resize(entry.vertices.Size());
for (unsigned i = 0; i < entry.vertices.Size(); i++)

View file

@ -98,17 +98,17 @@ void HWFlat::MakeVertices()
bool canvas = texture->isHardwareCanvas();
if (Sprite == nullptr)
{
#if 0
if (section != nullptr)
{
auto mesh = sectionGeometry.get(section, plane, geoofs);
TArray<int>* pIndices;
auto mesh = sectionGeometry.get(section, plane, geoofs, &pIndices);
auto ret = screen->mVertexData->AllocVertices(mesh->indices.Size());
auto ret = screen->mVertexData->AllocVertices(pIndices->Size());
auto vp = ret.first;
float base = (plane == 0 ? sec->floorz : sec->ceilingz) * (1 / -256.f);
for (unsigned i = 0; i < mesh->indices.Size(); i++)
for (unsigned i = 0; i < pIndices->Size(); i++)
{
auto ii = mesh->indicess[i];
auto ii = (*pIndices)[i];
auto& pt = mesh->vertices[ii];
auto& uv = mesh->texcoords[ii];
vp->SetVertex(pt.X, base + pt.Z, pt.Y);
@ -116,10 +116,9 @@ void HWFlat::MakeVertices()
vp++;
}
vertindex = ret.second;
vertcount = mesh->indices.Size();
vertcount = pIndices->Size();
}
else
#endif
{
auto mesh = sectorGeometry.get(oldsection, plane, geoofs);
if (!mesh) return;