diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-16 21:14:46 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-16 21:14:46 +0100 |
commit | 16f3aa77cfbfd3327a50a3f11f27e7d7dd303026 (patch) | |
tree | e57bc35f9d784e9b93d9ff77428c0612ae835603 /src/crepe/system/RenderSystem.cpp | |
parent | b2a7105fa88b7d23dcb5b698c3c10b76c19c789b (diff) |
Added util for position
Diffstat (limited to 'src/crepe/system/RenderSystem.cpp')
-rw-r--r-- | src/crepe/system/RenderSystem.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp index afd9548..d14d78d 100644 --- a/src/crepe/system/RenderSystem.cpp +++ b/src/crepe/system/RenderSystem.cpp @@ -13,6 +13,7 @@ #include "../facade/Texture.h" #include "../manager/ComponentManager.h" #include "../manager/ResourceManager.h" +#include "util/AbsoluutPosition.h" #include "RenderSystem.h" #include "types.h" @@ -105,11 +106,11 @@ void RenderSystem::render_normal(const Sprite & sprite, const Transform & tm) { SDLContext & ctx = this->mediator.sdl_context; ResourceManager & resource_manager = this->mediator.resource_manager; const Texture & res = resource_manager.get<Texture>(sprite.source); - + vec2 pos = AbsoluutPosition::get_position(tm,sprite.data.position_offset); ctx.draw(SDLContext::RenderContext{ .sprite = sprite, .texture = res, - .pos = tm.position, + .pos = pos, .angle = tm.rotation, .scale = tm.scale, }); |