diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h index 9e9e6eba..c5705cc2 100644 --- a/src/graphics/core/color.h +++ b/src/graphics/core/color.h @@ -37,22 +37,11 @@ namespace Gfx * \struct Color * \brief RGBA color */ -struct Color +struct Color : glm::vec4 { - //! Red, green, blue and alpha components - float r, g, b, a; - //! Constructor; default values are (0,0,0,0) = black explicit Color(float aR = 0.0f, float aG = 0.0f, float aB = 0.0f, float aA = 0.0f) - : r(aR), g(aG), b(aB), a(aA) {} - - Color(const glm::vec4& color) - : r(color.r), g(color.g), b(color.b), a(color.a) {} - - operator glm::vec4() const - { - return { r, g, b, a }; - } + : glm::vec4(aR, aG, aB, aA) {} inline Color Inverse() const { @@ -112,22 +101,11 @@ struct Color * * May be used for precise pixel manipulations. */ -struct IntColor +struct IntColor : glm::u8vec4 { - //! Red, green, blue and alpha components - unsigned char r, g, b, a; - //! Constructor; default values are (0,0,0,0) = black explicit IntColor(unsigned char aR = 0, unsigned char aG = 0, unsigned char aB = 0, unsigned char aA = 0) - : r(aR), g(aG), b(aB), a(aA) {} - - IntColor(const glm::u8vec4& color) - : r(color.r), g(color.g), b(color.b), a(color.a) {} - - operator glm::u8vec4() const - { - return { r, g, b, a }; - } + : glm::u8vec4(aR, aG, aB, aA) {} }; inline Color IntColorToColor(IntColor color) diff --git a/src/graphics/core/renderers.h b/src/graphics/core/renderers.h index 87951580..f893f064 100644 --- a/src/graphics/core/renderers.h +++ b/src/graphics/core/renderers.h @@ -191,6 +191,8 @@ public: virtual void DrawObject(const CVertexBuffer* buffer) = 0; //! Draws a primitive virtual void DrawPrimitive(PrimitiveType type, int count, const Vertex3D* vertices) = 0; + //! Draws a set of primitives + virtual void DrawPrimitives(PrimitiveType type, int drawCount, int count[], const Vertex3D* vertices) = 0; }; /** diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 98bd5f8c..3ad53d05 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -3237,8 +3237,6 @@ void CEngine::Draw3DScene() m_water->DrawSurf(); // draws water surface - objectRenderer->End(); - CProfiler::StopPerformanceCounter(PCNT_RENDER_WATER); RenderPendingDebugDraws(); @@ -3246,17 +3244,19 @@ void CEngine::Draw3DScene() if (m_debugGoto) { glm::mat4 worldMatrix = glm::mat4(1.0f); - //m_device->SetTransform(TRANSFORM_WORLD, worldMatrix); - - //SetState(ENG_RSTATE_OPAQUE_COLOR); + objectRenderer->SetTransparency(TransparencyMode::NONE); + objectRenderer->SetLighting(false); + objectRenderer->SetModelMatrix(glm::mat4(1.0f)); for (const auto& line : m_displayGoto) { - m_device->DrawPrimitive(PrimitiveType::LINE_STRIP, line.data(), line.size()); + objectRenderer->DrawPrimitive(PrimitiveType::LINE_STRIP, line.size(), line.data()); } } m_displayGoto.clear(); + objectRenderer->End(); + auto particleRenderer = m_device->GetParticleRenderer(); particleRenderer->Begin(); particleRenderer->SetProjectionMatrix(m_matProj); @@ -3266,10 +3266,10 @@ void CEngine::Draw3DScene() m_particle->DrawParticle(SH_WORLD); // draws the particles of the 3D world CProfiler::StopPerformanceCounter(PCNT_RENDER_PARTICLE_WORLD); - particleRenderer->End(); - m_lightning->Draw(); // draws lightning + particleRenderer->End(); + DrawForegroundImage(); // draws the foreground if (! m_overFront) DrawOverColor(); // draws the foreground color @@ -3448,18 +3448,12 @@ void CEngine::RenderDebugSphere(const Math::Sphere& sphere, const glm::mat4& tra }(); - const int firstDraw = m_pendingDebugDraws.firsts.size(); + const int firstDraw = m_pendingDebugDraws.counts.size(); const int firstVert = m_pendingDebugDraws.vertices.size(); - m_pendingDebugDraws.firsts.resize(m_pendingDebugDraws.firsts.size() + NUM_LINE_STRIPS); m_pendingDebugDraws.counts.resize(m_pendingDebugDraws.counts.size() + NUM_LINE_STRIPS); m_pendingDebugDraws.vertices.resize(m_pendingDebugDraws.vertices.size() + verticesTemplate.size()); - for (int i = 0; i < NUM_LINE_STRIPS; ++i) - { - m_pendingDebugDraws.firsts[i + firstDraw] = firstVert + i * VERTS_IN_LINE_STRIP; - } - for (int i = 0; i < NUM_LINE_STRIPS; ++i) { m_pendingDebugDraws.counts[i + firstDraw] = VERTS_IN_LINE_STRIP; @@ -3468,7 +3462,7 @@ void CEngine::RenderDebugSphere(const Math::Sphere& sphere, const glm::mat4& tra for (std::size_t i = 0; i < verticesTemplate.size(); ++i) { auto pos = Math::Transform(transform, sphere.pos + verticesTemplate[i] * sphere.radius); - m_pendingDebugDraws.vertices[i + firstVert] = VertexCol{pos, color}; + m_pendingDebugDraws.vertices[i + firstVert] = Vertex3D{ pos, {}, color }; } } @@ -3477,18 +3471,12 @@ void CEngine::RenderDebugBox(const glm::vec3& mins, const glm::vec3& maxs, const static constexpr int NUM_LINE_STRIPS = 4; static constexpr int VERTS_IN_LINE_STRIP = 4; - const int firstDraw = m_pendingDebugDraws.firsts.size(); + const int firstDraw = m_pendingDebugDraws.counts.size(); const int firstVert = m_pendingDebugDraws.vertices.size(); - m_pendingDebugDraws.firsts.resize(m_pendingDebugDraws.firsts.size() + NUM_LINE_STRIPS); m_pendingDebugDraws.counts.resize(m_pendingDebugDraws.counts.size() + NUM_LINE_STRIPS); m_pendingDebugDraws.vertices.resize(m_pendingDebugDraws.vertices.size() + NUM_LINE_STRIPS * VERTS_IN_LINE_STRIP); - for (int i = 0; i < NUM_LINE_STRIPS; ++i) - { - m_pendingDebugDraws.firsts[i + firstDraw] = firstVert + (i * VERTS_IN_LINE_STRIP); - } - for (int i = 0; i < NUM_LINE_STRIPS; ++i) { m_pendingDebugDraws.counts[i + firstDraw] = NUM_LINE_STRIPS; @@ -3496,42 +3484,43 @@ void CEngine::RenderDebugBox(const glm::vec3& mins, const glm::vec3& maxs, const auto vert = m_pendingDebugDraws.vertices.begin() + firstVert; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, mins.y, mins.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, mins.y, mins.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, maxs.y, mins.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, maxs.y, maxs.z}), color}; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, mins.y, mins.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, mins.y, mins.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, maxs.y, mins.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, maxs.y, maxs.z}), {}, color }; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, mins.y, maxs.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, mins.y, mins.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, maxs.y, mins.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, maxs.y, mins.z}), color}; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, mins.y, maxs.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, mins.y, mins.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, maxs.y, mins.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, maxs.y, mins.z}), {}, color }; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, mins.y, maxs.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, mins.y, maxs.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, maxs.y, maxs.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, maxs.y, mins.z}), color}; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, mins.y, maxs.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, mins.y, maxs.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, maxs.y, maxs.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, maxs.y, mins.z}), {}, color }; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, mins.y, mins.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, mins.y, maxs.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{maxs.x, maxs.y, maxs.z}), color}; - *vert++ = VertexCol{Math::Transform(transform, glm::vec3{mins.x, maxs.y, maxs.z}), color}; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, mins.y, mins.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, mins.y, maxs.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{maxs.x, maxs.y, maxs.z}), {}, color }; + *vert++ = Vertex3D{ Math::Transform(transform, glm::vec3{mins.x, maxs.y, maxs.z}), {}, color }; } void CEngine::RenderPendingDebugDraws() { - if (m_pendingDebugDraws.firsts.empty()) return; + if (m_pendingDebugDraws.counts.empty()) return; - //m_device->SetTransform(TRANSFORM_WORLD, glm::mat4(1.0f)); + auto renderer = m_device->GetObjectRenderer(); + renderer->SetTransparency(TransparencyMode::NONE); + renderer->SetLighting(false); + renderer->SetModelMatrix(glm::mat4(1.0f)); + renderer->SetPrimaryTexture(Texture{}); + renderer->SetSecondaryTexture(Texture{}); - //SetState(ENG_RSTATE_OPAQUE_COLOR); + renderer->DrawPrimitives(PrimitiveType::LINE_STRIP, + m_pendingDebugDraws.counts.size(), + m_pendingDebugDraws.counts.data(), + m_pendingDebugDraws.vertices.data()); - m_device->DrawPrimitives(PrimitiveType::LINE_STRIP, - m_pendingDebugDraws.vertices.data(), - m_pendingDebugDraws.firsts.data(), - m_pendingDebugDraws.counts.data(), - m_pendingDebugDraws.firsts.size()); - - m_pendingDebugDraws.firsts.clear(); m_pendingDebugDraws.counts.clear(); m_pendingDebugDraws.vertices.clear(); } @@ -4396,7 +4385,7 @@ void CEngine::DrawShadowSpots() //SetState(ENG_RSTATE_TTEXTURE_WHITE, Color(intensity, intensity, intensity, intensity)); } - m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4); + //m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4); AddStatisticTriangle(2); } @@ -4424,7 +4413,7 @@ void CEngine::DrawBackground() void CEngine::DrawBackgroundGradient(const Color& up, const Color& down) { - glm::vec2 p1(0.0f, 0.5f); + glm::vec2 p1(0.0f, 0.0f); glm::vec2 p2(1.0f, 1.0f); glm::u8vec4 color[3] = @@ -4434,29 +4423,19 @@ void CEngine::DrawBackgroundGradient(const Color& up, const Color& down) { 0, 0, 0, 0 } }; - auto renderer = m_device->GetObjectRenderer(); - renderer->Begin(); - renderer->SetProjectionMatrix(m_matProjInterface); - renderer->SetViewMatrix(m_matViewInterface); - renderer->SetModelMatrix(m_matWorldInterface); - renderer->SetLighting(false); - - renderer->SetPrimaryTexture(Texture{}); - renderer->SetSecondaryTexture(Texture{}); - renderer->SetDepthTest(false); - - Vertex3D vertex[4] = + Vertex2D vertex[4] = { - { glm::vec3(p1.x, p1.y, 0.0f), color[1] }, - { glm::vec3(p1.x, p2.y, 0.0f), color[0] }, - { glm::vec3(p2.x, p1.y, 0.0f), color[1] }, - { glm::vec3(p2.x, p2.y, 0.0f), color[0] } + { { p1.x, p1.y }, {}, color[1] }, + { { p1.x, p2.y }, {}, color[0] }, + { { p2.x, p1.y }, {}, color[1] }, + { { p2.x, p2.y }, {}, color[0] } }; + auto renderer = m_device->GetUIRenderer(); + renderer->SetTexture(Texture{}); + renderer->SetTransparency(TransparencyMode::NONE); renderer->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, 4, vertex); AddStatisticTriangle(2); - - renderer->End(); } void CEngine::DrawBackgroundImage() @@ -4535,6 +4514,7 @@ void CEngine::DrawBackgroundImage() auto renderer = m_device->GetUIRenderer(); renderer->SetTexture(m_backgroundTex); + renderer->SetTransparency(TransparencyMode::NONE); renderer->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, 4, vertices); AddStatisticTriangle(2); } @@ -5149,7 +5129,7 @@ bool CEngine::GetDebugGoto() return m_debugGoto; } -void CEngine::AddDebugGotoLine(std::vector line) +void CEngine::AddDebugGotoLine(std::vector line) { m_displayGoto.push_back(line); } diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index 832090c8..3a0d0d09 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -1149,7 +1149,7 @@ public: void SetDebugGoto(bool debugGoto); bool GetDebugGoto(); - void AddDebugGotoLine(std::vector line); + void AddDebugGotoLine(std::vector line); void SetDebugGotoBitmap(std::unique_ptr debugImage); void SetWindowCoordinates(); @@ -1398,8 +1398,7 @@ protected: struct PendingDebugDraw { - std::vector vertices; - std::vector firsts; + std::vector vertices; std::vector counts; } m_pendingDebugDraws; @@ -1477,7 +1476,7 @@ protected: std::unordered_map m_staticMeshBaseObjects; - std::vector> m_displayGoto; + std::vector> m_displayGoto; std::unique_ptr m_displayGotoImage; //! Pause the animation updates diff --git a/src/graphics/engine/lightning.cpp b/src/graphics/engine/lightning.cpp index 924b4211..abfe4624 100644 --- a/src/graphics/engine/lightning.cpp +++ b/src/graphics/engine/lightning.cpp @@ -221,12 +221,13 @@ void CLightning::Draw() if (m_phase != LightningPhase::Flash) return; CDevice* device = m_engine->GetDevice(); + auto renderer = device->GetParticleRenderer(); - glm::mat4 mat = glm::mat4(1.0f); - //device->SetTransform(TRANSFORM_WORLD, mat); + auto texture = m_engine->LoadTexture("textures/effect00.png"); - //m_engine->SetTexture("textures/effect00.png"); - //m_engine->SetState(ENG_RSTATE_TTEXTURE_BLACK); + renderer->SetModelMatrix(glm::mat4(1.0f)); + renderer->SetTexture(texture); + renderer->SetTransparency(TransparencyMode::BLACK); glm::vec2 texInf; texInf.x = 64.5f/256.0f; @@ -241,7 +242,7 @@ void CLightning::Draw() glm::vec3 n = glm::normalize(p1-eye); glm::vec3 corner[4]; - Vertex vertex[4]; + Vertex3D vertex[4]; for (std::size_t i = 0; i < m_segments.size() - 1; i++) { @@ -272,22 +273,24 @@ void CLightning::Draw() corner[3].y = p2.y; corner[3].z = rot.y+m_segments[i+1].shift.y; + IntColor white = IntColor(255, 255, 255, 255); + if (p2.y < p1.y) { - vertex[0] = { corner[1], n, { texSup.x, texSup.y } }; - vertex[1] = { corner[0], n, { texInf.x, texSup.y } }; - vertex[2] = { corner[3], n, { texSup.x, texInf.y } }; - vertex[3] = { corner[2], n, { texInf.x, texInf.y } }; + vertex[0] = { corner[1], white, { texSup.x, texSup.y } }; + vertex[1] = { corner[0], white, { texInf.x, texSup.y } }; + vertex[2] = { corner[3], white, { texSup.x, texInf.y } }; + vertex[3] = { corner[2], white, { texInf.x, texInf.y } }; } else { - vertex[0] = { corner[0], n, { texSup.x, texSup.y } }; - vertex[1] = { corner[1], n, { texInf.x, texSup.y } }; - vertex[2] = { corner[2], n, { texSup.x, texInf.y } }; - vertex[3] = { corner[3], n, { texInf.x, texInf.y } }; + vertex[0] = { corner[0], white, { texSup.x, texSup.y } }; + vertex[1] = { corner[1], white, { texInf.x, texSup.y } }; + vertex[2] = { corner[2], white, { texSup.x, texInf.y } }; + vertex[3] = { corner[3], white, { texInf.x, texInf.y } }; } - device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4); + renderer->DrawParticle(PrimitiveType::TRIANGLE_STRIP, 4, vertex); m_engine->AddStatisticTriangle(2); p1 = p2; diff --git a/src/graphics/opengl/gl33objectrenderer.cpp b/src/graphics/opengl/gl33objectrenderer.cpp index f02f1f8e..8784a4a8 100644 --- a/src/graphics/opengl/gl33objectrenderer.cpp +++ b/src/graphics/opengl/gl33objectrenderer.cpp @@ -134,7 +134,7 @@ CGL33ObjectRenderer::CGL33ObjectRenderer(CGL33Device* device) // Generic buffer glGenBuffers(1, &m_bufferVBO); glBindBuffer(GL_COPY_WRITE_BUFFER, m_bufferVBO); - glBufferData(GL_COPY_WRITE_BUFFER, m_bufferCapacity, nullptr, GL_STREAM_DRAW); + glBufferData(GL_COPY_WRITE_BUFFER, 8 * sizeof(Vertex3D), nullptr, GL_STREAM_DRAW); glGenVertexArrays(1, &m_bufferVAO); glBindVertexArray(m_bufferVAO); @@ -398,17 +398,29 @@ void CGL33ObjectRenderer::DrawObject(const CVertexBuffer* buffer) void CGL33ObjectRenderer::DrawPrimitive(PrimitiveType type, int count, const Vertex3D* vertices) { + DrawPrimitives(type, 1, &count, vertices); +} + +void CGL33ObjectRenderer::DrawPrimitives(PrimitiveType type, int drawCount, int count[], const Vertex3D* vertices) +{ + m_first.resize(drawCount); + + GLint offset = 0; + + for (size_t i = 0; i < drawCount; i++) + { + m_first[i] = offset; + offset += count[i]; + } + glBindVertexArray(m_bufferVAO); glBindBuffer(GL_ARRAY_BUFFER, m_bufferVBO); - size_t size = count * sizeof(Vertex3D); - - if (m_bufferCapacity < size) - m_bufferCapacity = size; + size_t size = offset * sizeof(Vertex3D); // Send new vertices to GPU glBindBuffer(GL_ARRAY_BUFFER, m_bufferVBO); - glBufferData(GL_ARRAY_BUFFER, m_bufferCapacity, nullptr, GL_STREAM_DRAW); + glBufferData(GL_ARRAY_BUFFER, size, nullptr, GL_STREAM_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, size, vertices); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex3D), @@ -426,5 +438,5 @@ void CGL33ObjectRenderer::DrawPrimitive(PrimitiveType type, int count, const Ver glVertexAttribPointer(4, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex3D), reinterpret_cast(offsetof(Vertex3D, uv2))); - glDrawArrays(TranslateGfxPrimitive(type), 0, count); + glMultiDrawArrays(TranslateGfxPrimitive(type), m_first.data(), count, drawCount); } diff --git a/src/graphics/opengl/gl33objectrenderer.h b/src/graphics/opengl/gl33objectrenderer.h index df270bda..453f7fdc 100644 --- a/src/graphics/opengl/gl33objectrenderer.h +++ b/src/graphics/opengl/gl33objectrenderer.h @@ -100,6 +100,8 @@ public: virtual void DrawObject(const CVertexBuffer* buffer) override; //! Draws a primitive virtual void DrawPrimitive(PrimitiveType type, int count, const Vertex3D* vertices) override; + //! Draws a set of primitives + virtual void DrawPrimitives(PrimitiveType type, int drawCount, int count[], const Vertex3D* vertices) override; private: CGL33Device* const m_device; @@ -152,8 +154,8 @@ private: GLuint m_bufferVBO = 0; // Vertex array object GLuint m_bufferVAO = 0; - // VBO capacity - GLsizei m_bufferCapacity = 8 * sizeof(Vertex3D); + // Offsets + std::vector m_first; }; } diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp index 01d3e115..ee745fb5 100644 --- a/src/object/task/taskgoto.cpp +++ b/src/object/task/taskgoto.cpp @@ -93,7 +93,7 @@ bool CTaskGoto::EventProcess(const Event &event) return p; }; - std::vector debugLine; + std::vector debugLine; if (m_bmTotal > 0) { Gfx::Color color = Gfx::Color(0.0f, 1.0f, 0.0f); @@ -101,14 +101,18 @@ bool CTaskGoto::EventProcess(const Event &event) { if (i > m_bmIndex-1) color = Gfx::Color(1.0f, 0.0f, 0.0f); - debugLine.push_back({ AdjustPoint(m_bmPoints[i]), color }); + + auto intcolor = Gfx::ColorToIntColor(color); + + debugLine.push_back({ AdjustPoint(m_bmPoints[i]), {}, intcolor }); } m_engine->AddDebugGotoLine(debugLine); debugLine.clear(); } Gfx::Color color = Gfx::Color(0.0f, 0.0f, 1.0f); - debugLine.push_back({ m_object->GetPosition(), color }); - debugLine.push_back({ AdjustPoint(m_bmTotal > 0 && m_bmIndex <= m_bmTotal && m_phase != TGP_BEAMSEARCH ? m_bmPoints[m_bmIndex] : m_goal), color }); + auto pos = AdjustPoint(m_bmTotal > 0 && m_bmIndex <= m_bmTotal && m_phase != TGP_BEAMSEARCH ? m_bmPoints[m_bmIndex] : m_goal); + debugLine.push_back({ m_object->GetPosition(), {}, color }); + debugLine.push_back({ pos, {}, color }); m_engine->AddDebugGotoLine(debugLine); if (m_object->GetSelect() && m_bmChanged)