Skip to content

Commit

Permalink
Pushed json in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpect committed Sep 21, 2022
1 parent 713f0fd commit d02bf69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion editor/editor_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void EditorSystem::drawDefaultUI(float deltaMilliseconds)
ImGui::Separator();
if (ImGui::BeginMenu("Create Scene"))
{
static unsigned int inputBaseID = 0;
static SceneID inputBaseID = 0;
ImGui::InputText("Scene Name", &newSceneName, ImGuiInputTextFlags_AlwaysInsertMode);
ImGui::InputScalar("Scene BaseID", ImGuiDataType_U32, &inputBaseID);
Scene::SetBaseID(inputBaseID);
Expand Down
9 changes: 1 addition & 8 deletions rootex/framework/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ Ptr<Scene> Scene::Create(const JSON::json& sceneData, const bool assignNewIDs)
}
else
{
/*thisSceneID = std::max(std::max(BaseID, NextSceneID), SceneIDOffset);
NextSceneID = std::max(BaseID, SceneIDOffset);*/
NextSceneID = std::max(std::max(BaseID, NextSceneID), SceneIDOffset);
thisSceneID = NextSceneID;
}
Expand Down Expand Up @@ -320,11 +318,6 @@ void Scene::setName(const String& name)
m_FullName = name + " # " + std::to_string(m_ID);
}

void Scene::setm_BaseID(const SceneID& input)
{
m_BaseID = BaseID;
}

JSON::json Scene::getJSON() const
{
JSON::json j;
Expand Down Expand Up @@ -356,7 +349,7 @@ Scene::Scene(SceneID id, const String& name, const SceneSettings& settings, Impo
, m_Entity(this)
{
setName(m_Name);
setm_BaseID(BaseID);
setm_BaseID();
s_Scenes.push_back(this);
}

Expand Down
4 changes: 2 additions & 2 deletions rootex/framework/scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Scene

public:
static void ResetNextID();
static void Scene::SetBaseID(const SceneID& inputBaseID) { BaseID = inputBaseID; }
static void SetBaseID(const SceneID& inputBaseID) { BaseID = inputBaseID; }

static Ptr<Scene> Create(const JSON::json& sceneData, const bool assignNewIDs);
static Ptr<Scene> CreateFromFile(const String& sceneFile);
Expand All @@ -82,7 +82,7 @@ class Scene
bool removeChild(Scene* toRemove);

void setName(const String& name);
void setm_BaseID(const SceneID& input);
void Scene::setm_BaseID() { m_BaseID = BaseID; }

JSON::json getJSON() const;
bool& getIsScenePaused() { return m_IsScenePaused; }
Expand Down

0 comments on commit d02bf69

Please sign in to comment.