diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-30 21:03:11 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-30 21:03:11 +0100 |
commit | 3afcae9dd472ead2d5f2b667fc6479f8ee6db10c (patch) | |
tree | 9fda1dc74d453a1f68796b5a0987ba5e32339a21 /src/crepe/facade | |
parent | 6ae0b9038e432869b506cbdfe2779e97d3732d87 (diff) |
make format
Diffstat (limited to 'src/crepe/facade')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 13 | ||||
-rw-r--r-- | src/crepe/facade/SDLContext.h | 1 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index f0a21d5..9c2ead4 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -113,11 +113,12 @@ SDL_Rect SDLContext::get_src_rect(const Sprite & sprite) const { SDL_FRect SDLContext::get_dst_rect(const DstRect & ctx) const { - - vec2 size = { - ctx.sprite.size.x == 0 && ctx.sprite.size.y != 0 ? ctx.sprite.size.y * ctx.sprite.aspect_ratio : ctx.sprite.size.x, - ctx.sprite.size.y == 0 && ctx.sprite.size.x != 0 ? ctx.sprite.size.x / ctx.sprite.aspect_ratio : ctx.sprite.size.y - }; + vec2 size = {ctx.sprite.size.x == 0 && ctx.sprite.size.y != 0 + ? ctx.sprite.size.y * ctx.sprite.aspect_ratio + : ctx.sprite.size.x, + ctx.sprite.size.y == 0 && ctx.sprite.size.x != 0 + ? ctx.sprite.size.x / ctx.sprite.aspect_ratio + : ctx.sprite.size.y}; const CameraValues & cam = ctx.cam; @@ -169,7 +170,7 @@ void SDLContext::set_camera(const Camera & cam, CameraValues & ctx) { double screen_aspect = static_cast<double>(cam.screen.x) / cam.screen.y; double viewport_aspect = zoomed_viewport.x / zoomed_viewport.y; - // calculate black bars + // calculate black bars if (screen_aspect > viewport_aspect) { // pillarboxing float scale = cam.screen.y / zoomed_viewport.y; diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index 285eee2..cd52be6 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -45,7 +45,6 @@ public: const double & scale; }; - public: /** * \brief Gets the singleton instance of SDLContext. |