diff --git a/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.cpp b/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.cpp index d2b6c17..ada3f7a 100644 --- a/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.cpp +++ b/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.cpp @@ -1,6 +1,7 @@ #include "OrdererSpriteSet.hpp" #include #include +#include #include "Debug.hpp" TSE::OrdererSpriteSetChunk::OrdererSpriteSetChunk(int _chunksize, const Vector2 &_pos, SortingOrder _order) @@ -210,14 +211,6 @@ const std::vector *TSE::OrdererSpriteSet::GetChunkPositionsInOrder } dirty = false; - string poses = "["; - for(auto pos : orderedChunks) - { - poses += pos.ToString() + ","; - } - poses.erase(poses.end() - 1); - poses += "]"; - TSE_LOG("orderedPositions: " + poses); } return &orderedChunks; } @@ -245,7 +238,7 @@ void TSE::OrdererSpriteSet::DirtyAll() TSE::Vector2 TSE::OrdererSpriteSet::LocalToChunkPos(const Vector2 &v) { - Vector2 p = Vector2((int)v.x % chunkSize, (int)v.y % chunkSize); + Vector2 p = Vector2(std::fmod(v.x, chunkSize), std::fmod(v.y, chunkSize)); if(p.x < 0) p.x += chunkSize; if(p.y < 0) p.y += chunkSize; return p; diff --git a/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.hpp b/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.hpp index 5f59f83..88f4ff5 100644 --- a/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.hpp +++ b/TSE_Core/src/BehaviourScripts/OrdererSpriteSet.hpp @@ -50,7 +50,7 @@ namespace TSE Rect bounds = Rect(0,0,0,0); public: - int chunkSize = 16; + float chunkSize = 16; SortingOrder order = TopRight; TileSet* set; std::unordered_map chunks; diff --git a/TSE_Editor/src/EditorSubsystem.cpp b/TSE_Editor/src/EditorSubsystem.cpp index e607861..1061aad 100644 --- a/TSE_Editor/src/EditorSubsystem.cpp +++ b/TSE_Editor/src/EditorSubsystem.cpp @@ -8,13 +8,14 @@ #include "BehaviourScripts/PhysicsObject.hpp" #include "BehaviourScripts/basicEditorCamera.hpp" -TSE::EDITOR::EditorSubsystem::EditorSubsystem() : sv(nullptr), editorLayer("") +TSE::EDITOR::EditorSubsystem::EditorSubsystem(ConsolView* cvp) : sv(nullptr), editorLayer("") { rt = IRenderTexture::factory->CreateTextureHeap({100,100}, 5); sv = SceneView(rt); + cv = cvp; controller.AddGuiElement("Scene", &sv); - controller.AddGuiElement("Consol", &cv); + controller.AddGuiElement("Consol", cv); controller.AddGuiElement("Hirearchie", &hv); controller.AddGuiElement("Properties", &pv); controller.AddGuiElement("Debug", &dv); diff --git a/TSE_Editor/src/EditorSubsystem.hpp b/TSE_Editor/src/EditorSubsystem.hpp index 861c4d0..df7fa2b 100644 --- a/TSE_Editor/src/EditorSubsystem.hpp +++ b/TSE_Editor/src/EditorSubsystem.hpp @@ -15,7 +15,7 @@ namespace TSE::EDITOR { public: ViewportController controller; - ConsolView cv; + ConsolView* cv = nullptr; DebugView dv; HirearchieView hv = HirearchieView(nullptr); PropertiesView pv; @@ -24,6 +24,6 @@ namespace TSE::EDITOR SceneView sv; Layer editorLayer; - EditorSubsystem(); + EditorSubsystem(ConsolView* cvp); }; } // namespace TSE::EDITOR diff --git a/TSE_Editor/src/UI/ElementDrawer.cpp b/TSE_Editor/src/UI/ElementDrawer.cpp index e1d5ade..5f52e8c 100644 --- a/TSE_Editor/src/UI/ElementDrawer.cpp +++ b/TSE_Editor/src/UI/ElementDrawer.cpp @@ -934,7 +934,7 @@ namespace TSE::EDITOR } ImGui::BeginDisabled(); - ImGui::DragInt("Chunk Size", &element->chunkSize, 1.0f); + ImGui::DragFloat("Chunk Size", &element->chunkSize, 1.0f); ImGui::EndDisabled(); if (debug)