diff options
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 8 | ||||
-rw-r--r-- | src/crepe/facade/SDLContext.h | 2 | ||||
-rw-r--r-- | src/crepe/system/RenderSystem.h | 1 | ||||
-rw-r--r-- | src/example/rendering_particle.cpp | 7 |
4 files changed, 8 insertions, 10 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index dc3f362..6fb312b 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -153,13 +153,13 @@ SDL_FRect SDLContext::get_dst_rect(const DestinationRectangleData & ctx) const { size *= cam_aux_data.render_scale * ctx.img_scale * data.scale_offset; if (ctx.sprite.data.world_space) { - screen_pos = (screen_pos - cam_aux_data.cam_pos - + cam_aux_data.zoomed_viewport / 2) + screen_pos = (screen_pos - cam_aux_data.cam_pos + cam_aux_data.zoomed_viewport / 2) * cam_aux_data.render_scale - size / 2 + cam_aux_data.bar_size; } else { - screen_pos = (screen_pos + cam_aux_data.zoomed_viewport / 2) * cam_aux_data.render_scale - - size / 2 + cam_aux_data.bar_size; + screen_pos + = (screen_pos + cam_aux_data.zoomed_viewport / 2) * cam_aux_data.render_scale + - size / 2 + cam_aux_data.bar_size; } cout << "HALLO" << endl; diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index 7f07d34..e570073 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -19,9 +19,9 @@ #include "api/Sprite.h" #include "api/Transform.h" -#include "types.h" #include "EventData.h" #include "FontFacade.h" +#include "types.h" namespace crepe { class Texture; diff --git a/src/crepe/system/RenderSystem.h b/src/crepe/system/RenderSystem.h index ed55dd5..14e5c2d 100644 --- a/src/crepe/system/RenderSystem.h +++ b/src/crepe/system/RenderSystem.h @@ -66,7 +66,6 @@ private: * \return returns a sorted reference vector */ RefVector<Sprite> sort(RefVector<Sprite> & objs) const; - }; } // namespace crepe diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp index b623596..5440fdd 100644 --- a/src/example/rendering_particle.cpp +++ b/src/example/rendering_particle.cpp @@ -38,7 +38,7 @@ public: .size = {1, 1}, .angle_offset = 0, .position_offset = {0, 1}, - .world_space = false, + .world_space = false, }); //auto & emitter = game_object.add_component<ParticleEmitter>(test_sprite, ParticleEmitter::Data{}); @@ -47,16 +47,15 @@ public: .color = color, .size = {1, 1}, .position_offset = {0, -1}, - .world_space = false, + .world_space = false, }); auto & cam = game_object.add_component<Camera>(ivec2{1280, 720}, vec2{5, 5}, Camera::Data{ .bg_color = Color::WHITE, - .postion_offset = {1000,1000}, + .postion_offset = {1000, 1000}, }); - /* game_object.add_component<Text>(vec2{1, 1}, vec2{0, -0.5}, "ComicSansMS", Text::Data{.text_color = Color::RED}, "test TEST"); |