refactor: replace AABB::newPermanent with new AABB

This commit is contained in:
orng
2026-03-27 21:17:55 -05:00
parent 79217ca8e3
commit 534879e2e7
11 changed files with 10 additions and 17 deletions
@@ -130,7 +130,7 @@ void ApplySchematicRuleDefinition::updateLocationBox() {
if (m_schematic == NULL)
m_schematic = m_levelGenOptions->getSchematicFile(m_schematicName);
m_locationBox = AABB::newPermanent(0, 0, 0, 0, 0, 0);
m_locationBox = new AABB(0, 0, 0, 0, 0, 0);
m_locationBox->x0 = m_location.x;
m_locationBox->y0 = m_location.y;
@@ -5,7 +5,7 @@
NamedAreaRuleDefinition::NamedAreaRuleDefinition() {
m_name = L"";
m_area = AABB::newPermanent(0, 0, 0, 0, 0, 0);
m_area = new AABB(0, 0, 0, 0, 0, 0);
}
NamedAreaRuleDefinition::~NamedAreaRuleDefinition() { delete m_area; }
@@ -11,8 +11,8 @@ AreaConstraint::AreaConstraint(int descriptionId, double x0, double y0,
bool restrictsMovement /*=true*/)
: TutorialConstraint(descriptionId) {
messageArea =
AABB::newPermanent(x0 + 2, y0 + 2, z0 + 2, x1 - 2, y1 - 2, z1 - 2);
movementArea = AABB::newPermanent(x0, y0, z0, x1, y1, z1);
new AABB(x0 + 2, y0 + 2, z0 + 2, x1 - 2, y1 - 2, z1 - 2);
movementArea = new AABB(x0, y0, z0, x1, y1, z1);
this->contains = contains;
m_restrictsMovement = restrictsMovement;
@@ -12,7 +12,7 @@ AreaHint::AreaHint(eTutorial_Hint id, Tutorial* tutorial,
double x1, double y1, double z1, bool allowFade /*= false*/,
bool contains /*= true*/)
: TutorialHint(id, tutorial, descriptionId, e_Hint_Area, allowFade) {
area = AABB::newPermanent(x0, y0, z0, x1, y1, z1);
area = new AABB(x0, y0, z0, x1, y1, z1);
this->contains = contains;
@@ -16,7 +16,7 @@ ChangeStateConstraint::ChangeStateConstraint(
bool contains /*= true*/, bool changeGameMode /*= false*/,
GameType* targetGameMode /*= 0*/)
: TutorialConstraint(-1) {
movementArea = AABB::newPermanent(x0, y0, z0, x1, y1, z1);
movementArea = new AABB(x0, y0, z0, x1, y1, z1);
this->contains = contains;
+1 -1
View File
@@ -95,7 +95,7 @@ void Chunk::setPos(int x, int y, int z) {
// 4J - changed to just set the value rather than make a new one, if we've
// already created storage
if (bb == NULL) {
bb = AABB::newPermanent(-g, -g, -g, XZSIZE + g, SIZE + g, XZSIZE + g);
bb = new AABB(-g, -g, -g, XZSIZE + g, SIZE + g, XZSIZE + g);
} else {
// 4J MGH - bounds are relative to the position now, so the AABB will be
// setup already, either above, or from the tesselator bounds.
+1 -1
View File
@@ -3901,7 +3901,7 @@ void LevelRenderer::DestroyedTileManager::destroyingTileAt(Level* level, int x,
// Make these temporary AABBs into permanently allocated AABBs
for (unsigned int i = 0; i < recentTile->boxes.size(); i++) {
recentTile->boxes[i] = AABB::newPermanent(
recentTile->boxes[i] = new AABB(
recentTile->boxes[i]->x0, recentTile->boxes[i]->y0,
recentTile->boxes[i]->z0, recentTile->boxes[i]->x1,
recentTile->boxes[i]->y1, recentTile->boxes[i]->z1);