aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/facade')
-rw-r--r--src/crepe/facade/SDLContext.cpp11
-rw-r--r--src/crepe/facade/SDLContext.h3
2 files changed, 6 insertions, 8 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp
index 72542e8..4887d35 100644
--- a/src/crepe/facade/SDLContext.cpp
+++ b/src/crepe/facade/SDLContext.cpp
@@ -40,7 +40,7 @@ SDLContext::SDLContext() {
auto & cfg = Config::get_instance().win_set;
SDL_Window * tmp_window
= SDL_CreateWindow("Crepe Game Engine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
- cfg.def_size.x,cfg.def_size.y, 0);
+ cfg.def_size.x, cfg.def_size.y, 0);
if (!tmp_window) {
throw runtime_error(format("SDLContext: SDL_Window error: {}", SDL_GetError()));
}
@@ -134,7 +134,7 @@ void SDLContext::draw_particle(const Sprite & sprite, const vec2 & pos, const do
| (SDL_FLIP_VERTICAL * sprite.flip.flip_y));
SDL_Rect srcrect = this->get_src_rect(sprite);
- SDL_Rect dstrect = this->get_dst_rect(sprite, pos, cam , img_scale);
+ SDL_Rect dstrect = this->get_dst_rect(sprite, pos, cam, img_scale);
SDL_RenderCopyEx(this->game_renderer.get(), sprite.sprite_image.texture.get(), &srcrect,
&dstrect, angle, NULL, render_flip);
@@ -147,8 +147,7 @@ void SDLContext::draw(const Sprite & sprite, const Transform & transform, const
| (SDL_FLIP_VERTICAL * sprite.flip.flip_y));
SDL_Rect srcrect = this->get_src_rect(sprite);
- SDL_Rect dstrect
- = this->get_dst_rect(sprite, transform.position, cam, transform.scale);
+ SDL_Rect dstrect = this->get_dst_rect(sprite, transform.position, cam, transform.scale);
SDL_RenderCopyEx(this->game_renderer.get(), sprite.sprite_image.texture.get(), &srcrect,
&dstrect, transform.rotation, NULL, render_flip);
@@ -157,9 +156,9 @@ void SDLContext::draw(const Sprite & sprite, const Transform & transform, const
void SDLContext::set_camera(const Camera & cam) {
// resize window
- int w,h;
+ int w, h;
SDL_GetWindowSize(this->game_window.get(), &w, &h);
- if ( w != cam.screen.x || h != cam.screen.y) {
+ if (w != cam.screen.x || h != cam.screen.y) {
SDL_SetWindowSize(this->game_window.get(), cam.screen.x, cam.screen.y);
}
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h
index 2e40b6f..35d667d 100644
--- a/src/crepe/facade/SDLContext.h
+++ b/src/crepe/facade/SDLContext.h
@@ -9,9 +9,9 @@
#include <memory>
#include <string>
+#include "../api/Camera.h"
#include "../api/Sprite.h"
#include "../api/Transform.h"
-#include "../api/Camera.h"
#include "types.h"
@@ -172,7 +172,6 @@ private:
//! renderer for the crepe engine
std::unique_ptr<SDL_Renderer, std::function<void(SDL_Renderer *)>> game_renderer;
-
};
} // namespace crepe