1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Clean surface before using it

This commit is contained in:
Ivan Savenko
2023-01-05 23:24:49 +02:00
parent c6d39da53e
commit 385dda1c5b

View File

@@ -373,6 +373,9 @@ void CursorHardware::setImage(std::shared_ptr<IImage> image, const Point & pivot
{
auto cursorSurface = CSDL_Ext::newSurface(image->dimensions().x, image->dimensions().y);
Uint32 fillColor = SDL_MapRGBA(cursorSurface->format, 0, 0, 0, 0);
CSDL_Ext::fillRect(cursorSurface, nullptr, fillColor);
image->draw(cursorSurface);
auto oldCursor = cursor;