From b17ea43b659fb0b20857d8309aba820ffd3fe127 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 22 Feb 2022 13:47:27 +0000 Subject: [PATCH] Remove some static variables that aren't needed --- renderdoc/core/core.cpp | 14 ++++---------- renderdoc/core/core.h | 5 +++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp index bf464f654..e69e2e6b1 100644 --- a/renderdoc/core/core.cpp +++ b/renderdoc/core/core.cpp @@ -275,12 +275,9 @@ rdcstr DoStringise(const SystemChunk &el) END_ENUM_STRINGISE(); } -RenderDoc *RenderDoc::m_Inst = NULL; - RenderDoc &RenderDoc::Inst() { static RenderDoc realInst; - RenderDoc::m_Inst = &realInst; return realInst; } @@ -888,9 +885,6 @@ bool RenderDoc::ShowReplayUI() void RenderDoc::Tick() { - static bool prev_focus = false; - static bool prev_cap = false; - bool cur_focus = false; for(size_t i = 0; i < m_FocusKeys.size(); i++) cur_focus |= Keyboard::GetKeyState(m_FocusKeys[i]); @@ -901,17 +895,17 @@ void RenderDoc::Tick() m_FrameTimer.UpdateTimers(); - if(!prev_focus && cur_focus) + if(!m_PrevFocus && cur_focus) { CycleActiveWindow(); } - if(!prev_cap && cur_cap) + if(!m_PrevCap && cur_cap) { TriggerCapture(1); } - prev_focus = cur_focus; - prev_cap = cur_cap; + m_PrevFocus = cur_focus; + m_PrevCap = cur_cap; // check for any child threads that need to be waited on, remove them from the list rdcarray waitThreads; diff --git a/renderdoc/core/core.h b/renderdoc/core/core.h index 78d046ee3..20421c23a 100644 --- a/renderdoc/core/core.h +++ b/renderdoc/core/core.h @@ -591,12 +591,13 @@ private: void SyncAvailableGPUThread(); - static RenderDoc *m_Inst; - bool m_Replay; uint32_t m_Cap; + bool m_PrevFocus = false; + bool m_PrevCap = false; + rdcarray m_FocusKeys; rdcarray m_CaptureKeys;