mirror of
https://github.com/ZDoom/ZDRay.git
synced 2025-02-03 13:11:04 +00:00
- link the 3d floors to their sectors and mark the control sectors
This commit is contained in:
parent
2bdf48bbcc
commit
8bea68f6af
3 changed files with 47 additions and 1 deletions
|
@ -108,6 +108,9 @@ struct IntSector
|
|||
kexPlane ceilingplane;
|
||||
kexPlane floorplane;
|
||||
|
||||
bool controlsector;
|
||||
TArray<IntSector*> x3dfloors;
|
||||
|
||||
TArray<UDMFKey> props;
|
||||
};
|
||||
|
||||
|
|
|
@ -229,10 +229,22 @@ void FProcessor::ParseLinedef(IntLineDef *ld)
|
|||
{
|
||||
ld->args[0] = CheckInt(key);
|
||||
}
|
||||
else if (Extended && !stricmp(key, "id"))
|
||||
else if (Extended && !stricmp(key, "arg1"))
|
||||
{
|
||||
ld->args[1] = CheckInt(key);
|
||||
}
|
||||
else if (Extended && !stricmp(key, "arg2"))
|
||||
{
|
||||
ld->args[2] = CheckInt(key);
|
||||
}
|
||||
else if (Extended && !stricmp(key, "arg3"))
|
||||
{
|
||||
ld->args[3] = CheckInt(key);
|
||||
}
|
||||
else if (Extended && !stricmp(key, "arg4"))
|
||||
{
|
||||
ld->args[4] = CheckInt(key);
|
||||
}
|
||||
else if (!stricmp(key, "blocking") && !stricmp(value, "true"))
|
||||
{
|
||||
ld->flags |= ML_BLOCKING;
|
||||
|
|
|
@ -52,6 +52,9 @@ static void Surface_AllocateFromSeg(FLevel &doomMap, MapSegGLEx *seg)
|
|||
front = doomMap.GetFrontSector(seg);
|
||||
back = doomMap.GetBackSector(seg);
|
||||
|
||||
if (front->controlsector)
|
||||
return;
|
||||
|
||||
FloatVertex v1 = doomMap.GetSegVertex(seg->v1);
|
||||
FloatVertex v2 = doomMap.GetSegVertex(seg->v2);
|
||||
float v1Top = front->ceilingplane.zAt(v1.x, v1.y);
|
||||
|
@ -221,6 +224,9 @@ static void Surface_AllocateFromLeaf(FLevel &doomMap)
|
|||
return;
|
||||
}
|
||||
|
||||
if (sector->controlsector)
|
||||
continue;
|
||||
|
||||
surf = (surface_t*)Mem_Calloc(sizeof(surface_t), hb_static);
|
||||
surf->numVerts = doomMap.ssLeafCount[i];
|
||||
surf->verts = (kexVec3*)Mem_Calloc(sizeof(kexVec3) * surf->numVerts, hb_static);
|
||||
|
@ -304,6 +310,31 @@ void Surface_AllocateFromMap(FLevel &doomMap)
|
|||
doomMap.segSurfaces[1] = (surface_t**)Mem_Calloc(sizeof(surface_t*) * doomMap.NumGLSegs, hb_static);
|
||||
doomMap.segSurfaces[2] = (surface_t**)Mem_Calloc(sizeof(surface_t*) * doomMap.NumGLSegs, hb_static);
|
||||
|
||||
for (unsigned int i = 0; i < doomMap.Sectors.Size(); i++)
|
||||
doomMap.Sectors[i].controlsector = false;
|
||||
|
||||
for (unsigned int i = 0; i < doomMap.Lines.Size(); i++)
|
||||
{
|
||||
const auto &line = doomMap.Lines[i];
|
||||
if (line.special == 160) // Sector_Set3dFloor
|
||||
{
|
||||
int sectorTag = line.args[0];
|
||||
int type = line.args[1];
|
||||
//int opacity = line.args[3];
|
||||
|
||||
IntSector *controlsector = &doomMap.Sectors[doomMap.Sides[doomMap.Lines[i].sidenum[0]].sector];
|
||||
controlsector->controlsector = true;
|
||||
|
||||
for (unsigned int j = 0; j < doomMap.Sectors.Size(); j++)
|
||||
{
|
||||
if (doomMap.Sectors[j].data.tag == sectorTag)
|
||||
{
|
||||
doomMap.Sectors[j].x3dfloors.Push(controlsector);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("------------- Building seg surfaces -------------\n");
|
||||
|
||||
for(int i = 0; i < doomMap.NumGLSegs; i++)
|
||||
|
|
Loading…
Reference in a new issue