mirror of
https://github.com/rei-kes/Amalgam.git
synced 2025-06-15 21:47:21 +08:00
Make iCursor threadsafe.
This commit is contained in:
parent
6f22959aec
commit
0f511b7f24
@ -2307,7 +2307,8 @@ void CMenu::Render()
|
||||
AddDraggable("Conditions", Vars::Menu::ConditionsDisplay, FGet(Vars::Menu::Indicators) & (1 << 4));
|
||||
AddDraggable("Seed prediction", Vars::Menu::SeedPredictionDisplay, FGet(Vars::Menu::Indicators) & (1 << 5));
|
||||
|
||||
F::Render.Cursor = GetMouseCursor();
|
||||
//F::Render.Cursor = GetMouseCursor();
|
||||
F::Render.m_iCursor.store(ImGui::GetMouseCursor());
|
||||
}
|
||||
else
|
||||
mActives.clear();
|
||||
|
@ -3,6 +3,8 @@
|
||||
#include <ImGui/imgui_impl_dx9.h>
|
||||
#include <ImGui/imgui.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
class CRender
|
||||
{
|
||||
public:
|
||||
@ -12,7 +14,7 @@ public:
|
||||
void LoadColors();
|
||||
void LoadStyle();
|
||||
|
||||
int Cursor = 2;
|
||||
std::atomic<int> m_iCursor = ATOMIC_VAR_INIT(0);
|
||||
|
||||
// Colors
|
||||
ImColor Accent = { 255, 101, 101 };
|
||||
|
@ -82,7 +82,8 @@ MAKE_HOOK(VGuiSurface_SetCursor, U::Memory.GetVFunc(I::MatSystemSurface, 51), vo
|
||||
{
|
||||
if (F::Menu.IsOpen)
|
||||
{
|
||||
switch (F::Render.Cursor)
|
||||
auto iCursor = F::Render.m_iCursor.load();
|
||||
switch(iCursor)
|
||||
{
|
||||
case 0: cursor = 2; break;
|
||||
case 1: cursor = 3; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user