mirror of
https://github.com/rei-kes/Amalgam.git
synced 2025-06-15 21:07:33 +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("Conditions", Vars::Menu::ConditionsDisplay, FGet(Vars::Menu::Indicators) & (1 << 4));
|
||||||
AddDraggable("Seed prediction", Vars::Menu::SeedPredictionDisplay, FGet(Vars::Menu::Indicators) & (1 << 5));
|
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
|
else
|
||||||
mActives.clear();
|
mActives.clear();
|
||||||
|
@ -30,7 +30,7 @@ void CRender::Render(IDirect3DDevice9* pDevice)
|
|||||||
PushFont(FontRegular);
|
PushFont(FontRegular);
|
||||||
|
|
||||||
F::Menu.Render();
|
F::Menu.Render();
|
||||||
|
|
||||||
PopFont();
|
PopFont();
|
||||||
|
|
||||||
EndFrame();
|
EndFrame();
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include <ImGui/imgui_impl_dx9.h>
|
#include <ImGui/imgui_impl_dx9.h>
|
||||||
#include <ImGui/imgui.h>
|
#include <ImGui/imgui.h>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
class CRender
|
class CRender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -12,7 +14,7 @@ public:
|
|||||||
void LoadColors();
|
void LoadColors();
|
||||||
void LoadStyle();
|
void LoadStyle();
|
||||||
|
|
||||||
int Cursor = 2;
|
std::atomic<int> m_iCursor = ATOMIC_VAR_INIT(0);
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
ImColor Accent = { 255, 101, 101 };
|
ImColor Accent = { 255, 101, 101 };
|
||||||
|
@ -82,7 +82,8 @@ MAKE_HOOK(VGuiSurface_SetCursor, U::Memory.GetVFunc(I::MatSystemSurface, 51), vo
|
|||||||
{
|
{
|
||||||
if (F::Menu.IsOpen)
|
if (F::Menu.IsOpen)
|
||||||
{
|
{
|
||||||
switch (F::Render.Cursor)
|
auto iCursor = F::Render.m_iCursor.load();
|
||||||
|
switch(iCursor)
|
||||||
{
|
{
|
||||||
case 0: cursor = 2; break;
|
case 0: cursor = 2; break;
|
||||||
case 1: cursor = 3; break;
|
case 1: cursor = 3; break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user