aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-30 21:03:11 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-30 21:03:11 +0100
commit3afcae9dd472ead2d5f2b667fc6479f8ee6db10c (patch)
tree9fda1dc74d453a1f68796b5a0987ba5e32339a21 /src/crepe/facade/SDLContext.cpp
parent6ae0b9038e432869b506cbdfe2779e97d3732d87 (diff)
make format
Diffstat (limited to 'src/crepe/facade/SDLContext.cpp')
-rw-r--r--src/crepe/facade/SDLContext.cpp13
1 files changed, 7 insertions, 6 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;