From 2b5b5ce32687ad7efa6847432d8387a898a7acf3 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Mon, 13 Feb 2023 19:48:39 +0530 Subject: [PATCH] tsstatic things --- src/DtsObject.hx | 2 +- src/MarbleWorld.hx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/DtsObject.hx b/src/DtsObject.hx index f4d778cd..3e753e38 100644 --- a/src/DtsObject.hx +++ b/src/DtsObject.hx @@ -889,7 +889,7 @@ class DtsObject extends GameObject { } } - if (!this.isInstanced) { + if (!this.isInstanced && !this.isTSStatic) { for (i in 0...this.materials.length) { var info = this.materialInfos.get(this.materials[i]); if (info == null) diff --git a/src/MarbleWorld.hx b/src/MarbleWorld.hx index 1c40ed2e..1d11fcee 100644 --- a/src/MarbleWorld.hx +++ b/src/MarbleWorld.hx @@ -795,7 +795,7 @@ class MarbleWorld extends Scheduler { this.addDtsObject(tsShape, () -> { tsShape.setTransform(mat); onFinish(); - }); + }, true); } public function addParticleEmitterNode(element:MissionElementParticleEmitterNode) { @@ -826,12 +826,14 @@ class MarbleWorld extends Scheduler { }); } - public function addDtsObject(obj:DtsObject, onFinish:Void->Void) { + public function addDtsObject(obj:DtsObject, onFinish:Void->Void, isTsStatic:Bool = false) { obj.idInLevel = this.dtsObjects.length; // Set the id of the thing this.dtsObjects.push(obj); if (obj is ForceObject) { this.forceObjects.push(cast obj); } + if (isTsStatic) + obj.useInstancing = false; obj.init(cast this, () -> { obj.update(this.timeState); if (obj.useInstancing) {