From d401376ea4822bc0afb02b0cec3926191ecf77d3 Mon Sep 17 00:00:00 2001 From: obligaron Date: Thu, 21 Oct 2021 06:52:52 +0200 Subject: [PATCH] Fix hardware cursor gets white when switching game --- Source/hwcursor.hpp | 5 +++++ Source/menu.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/Source/hwcursor.hpp b/Source/hwcursor.hpp index 02a5b3600..86485898e 100644 --- a/Source/hwcursor.hpp +++ b/Source/hwcursor.hpp @@ -51,6 +51,11 @@ public: return CursorInfo { CursorType::Game, gameSpriteId }; } + static CursorInfo UnknownCursor() + { + return CursorInfo { CursorType::Unknown }; + } + [[nodiscard]] CursorType type() const { return type_; diff --git a/Source/menu.cpp b/Source/menu.cpp index 23d2743b7..7d41f395f 100644 --- a/Source/menu.cpp +++ b/Source/menu.cpp @@ -8,6 +8,7 @@ #include "DiabloUI/extrasmenu.h" #include "DiabloUI/selok.h" #include "engine/demomode.h" +#include "hwcursor.hpp" #include "init.h" #include "movie.h" #include "options.h" @@ -193,6 +194,8 @@ void mainmenu_loop() UiInitialize(); FreeItemGFX(); InitItemGFX(); + if (IsHardwareCursor()) + SetHardwareCursor(CursorInfo::UnknownCursor()); RefreshMusic(); menu = MAINMENU_NONE; break;