Use the deferred virtual call mechanism to avoid the virtual

call bug in the constructor.

See docs/wrong_virtual_call.md for a description.
This commit is contained in:
King_DuckZ 2016-11-10 23:19:55 +01:00
parent 0b6cdeb5f5
commit 5e76b49cae
6 changed files with 64 additions and 11 deletions

View file

@ -28,7 +28,7 @@ namespace cloonel {
///--------------------------------------------------------------------------
Platform::Platform (SDLMain* parSdlMain, const float2& parPos, Texture* parTexture, const float2& parSize) :
Placeable(parPos),
m_screenRatio(parSdlMain),
m_screenRatio(parSdlMain, &m_screenRatio),
m_size(parSize),
m_collisionTop(new HorzCollisionBar(parPos, parSize.x())),
m_surface(parTexture)