Flip vertical axis.

This commit is contained in:
King_DuckZ 2014-02-22 17:07:02 +01:00
parent 0978206a6c
commit 897e4fd271

View file

@ -225,7 +225,8 @@ namespace cloonel {
///-------------------------------------------------------------------------- ///--------------------------------------------------------------------------
void Texture::Render (int2 parPos, ushort2 parSize) const { void Texture::Render (int2 parPos, ushort2 parSize) const {
assert(IsLoaded()); assert(IsLoaded());
const SDL_Rect dest = { parPos.x(), parPos.y(), parSize.x(), parSize.y() }; const int screenHeight = m_sdlmain->DefWidthHeight().y();
const SDL_Rect dest = { parPos.x(), screenHeight - parPos.y() - parSize.y(), parSize.x(), parSize.y() };
SDL_RenderCopy(m_sdlmain->GetRenderer(), m_texture, nullptr, &dest); SDL_RenderCopy(m_sdlmain->GetRenderer(), m_texture, nullptr, &dest);
} }
} //namespace cloonel } //namespace cloonel