summaryrefslogtreecommitdiff
path: root/src/engine/editor
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-12-15 12:29:58 -0700
committerGitHub <noreply@github.com>2025-12-15 12:29:58 -0700
commiteb11374093b07bd968ccb955eecd06133db0ab74 (patch)
tree8e584cd21b9ea22403c903621d300d8223a62c86 /src/engine/editor
parent2995361eb152a5c0c8add52c590e30ec916b81ec (diff)
Edit TrackInfo Properties (#594)
* Fix finishline for toads turnpike in extra * Fixed trash bin in extra * Refactor fov * Update scene.json * Allow setting fog * impl fog save & load * Fix modifying resourceName and rename editor namespace to trackeditor * small change
Diffstat (limited to 'src/engine/editor')
-rw-r--r--src/engine/editor/Collision.cpp2
-rw-r--r--src/engine/editor/Collision.h2
-rw-r--r--src/engine/editor/Editor.cpp2
-rw-r--r--src/engine/editor/Editor.h4
-rw-r--r--src/engine/editor/GameObject.cpp4
-rw-r--r--src/engine/editor/GameObject.h2
-rw-r--r--src/engine/editor/Gizmo.cpp2
-rw-r--r--src/engine/editor/Gizmo.h2
-rw-r--r--src/engine/editor/Handles.cpp2
-rw-r--r--src/engine/editor/Handles.h2
-rw-r--r--src/engine/editor/Light.cpp2
-rw-r--r--src/engine/editor/Light.h2
-rw-r--r--src/engine/editor/ObjectPicker.cpp4
-rw-r--r--src/engine/editor/ObjectPicker.h2
-rw-r--r--src/engine/editor/SceneManager.cpp4
-rw-r--r--src/engine/editor/SceneManager.h2
16 files changed, 21 insertions, 19 deletions
diff --git a/src/engine/editor/Collision.cpp b/src/engine/editor/Collision.cpp
index f79865899..d872963d1 100644
--- a/src/engine/editor/Collision.cpp
+++ b/src/engine/editor/Collision.cpp
@@ -14,7 +14,7 @@ extern "C" {
#include "assets/textures/other_textures.h"
}
-namespace Editor {
+namespace TrackEditor {
void GenerateCollisionMesh(std::variant<AActor*, OObject*, GameObject*> object, Gfx* model, float scale) {
int8_t opcode;
uintptr_t lo;
diff --git a/src/engine/editor/Collision.h b/src/engine/editor/Collision.h
index d761bf04c..1583cdcc6 100644
--- a/src/engine/editor/Collision.h
+++ b/src/engine/editor/Collision.h
@@ -19,7 +19,7 @@
#define EDITOR_GFX_GET_OPCODE(var) ((uint32_t) ((var) & 0xFF000000))
-namespace Editor {
+namespace TrackEditor {
void GenerateCollisionMesh(std::variant<AActor*, OObject*, GameObject*> object, Gfx* model, float scale);
void DebugCollision(GameObject* obj, FVector pos, IRotator rot, FVector scale, const std::vector<Triangle>& triangles);
}
diff --git a/src/engine/editor/Editor.cpp b/src/engine/editor/Editor.cpp
index 698a6cc40..87bca2a82 100644
--- a/src/engine/editor/Editor.cpp
+++ b/src/engine/editor/Editor.cpp
@@ -24,7 +24,7 @@ extern "C" {
#include "camera.h"
}
-namespace Editor {
+namespace TrackEditor {
Editor* Editor::Instance;
Editor::Editor() {
diff --git a/src/engine/editor/Editor.h b/src/engine/editor/Editor.h
index 77169de46..bfd7b1290 100644
--- a/src/engine/editor/Editor.h
+++ b/src/engine/editor/Editor.h
@@ -12,7 +12,7 @@ extern "C" {
}
#include "ObjectPicker.h"
-namespace Editor {
+namespace TrackEditor {
class ObjectPicker;
class Editor {
@@ -54,7 +54,7 @@ private:
void Copy(MtxF* src, MtxF* dest);
void Clear(MtxF* mf);
};
-} // namespace Editor
+} // namespace TrackEditor
#endif // __cplusplus
diff --git a/src/engine/editor/GameObject.cpp b/src/engine/editor/GameObject.cpp
index 30a1722f4..aeda2eb5b 100644
--- a/src/engine/editor/GameObject.cpp
+++ b/src/engine/editor/GameObject.cpp
@@ -1,7 +1,7 @@
#include <libultraship/libultraship.h>
#include "GameObject.h"
-namespace Editor {
+namespace TrackEditor {
GameObject::GameObject(FVector pos, IRotator rot, FVector scale, const char* model, std::vector<Triangle> triangles, CollisionType collision, float boundingBoxSize) {
Pos = pos;
@@ -38,4 +38,4 @@ namespace Editor {
Scale = scale;
};
-} // namespace Editor
+} // namespace TrackEditor
diff --git a/src/engine/editor/GameObject.h b/src/engine/editor/GameObject.h
index 35ce90dbf..00087105e 100644
--- a/src/engine/editor/GameObject.h
+++ b/src/engine/editor/GameObject.h
@@ -16,7 +16,7 @@ extern "C" {
struct Triangle;
-namespace Editor {
+namespace TrackEditor {
class GameObject {
public:
enum class CollisionType {
diff --git a/src/engine/editor/Gizmo.cpp b/src/engine/editor/Gizmo.cpp
index 4d3c86d25..4301f7db4 100644
--- a/src/engine/editor/Gizmo.cpp
+++ b/src/engine/editor/Gizmo.cpp
@@ -29,7 +29,7 @@ extern "C" {
#include "math_util.h"
}
-namespace Editor {
+namespace TrackEditor {
void Gizmo::Load() {
/* Translate handle collision */
diff --git a/src/engine/editor/Gizmo.h b/src/engine/editor/Gizmo.h
index f98b634b1..bb1f037cc 100644
--- a/src/engine/editor/Gizmo.h
+++ b/src/engine/editor/Gizmo.h
@@ -8,7 +8,7 @@
#include "engine/objects/Object.h"
#include <variant>
-namespace Editor {
+namespace TrackEditor {
class Gizmo {
public:
diff --git a/src/engine/editor/Handles.cpp b/src/engine/editor/Handles.cpp
index 532af6af6..577256690 100644
--- a/src/engine/editor/Handles.cpp
+++ b/src/engine/editor/Handles.cpp
@@ -3,7 +3,7 @@
#include "Handles.h"
-namespace Editor {
+namespace TrackEditor {
Handles::Handles() {
}
diff --git a/src/engine/editor/Handles.h b/src/engine/editor/Handles.h
index ecd8f8f90..c8fae7f14 100644
--- a/src/engine/editor/Handles.h
+++ b/src/engine/editor/Handles.h
@@ -4,7 +4,7 @@
#include <libultra/gbi.h>
#include "GameObject.h"
-namespace Editor {
+namespace TrackEditor {
class Handles : public GameObject {
Handles();
diff --git a/src/engine/editor/Light.cpp b/src/engine/editor/Light.cpp
index 53dc00864..477793540 100644
--- a/src/engine/editor/Light.cpp
+++ b/src/engine/editor/Light.cpp
@@ -27,7 +27,7 @@ extern "C" {
#include "math_util_2.h"
}
-namespace Editor {
+namespace TrackEditor {
size_t LightObject::NumLights = 0;
diff --git a/src/engine/editor/Light.h b/src/engine/editor/Light.h
index 3a177053e..5af0b9466 100644
--- a/src/engine/editor/Light.h
+++ b/src/engine/editor/Light.h
@@ -5,7 +5,7 @@
#include "Collision.h"
#include "GameObject.h"
-namespace Editor {
+namespace TrackEditor {
class LightObject : public GameObject {
public:
diff --git a/src/engine/editor/ObjectPicker.cpp b/src/engine/editor/ObjectPicker.cpp
index cbce7dd09..7fd4cc407 100644
--- a/src/engine/editor/ObjectPicker.cpp
+++ b/src/engine/editor/ObjectPicker.cpp
@@ -25,7 +25,7 @@ extern "C" {
#include "camera.h"
}
-namespace Editor {
+namespace TrackEditor {
void ObjectPicker::Load() {
eGizmo.Load();
@@ -230,7 +230,7 @@ std::pair<GameObject*, float> ObjectPicker::CheckEditorObjectRay(Ray ray) {
break;
}
case GameObject::CollisionType::BOUNDING_SPHERE:
- printf("Editor::ObjectPicker.cpp Bounding sphere collision type not yet supported\n");
+ printf("[ObjectPicker] [CheckEditorObjectRay] Bounding sphere collision type not yet supported\n");
break;
}
}
diff --git a/src/engine/editor/ObjectPicker.h b/src/engine/editor/ObjectPicker.h
index 0dbdca215..cf1e4e12d 100644
--- a/src/engine/editor/ObjectPicker.h
+++ b/src/engine/editor/ObjectPicker.h
@@ -7,7 +7,7 @@
#include "GameObject.h"
#include "engine/Matrix.h"
-namespace Editor {
+namespace TrackEditor {
class ObjectPicker {
public:
void SelectObject(std::vector<GameObject*> objects);
diff --git a/src/engine/editor/SceneManager.cpp b/src/engine/editor/SceneManager.cpp
index 026dfbfe0..1a0c129c0 100644
--- a/src/engine/editor/SceneManager.cpp
+++ b/src/engine/editor/SceneManager.cpp
@@ -33,7 +33,7 @@ extern "C" {
#include "render_courses.h"
}
-namespace Editor {
+namespace TrackEditor {
void SaveLevel(Track* track, const TrackInfo* info) {
nlohmann::json data;
@@ -42,6 +42,7 @@ namespace Editor {
*/
try {
data["Props"] = track->Props.to_json();
+ data["Props"]["ResourceName"] = track->ResourceName.c_str();
} catch (...) {
SPDLOG_ERROR("[SceneManager] [SaveLevel] Failed serializing track Props");
}
@@ -331,6 +332,7 @@ namespace Editor {
try {
track->Props.from_json(data["Props"]);
+ track->ResourceName = data["Props"].at("ResourceName").get<std::string>();
} catch(const std::exception& e) {
std::cerr << " Error parsing track properties: " << e.what() << std::endl;
std::cerr << " Is your scene.json file out of date?" << std::endl;
diff --git a/src/engine/editor/SceneManager.h b/src/engine/editor/SceneManager.h
index 7adff2af9..44c2f538f 100644
--- a/src/engine/editor/SceneManager.h
+++ b/src/engine/editor/SceneManager.h
@@ -6,7 +6,7 @@
#include <optional>
#include <nlohmann/json.hpp>
-namespace Editor {
+namespace TrackEditor {
void SaveLevel(Track* track, const TrackInfo* info);
void LoadTrackDataFromJson(Track* track, const std::string& trackPath);
void LoadTrackInfo(TrackInfo& info, std::shared_ptr<Ship::Archive> archive, std::string sceneFile);