From 114e3b5793a9e34316545cad635d4930577c497a Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Fri, 17 Apr 2026 23:29:33 +0200 Subject: [PATCH] fix posteffect rotation and float error --- Source/Managers/PostProcessMan.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/Managers/PostProcessMan.cpp b/Source/Managers/PostProcessMan.cpp index 9c0e0ff2bc..a89a3bd36e 100644 --- a/Source/Managers/PostProcessMan.cpp +++ b/Source/Managers/PostProcessMan.cpp @@ -19,6 +19,7 @@ #include "tracy/Tracy.hpp" #include "tracy/TracyOpenGL.hpp" +#include "raylib/raylib.h" #include @@ -408,9 +409,8 @@ void PostProcessMan::DrawDotGlowEffects() { } void PostProcessMan::DrawPostScreenEffects() { - BITMAP* effectBitmap = nullptr; - float effectPosX = 0; - float effectPosY = 0; + int effectPosX = 0; + int effectPosY = 0; unsigned char effectStrength = 0; GL_CHECK(glActiveTexture(GL_TEXTURE0)); @@ -421,11 +421,16 @@ void PostProcessMan::DrawPostScreenEffects() { for (const PostEffect& postEffect: m_PostScreenEffects) { if (postEffect.m_Bitmap) { - effectBitmap = postEffect.m_Bitmap; effectStrength = postEffect.m_Strength; - effectPosX = postEffect.m_Pos.m_X - postEffect.m_Bitmap->w / 2; - effectPosY = postEffect.m_Pos.m_Y - postEffect.m_Bitmap->h / 2; - DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(postEffect.m_Bitmap), effectPosX, effectPosY, {.r=effectStrength, .g=effectStrength, .b=effectStrength, .a=255}); + effectPosX = postEffect.m_Pos.GetFloorIntX(); + effectPosY = postEffect.m_Pos.GetFloorIntY(); + DrawTexturePro( + g_GLResourceMan.GetStaticTextureFromBitmap(postEffect.m_Bitmap), + Rectangle(0, 0, postEffect.m_Bitmap->w, postEffect.m_Bitmap->h), + Rectangle(effectPosX, effectPosY, postEffect.m_Bitmap->w, postEffect.m_Bitmap->h), + Vector2(postEffect.m_Bitmap->w / 2, postEffect.m_Bitmap->h / 2), + postEffect.m_Angle, + {.r=effectStrength, .g=effectStrength, .b=effectStrength, .a=255}); } } }