- refactored the global sectors array into a more VM friendly type and moved it into FLevelLocals.
This commit is contained in:
parent
d381fb5e3f
commit
c02281a439
57 changed files with 438 additions and 456 deletions
|
|
@ -321,7 +321,7 @@ public:
|
|||
if (tag < 0)
|
||||
{
|
||||
searchtag = INT_MIN;
|
||||
start = tag == -32768? 0 : -tag < numsectors? -tag : -1;
|
||||
start = tag == -32768? 0 : -tag < (int)level.sectors.Size()? -tag : -1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -1531,7 +1531,7 @@ void FParser::SF_StartSectorSound(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
sector = §ors[i];
|
||||
sector = &level.sectors[i];
|
||||
S_Sound(sector, CHAN_BODY, T_FindSound(stringvalue(t_argv[1])), 1.0f, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
|
|
@ -1568,13 +1568,14 @@ void FParser::SF_FloorHeight(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
if (sectors[i].floordata) continue; // don't move floors that are active!
|
||||
auto &sec = level.sectors[i];
|
||||
if (sec.floordata) continue; // don't move floors that are active!
|
||||
|
||||
if (sectors[i].MoveFloor(
|
||||
fabs(dest - sectors[i].CenterFloor()),
|
||||
sectors[i].floorplane.PointToDist (sectors[i].centerspot, dest),
|
||||
if (sec.MoveFloor(
|
||||
fabs(dest - sec.CenterFloor()),
|
||||
sec.floorplane.PointToDist (sec.centerspot, dest),
|
||||
crush? 10:-1,
|
||||
(dest > sectors[i].CenterFloor()) ? 1 : -1,
|
||||
(dest > sec.CenterFloor()) ? 1 : -1,
|
||||
false) == EMoveResult::crushed)
|
||||
{
|
||||
returnval = 0;
|
||||
|
|
@ -1589,7 +1590,7 @@ void FParser::SF_FloorHeight(void)
|
|||
script_error("sector not found with tagnum %i\n", tagnum);
|
||||
return;
|
||||
}
|
||||
returnval = sectors[secnum].CenterFloor();
|
||||
returnval = level.sectors[secnum].CenterFloor();
|
||||
}
|
||||
|
||||
// return floor height
|
||||
|
|
@ -1622,7 +1623,7 @@ void FParser::SF_MoveFloor(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((secnum = itr.Next()) >= 0)
|
||||
{
|
||||
P_CreateFloor(§ors[secnum], DFloor::floorMoveToValue, NULL, platspeed, destheight, crush, 0, false, false);
|
||||
P_CreateFloor(&level.sectors[secnum], DFloor::floorMoveToValue, NULL, platspeed, destheight, crush, 0, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1657,13 +1658,14 @@ void FParser::SF_CeilingHeight(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
if (sectors[i].ceilingdata) continue; // don't move ceilings that are active!
|
||||
auto &sec = level.sectors[i];
|
||||
if (sec.ceilingdata) continue; // don't move ceilings that are active!
|
||||
|
||||
if (sectors[i].MoveCeiling(
|
||||
fabs(dest - sectors[i].CenterCeiling()),
|
||||
sectors[i].ceilingplane.PointToDist (sectors[i].centerspot, dest),
|
||||
if (sec.MoveCeiling(
|
||||
fabs(dest - sec.CenterCeiling()),
|
||||
sec.ceilingplane.PointToDist (sec.centerspot, dest),
|
||||
crush? 10:-1,
|
||||
(dest > sectors[i].CenterCeiling()) ? 1 : -1,
|
||||
(dest > sec.CenterCeiling()) ? 1 : -1,
|
||||
false) == EMoveResult::crushed)
|
||||
{
|
||||
returnval = 0;
|
||||
|
|
@ -1678,7 +1680,7 @@ void FParser::SF_CeilingHeight(void)
|
|||
script_error("sector not found with tagnum %i\n", tagnum);
|
||||
return;
|
||||
}
|
||||
returnval = sectors[secnum].CenterCeiling();
|
||||
returnval = level.sectors[secnum].CenterCeiling();
|
||||
}
|
||||
|
||||
// return ceiling height
|
||||
|
|
@ -1713,7 +1715,7 @@ void FParser::SF_MoveCeiling(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((secnum = itr.Next()) >= 0)
|
||||
{
|
||||
P_CreateCeiling(§ors[secnum], DCeiling::ceilMoveToValue, NULL, tagnum, platspeed, platspeed, destheight, crush, silent | 4, 0, DCeiling::ECrushMode::crushDoom);
|
||||
P_CreateCeiling(&level.sectors[secnum], DCeiling::ceilMoveToValue, NULL, tagnum, platspeed, platspeed, destheight, crush, silent | 4, 0, DCeiling::ECrushMode::crushDoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1742,7 +1744,7 @@ void FParser::SF_LightLevel(void)
|
|||
return;
|
||||
}
|
||||
|
||||
sector = §ors[secnum];
|
||||
sector = &level.sectors[secnum];
|
||||
|
||||
if(t_argc > 1) // > 1: set light level
|
||||
{
|
||||
|
|
@ -1752,7 +1754,7 @@ void FParser::SF_LightLevel(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
sectors[i].SetLightLevel(intvalue(t_argv[1]));
|
||||
level.sectors[i].SetLightLevel(intvalue(t_argv[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1870,7 +1872,7 @@ void FParser::SF_FadeLight(void)
|
|||
FSectorTagIterator it(sectag);
|
||||
while ((i = it.Next()) >= 0)
|
||||
{
|
||||
if (!sectors[i].lightingdata) new DLightLevel(§ors[i],destlevel,speed);
|
||||
if (!level.sectors[i].lightingdata) new DLightLevel(&level.sectors[i],destlevel,speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1895,7 +1897,7 @@ void FParser::SF_FloorTexture(void)
|
|||
if(secnum < 0)
|
||||
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
||||
|
||||
sector = §ors[secnum];
|
||||
sector = &level.sectors[secnum];
|
||||
|
||||
if(t_argc > 1)
|
||||
{
|
||||
|
|
@ -1906,7 +1908,7 @@ void FParser::SF_FloorTexture(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
sectors[i].SetTexture(sector_t::floor, picnum);
|
||||
level.sectors[i].SetTexture(sector_t::floor, picnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1947,7 +1949,7 @@ void FParser::SF_SectorColormap(void)
|
|||
if(secnum < 0)
|
||||
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
||||
|
||||
sector = §ors[secnum];
|
||||
sector = &level.sectors[secnum];
|
||||
|
||||
if (t_argv[1].type==svt_string)
|
||||
{
|
||||
|
|
@ -1957,7 +1959,7 @@ void FParser::SF_SectorColormap(void)
|
|||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
sectors[i].midmap=cm;
|
||||
sectors[i].heightsec=§ors[i];
|
||||
sectors[i].heightsec=&level.sectors[i];
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
@ -1985,7 +1987,7 @@ void FParser::SF_CeilingTexture(void)
|
|||
if(secnum < 0)
|
||||
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
||||
|
||||
sector = §ors[secnum];
|
||||
sector = &level.sectors[secnum];
|
||||
|
||||
if(t_argc > 1)
|
||||
{
|
||||
|
|
@ -1996,7 +1998,7 @@ void FParser::SF_CeilingTexture(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
sectors[i].SetTexture(sector_t::ceiling, picnum);
|
||||
level.sectors[i].SetTexture(sector_t::ceiling, picnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3888,7 +3890,7 @@ void FParser::SF_SetColor(void)
|
|||
FSSectorTagIterator itr(tagnum);
|
||||
while ((i = itr.Next()) >= 0)
|
||||
{
|
||||
sectors[i].ColorMap = GetSpecialLights (color, sectors[i].ColorMap->Fade, 0);
|
||||
level.sectors[i].ColorMap = GetSpecialLights (color, level.sectors[i].ColorMap->Fade, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue