From d7de0f19ca561651066968d16bc58560a53883d3 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 9 Oct 2020 08:42:24 -0700 Subject: [PATCH] Rot fix --- BeefLibs/SDL2/src/SDLApp.bf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BeefLibs/SDL2/src/SDLApp.bf b/BeefLibs/SDL2/src/SDLApp.bf index 922a0fb8..cc95a8dd 100644 --- a/BeefLibs/SDL2/src/SDLApp.bf +++ b/BeefLibs/SDL2/src/SDLApp.bf @@ -178,11 +178,12 @@ namespace SDL2 SDL.RenderCopy(mRenderer, image.mTexture, &srcRect, &destRect); } - public void Draw(Image image, float x, float y, float rot) + public void Draw(Image image, float x, float y, float rot, float centerX, float centerY) { SDL.Rect srcRect = .(0, 0, image.mSurface.w, image.mSurface.h); SDL.Rect destRect = .((int32)x, (int32)y, image.mSurface.w, image.mSurface.h); - SDL.RenderCopyEx(mRenderer, image.mTexture, &srcRect, &destRect, 0, null, .None); + SDL.Point centerPoint = .((.)centerX, (.)centerY); + SDL.RenderCopyEx(mRenderer, image.mTexture, &srcRect, &destRect, rot, ¢erPoint, .None); } public void PlaySound(Sound sound, float volume = 1.0f, float pan = 0.5f)