diff --git a/lib/vectorwrapper b/lib/vectorwrapper index 0047029..2f4d319 160000 --- a/lib/vectorwrapper +++ b/lib/vectorwrapper @@ -1 +1 @@ -Subproject commit 00470290fe404e2977882917a4cf4197124256b5 +Subproject commit 2f4d31967541c9c4a87b2511fb0c6d3792c72c2d diff --git a/src/sizenotifiable.cpp b/src/sizenotifiable.cpp index ac08df8..0a61140 100644 --- a/src/sizenotifiable.cpp +++ b/src/sizenotifiable.cpp @@ -55,5 +55,11 @@ namespace cloonel { ///-------------------------------------------------------------------------- void SizeNotifiableBase::NotifyResChanged (const SizeRatio& parSize) { m_scaleRatio = parSize.Ratio(); + this->OnResChanged(parSize); + } + + ///-------------------------------------------------------------------------- + ///-------------------------------------------------------------------------- + void SizeNotifiableBase::OnResChanged (const SizeRatio&) { } } //namespace cloonel diff --git a/src/sizenotifiable.hpp b/src/sizenotifiable.hpp index 7ef2d86..529515f 100644 --- a/src/sizenotifiable.hpp +++ b/src/sizenotifiable.hpp @@ -23,6 +23,7 @@ #include "vectypes.hpp" #include #include +#include namespace cloonel { class SizeRatio; @@ -76,10 +77,12 @@ namespace cloonel { SizeNotifiableBase& operator= ( const SizeNotifiableBase& ) = delete; public: - virtual void NotifyResChanged ( const SizeRatio& parSize ); + void NotifyResChanged ( const SizeRatio& parSize ); const float2& Ratio ( void ) const noexcept { return m_scaleRatio; } private: + virtual void OnResChanged ( const SizeRatio& ); + float2 m_scaleRatio; }; diff --git a/src/tiledwallpaper.cpp b/src/tiledwallpaper.cpp index f730baf..ef85764 100644 --- a/src/tiledwallpaper.cpp +++ b/src/tiledwallpaper.cpp @@ -111,9 +111,8 @@ namespace cloonel { ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- - void TiledWallpaper::TileCountNotifiable::NotifyResChanged (const SizeRatio& parSize) { + void TiledWallpaper::TileCountNotifiable::OnResChanged (const SizeRatio& parSize) { std::cout << "Autoregistering" << std::endl; - BaseClass::NotifyResChanged(parSize); m_tileCount = CountTilesInScreen(vector_cast(parSize.Resolution()), vector_cast(m_tileSize)); #if defined(WITH_DEBUG_VISUALS) m_screenRes = parSize.Resolution(); diff --git a/src/tiledwallpaper.hpp b/src/tiledwallpaper.hpp index 50a6dac..8926b5f 100644 --- a/src/tiledwallpaper.hpp +++ b/src/tiledwallpaper.hpp @@ -52,7 +52,6 @@ namespace cloonel { TileCountNotifiable ( SDLMain* parMain, const ushort2& parTileSize ); virtual ~TileCountNotifiable ( void ) noexcept = default; - virtual void NotifyResChanged ( const SizeRatio& parSize ); const float2& tileCount ( void ) const noexcept { return m_tileCount; } const float2& tileSize ( void ) const noexcept { return m_tileSize; } #if defined(WITH_DEBUG_VISUALS) @@ -60,6 +59,8 @@ namespace cloonel { #endif private: + virtual void OnResChanged ( const SizeRatio& parSize ) override; + float2 m_tileCount; const float2 m_tileSize; #if defined(WITH_DEBUG_VISUALS)