updated TSE, and fixed some small bugs
This commit is contained in:
@@ -36,7 +36,6 @@ GravityHolder::GravityHolder(float gravityWell)
|
||||
|
||||
GravityHolder::~GravityHolder()
|
||||
{
|
||||
Transformable::HardDelete(planetMapRing, false);
|
||||
delete mat;
|
||||
delete mesh;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ PlanetRotater::PlanetRotater(float distance)
|
||||
|
||||
PlanetRotater::~PlanetRotater()
|
||||
{
|
||||
Transformable::HardDelete(planetMapRing, false);
|
||||
planetMapRing->SetParent(nullptr);
|
||||
Transformable::HardDelete(planetMapRing, true);
|
||||
delete mat;
|
||||
delete mesh;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Rendering/PlanetShader.hpp"
|
||||
#include "utils/Time.hpp"
|
||||
#include "BehaviourScripts/Camera.hpp"
|
||||
#include "Debug.hpp"
|
||||
|
||||
SpaceController::SpaceController()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Transformable *Asteroid::LoadSpace()
|
||||
{
|
||||
root = new Transformable(name);
|
||||
root = new Transformable(name, id);
|
||||
|
||||
Transformable* planet = create();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
Transformable *Galaxy::LoadSpace()
|
||||
{
|
||||
root = new Transformable(name);
|
||||
root = new Transformable(name, id);
|
||||
|
||||
for (auto &&system : systems)
|
||||
{
|
||||
@@ -22,8 +22,6 @@ Transformable *Galaxy::LoadSpace()
|
||||
// position;
|
||||
}
|
||||
|
||||
root->id = id;
|
||||
|
||||
float grvityWell = GetMaxDistObj();
|
||||
|
||||
GravityHolder* holder = new GravityHolder(grvityWell + 4.0f);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Transformable *Moon::LoadSpace()
|
||||
{
|
||||
root = new Transformable(name);
|
||||
root = new Transformable(name, id);
|
||||
|
||||
Transformable* planet = create();
|
||||
|
||||
@@ -148,7 +148,7 @@ void Moon::DeleteResources()
|
||||
delete planetMesh;
|
||||
delete landMat;
|
||||
delete planetMat;
|
||||
Transformable::HardDelete(planetLand, true);
|
||||
// Transformable::HardDelete(planetLand, true);
|
||||
planetBase->SetParent(nullptr);
|
||||
Transformable::HardDelete(planetBase, false);
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
#include "Utilities/Random.hpp"
|
||||
#include "BehaviourScripts/GravityHolder.hpp"
|
||||
#include "BehaviourScripts/SpaceController.hpp"
|
||||
#include "Debug.hpp"
|
||||
|
||||
Transformable *Planet::LoadSpace()
|
||||
{
|
||||
root = new Transformable(name);
|
||||
root = new Transformable(name, id);
|
||||
|
||||
Transformable* planet = create();
|
||||
|
||||
@@ -24,16 +25,16 @@ Transformable *Planet::LoadSpace()
|
||||
moonObj->position = {pos.x, pos.y, -1};
|
||||
}
|
||||
|
||||
root->id = id;
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
void Planet::UnloadSpace()
|
||||
{
|
||||
TSE_LOG("Obj count pre unload: " + std::to_string(Transformable::GetTansformableCount()));
|
||||
DeleteResources();
|
||||
root->SetParent(nullptr);
|
||||
Transformable::HardDelete(root, true);
|
||||
Transformable::HardDelete(root, false);
|
||||
TSE_LOG("Obj count post unload: " + std::to_string(Transformable::GetTansformableCount()));
|
||||
}
|
||||
|
||||
Transformable *Planet::create()
|
||||
@@ -213,8 +214,8 @@ void Planet::DeleteResources()
|
||||
delete cloudMat;
|
||||
delete landMat;
|
||||
delete planetMat;
|
||||
Transformable::HardDelete(planetClouds, true);
|
||||
Transformable::HardDelete(planetLand, true);
|
||||
// Transformable::HardDelete(planetClouds, true);
|
||||
// Transformable::HardDelete(planetLand, true);
|
||||
planetBase->SetParent(nullptr);
|
||||
Transformable::HardDelete(planetBase, false);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Utilities/Random.hpp"
|
||||
#include "BehaviourScripts/GravityHolder.hpp"
|
||||
#include "BehaviourScripts/SpaceController.hpp"
|
||||
#include "Debug.hpp"
|
||||
|
||||
void PlanetarySystem::DeleteResources()
|
||||
{
|
||||
@@ -19,7 +20,8 @@ void PlanetarySystem::DeleteResources()
|
||||
|
||||
Transformable *PlanetarySystem::LoadSpace()
|
||||
{
|
||||
root = new Transformable(name);
|
||||
if(name == "") name = "root";
|
||||
root = new Transformable(name, id);
|
||||
|
||||
if(stars.size() == 1)
|
||||
{
|
||||
@@ -38,8 +40,6 @@ Transformable *PlanetarySystem::LoadSpace()
|
||||
planetObj->position = {pos.x, pos.y, -1};
|
||||
}
|
||||
|
||||
root->id = id;
|
||||
|
||||
float grvityWell = GetMaxPlanetDistance();
|
||||
|
||||
GravityHolder* holder = new GravityHolder(grvityWell + 4.0f);
|
||||
@@ -56,7 +56,8 @@ void PlanetarySystem::UnloadSpace()
|
||||
{
|
||||
DeleteResources();
|
||||
root->SetParent(nullptr);
|
||||
Transformable::HardDelete(root, true);
|
||||
Transformable::HardDelete(root, false);
|
||||
|
||||
}
|
||||
|
||||
PlanetarySystem *PlanetarySystem::Load(nlohmann::json json)
|
||||
|
||||
@@ -151,8 +151,8 @@ void Star::DeleteResources()
|
||||
delete cloudMat;
|
||||
delete landMat;
|
||||
delete planetMat;
|
||||
Transformable::HardDelete(planetClouds, true);
|
||||
Transformable::HardDelete(planetLand, true);
|
||||
// Transformable::HardDelete(planetClouds, true);
|
||||
// Transformable::HardDelete(planetLand, true);
|
||||
planetBase->SetParent(nullptr);
|
||||
Transformable::HardDelete(planetBase, false);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void SetupWindow()
|
||||
TextureHandler::LoadTextures();
|
||||
|
||||
currentScene = new Scene();
|
||||
Transformable* trans = new Transformable();
|
||||
Transformable* trans = new Transformable("Space Controller");
|
||||
planeteryLayer = new Layer("PlanetsAndStuff");
|
||||
currentScene->AddLayer(planeteryLayer);
|
||||
planeteryLayer->AddTransformable(trans);
|
||||
@@ -66,7 +66,7 @@ void SetupWindow()
|
||||
|
||||
SpaceController* controller = (SpaceController*)trans->AddBehaviourScript(new SpaceController(cc));
|
||||
lc = GalaxyGenerator::GenerateCluster(69);
|
||||
controller->LoadSpace(lc->galaxies[0]->systems[96]);
|
||||
controller->LoadSpace(lc->galaxies[0]->systems[96]->planets[0]);
|
||||
|
||||
#ifdef USE_EDITOR
|
||||
currentScene->AddLayer(&editor->editorLayer);
|
||||
|
||||
2
TSE
2
TSE
Submodule TSE updated: 11e8d343af...bf4189bba0
Reference in New Issue
Block a user