Use the new notifiable system to scale the character.

This commit is contained in:
King_DuckZ 2014-03-20 11:46:20 +01:00
parent 85d57fd681
commit dbf29f13d1
10 changed files with 28 additions and 16 deletions

View file

@ -269,11 +269,10 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void Texture::Render (const float2& parPos, const float2& parSize) const {
void Texture::Render (const float2& parPos, const float2& parSize, const float2& parScaling) const {
assert(IsLoaded());
const float2 scaling(m_sdlmain->WHScaling());
const ushort2 pos(static_cast<ushort2>(parPos * scaling + 0.5f));
const ushort2 siz(static_cast<ushort2>(parSize * scaling + 0.5f));
const ushort2 pos(static_cast<ushort2>(parPos * parScaling + 0.5f));
const ushort2 siz(static_cast<ushort2>(parSize * parScaling + 0.5f));
const int screenHeight = m_sdlmain->WidthHeight().y();
const SDL_Rect dest = { pos.x(), screenHeight - pos.y() - siz.y(), siz.x(), siz.y() };
SDL_RenderCopy(m_sdlmain->GetRenderer(), m_texture, nullptr, &dest);