diff --git a/Core/Core.cpp b/Core/Core.cpp index 9d4a280e2c..0c5b37ddc1 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -54,6 +54,7 @@ static std::mutex m_hStepMutex; static std::condition_variable m_InactiveCond; static std::mutex m_hInactiveMutex; static bool singleStepPending = false; +static int steppingCounter = 0; static std::set shutdownFuncs; static bool windowHidden = false; static double lastActivity = 0.0; @@ -334,6 +335,7 @@ void Core_EnableStepping(bool step) { sleep_ms(1); host->SetDebugMode(true); Core_UpdateState(CORE_STEPPING); + steppingCounter++; } else { host->SetDebugMode(false); coreState = CORE_RUNNING; @@ -341,3 +343,7 @@ void Core_EnableStepping(bool step) { m_StepCond.notify_all(); } } + +int Core_GetSteppingCounter() { + return steppingCounter; +} diff --git a/Core/Core.h b/Core/Core.h index 9adbd6356e..1c98ccdc49 100644 --- a/Core/Core.h +++ b/Core/Core.h @@ -31,12 +31,12 @@ void Core_ErrorPause(); // For platforms that don't call Core_Run void Core_SetGraphicsContext(GraphicsContext *ctx); -void Core_RunRenderThreadFrame(); - // called from gui void Core_EnableStepping(bool step); void Core_DoSingleStep(); void Core_UpdateSingleStep(); +// Changes every time we enter stepping. +int Core_GetSteppingCounter(); typedef void (* Core_ShutdownFunc)(); void Core_ListenShutdown(Core_ShutdownFunc func);