diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-27 11:08:50 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-27 11:08:50 +0100 |
commit | 72e605528ebe8347e1457358fe9025c215afe163 (patch) | |
tree | bd193e4805e7e600356f7d09a8971199cce8783b /src/crepe/facade | |
parent | 3b433353a83c2436b69f73ca1048842d906b1147 (diff) |
implemented feedback, removed width so that user only can set height.
Diffstat (limited to 'src/crepe/facade')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index 6e22316..abb3cb7 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -112,17 +112,8 @@ SDL_Rect SDLContext::get_src_rect(const Sprite & sprite) const { SDL_Rect SDLContext::get_dst_rect(const Sprite & sprite, const vec2 & pos, const Camera & cam, const double & img_scale) const { - int width, height; - - if (sprite.width > sprite.height) { - width = sprite.width; - height = sprite.width / sprite.aspect_ratio; - } else { - height = sprite.height; - width = sprite.height * sprite.aspect_ratio; - } - - cout << width << " " << height << " " << " " << sprite.aspect_ratio << endl; + int width = sprite.height * sprite.aspect_ratio; + int height = sprite.height; width *= img_scale * cam.zoom; height *= img_scale * cam.zoom; |