diff --git a/src/character.cpp b/src/character.cpp index 2b69044..ffd1a39 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -95,7 +95,7 @@ namespace cloonel { void Character::Draw() const { m_texture->Render(GetPos(), WidthHeight(), m_screenRatio.Ratio(), true); #if defined(WITH_DEBUG_VISUALS) - m_bottomBarDrawable.Render(GetPos(), m_screenRatio.Ratio()); + m_bottomBarDrawable.Render(m_bottomBar.From(), m_screenRatio.Ratio()); #endif } diff --git a/src/drawableline.hpp b/src/drawableline.hpp index e0cc3a2..25a0757 100644 --- a/src/drawableline.hpp +++ b/src/drawableline.hpp @@ -37,15 +37,15 @@ namespace cloonel { explicit DrawableLine ( SDLMain* parMain, Colour parColour ); DrawableLine ( SDLMain* parMain, Colour parColour, const LineBase& parLine ); DrawableLine ( SDLMain* parMain, Colour parColour, const LineBase::Point& parStart, const LineBase::Point& parEnd ); - DrawableLine ( const DrawableLine& parOther ) = default; + DrawableLine ( const DrawableLine& ) = default; virtual ~DrawableLine ( void ) noexcept = default; - DrawableLine& operator= ( const DrawableLine& ) = delete; + DrawableLine& operator= ( const DrawableLine& ) = default; void Render ( const float2& parPos, const float2& parScaling ) const; private: - SDLMain* const m_sdlmain; + SDLMain* m_sdlmain; Colour m_colour; }; diff --git a/src/platform.cpp b/src/platform.cpp index 4b8b269..51ece8a 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -32,6 +32,9 @@ namespace cloonel { m_size(parSize), m_collisionTop(new HorzCollisionBar(parPos, parSize.x())), m_surface(parTexture) +#if defined(WITH_DEBUG_VISUALS) + , m_collisionTopDrawable(parSdlMain, Colour(215, 181, 3), static_cast(parPos), static_cast(parPos + float2(parSize.x(), 0.0f))) +#endif { assert(m_surface); } @@ -44,6 +47,9 @@ namespace cloonel { m_size(parOther.m_size), m_collisionTop(std::move(parOther.m_collisionTop)), m_surface(parOther.m_surface) +#if defined(WITH_DEBUG_VISUALS) + , m_collisionTopDrawable(parOther.m_collisionTopDrawable) +#endif { } @@ -56,6 +62,9 @@ namespace cloonel { ///-------------------------------------------------------------------------- void Platform::Draw() const { m_surface->Render(TopLeft(), m_size, m_screenRatio.Ratio(), true); +#if defined(WITH_DEBUG_VISUALS) + m_collisionTopDrawable.Render(m_collisionTop->From(), m_screenRatio.Ratio()); +#endif } ///-------------------------------------------------------------------------- @@ -66,6 +75,9 @@ namespace cloonel { m_size = parOther.m_size; m_surface = parOther.m_surface; +#if defined(WITH_DEBUG_VISUALS) + m_collisionTopDrawable = parOther.m_collisionTopDrawable; +#endif return *this; } diff --git a/src/platform.hpp b/src/platform.hpp index a2130cf..d6d23a5 100644 --- a/src/platform.hpp +++ b/src/platform.hpp @@ -24,6 +24,9 @@ #include "drawable.hpp" #include "placeable.hpp" #include "collidertypedef.hpp" +#if defined(WITH_DEBUG_VISUALS) +# include "drawableline.hpp" +#endif #include #include @@ -60,6 +63,9 @@ namespace cloonel { ColliderUnregisterFunc m_unregisterFromCollider; std::unique_ptr m_collisionTop; Texture* m_surface; +#if defined(WITH_DEBUG_VISUALS) + DrawableLine m_collisionTopDrawable; +#endif }; } //namespace cloonel