diff --git a/client/renderSDL/CursorHardware.cpp b/client/renderSDL/CursorHardware.cpp index 619eab0d5..cbcfaeac2 100644 --- a/client/renderSDL/CursorHardware.cpp +++ b/client/renderSDL/CursorHardware.cpp @@ -12,7 +12,7 @@ #include "CursorHardware.h" #include "../gui/CGuiHandler.h" -#include "../renderSDL/ScreenHandler.h" +#include "../render/IScreenHandler.h" #include "../render/Colors.h" #include "../render/IImage.h" #include "SDL_Extensions.h" @@ -45,7 +45,7 @@ void CursorHardware::setVisible(bool on) void CursorHardware::setImage(std::shared_ptr image, const Point & pivotOffset) { - auto cursorSurface = CSDL_Ext::newSurface(image->dimensions()); + auto cursorSurface = CSDL_Ext::newSurface(image->dimensions() * GH.screenHandler().getScalingFactor()); CSDL_Ext::fillSurface(cursorSurface, CSDL_Ext::toSDL(Colors::TRANSPARENCY)); diff --git a/client/renderSDL/CursorSoftware.cpp b/client/renderSDL/CursorSoftware.cpp index cc3cd0c5a..e5d5a9c09 100644 --- a/client/renderSDL/CursorSoftware.cpp +++ b/client/renderSDL/CursorSoftware.cpp @@ -11,6 +11,8 @@ #include "StdInc.h" #include "CursorSoftware.h" +#include "../gui/CGuiHandler.h" +#include "../render/IScreenHandler.h" #include "../render/Colors.h" #include "../render/IImage.h" #include "../CMT.h" @@ -30,8 +32,8 @@ void CursorSoftware::render() SDL_Rect destRect; destRect.x = renderPos.x; destRect.y = renderPos.y; - destRect.w = 40; - destRect.h = 40; + destRect.w = cursorSurface->w; + destRect.h = cursorSurface->h; SDL_RenderCopy(mainRenderer, cursorTexture, nullptr, &destRect); } @@ -53,8 +55,13 @@ void CursorSoftware::createTexture(const Point & dimensions) void CursorSoftware::updateTexture() { - if (!cursorSurface || Point(cursorSurface->w, cursorSurface->h) != cursorImage->dimensions()) - createTexture(cursorImage->dimensions()); + if (!cursorSurface) + createTexture(cursorImage->dimensions() * GH.screenHandler().getScalingFactor()); + + Point currentSize = Point(cursorSurface->w, cursorSurface->h); + + if (currentSize != cursorImage->dimensions() * GH.screenHandler().getScalingFactor()) + createTexture(cursorImage->dimensions() * GH.screenHandler().getScalingFactor()); CSDL_Ext::fillSurface(cursorSurface, CSDL_Ext::toSDL(Colors::TRANSPARENCY));