diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-04 10:57:20 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-04 10:57:20 +0100 |
commit | 9cde6875186b335c75eafa6402f0957cd4252c76 (patch) | |
tree | d2e6293661ddfa1dfbc0bbbf5ba1f20355d37604 /src/crepe/facade/SDLContext.cpp | |
parent | a11824956b478e356fa684c9d88b980aa22cb19a (diff) |
make format
Diffstat (limited to 'src/crepe/facade/SDLContext.cpp')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index d3a15d9..86969ed 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -114,9 +114,10 @@ SDL_FRect SDLContext::get_dst_rect(const DstRect & ctx) const { const Sprite::Data & data = ctx.sprite.data; - vec2 size = { - data.size.x == 0 && data.size.y != 0 ? data.size.y * ctx.sprite.aspect_ratio : data.size.x, - data.size.y == 0 && data.size.x != 0 ? data.size.x / ctx.sprite.aspect_ratio : data.size.y}; + vec2 size = {data.size.x == 0 && data.size.y != 0 ? data.size.y * ctx.sprite.aspect_ratio + : data.size.x, + data.size.y == 0 && data.size.x != 0 ? data.size.x / ctx.sprite.aspect_ratio + : data.size.y}; const CameraValues & cam = ctx.cam; @@ -180,8 +181,7 @@ SDLContext::CameraValues SDLContext::set_camera(const Camera & cam) { float adj_width = zoomed_viewport.x * scale; float bar_width = (cam.screen.x - adj_width) / 2; this->black_bars[0] = {0, 0, bar_width, (float) cam.screen.y}; - this->black_bars[1] - = {(cam.screen.x - bar_width), 0, bar_width, (float) cam.screen.y}; + this->black_bars[1] = {(cam.screen.x - bar_width), 0, bar_width, (float) cam.screen.y}; bar_size = {bar_width, 0}; render_scale.x = render_scale.y = scale; @@ -211,7 +211,6 @@ SDLContext::CameraValues SDLContext::set_camera(const Camera & cam) { // fill bg color SDL_RenderFillRect(this->game_renderer.get(), &bg); - return ret_cam; } |