From 08bb93804b46b99f5241596fe547081aa654d0fd Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Fri, 26 Oct 2018 02:03:10 +0200 Subject: [PATCH] Update Intercept x --- intercept | 2 +- src/scriptProfiler.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/intercept b/intercept index 64de582..3dff36c 160000 --- a/intercept +++ b/intercept @@ -1 +1 @@ -Subproject commit 64de582ed022c7341467dbbaa3dc7f0bab727e96 +Subproject commit 3dff36c78d8f032f8057257b8177144b0dd7db68 diff --git a/src/scriptProfiler.cpp b/src/scriptProfiler.cpp index b6ffd27..ecb4cea 100644 --- a/src/scriptProfiler.cpp +++ b/src/scriptProfiler.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #define BROFILER_ONLY @@ -100,10 +101,10 @@ class GameInstructionProfileScopeStart : public game_instruction { #else std::chrono::high_resolution_clock::now(), profiler.startNewScope(), #endif - state.eval->varspace->varspace.get("_this").val, + state.eval->local->variables.get("_this").value, eventDescription); - state.eval->varspace->varspace.insert( + state.eval->local->variables.insert( game_variable("1scp"sv, game_value(new GameDataProfileScope(std::move(data))), false) ); lastScopeStart = name; @@ -131,7 +132,7 @@ game_value createProfileScope(uintptr_t st, game_value_parameter name) { auto data = std::make_shared(name, std::chrono::high_resolution_clock::now(), profiler.startNewScope(), - sqf::str(state->eval->varspace->varspace.get("_this").val), //#TODO remove this. We don't want this + sqf::str(state->eval->local->variables.get("_this").value), //#TODO remove this. We don't want this found->second ); return game_value(new GameDataProfileScope(std::move(data))); @@ -196,7 +197,7 @@ game_value profileScript(uintptr_t stat, game_value_parameter par) { //CBA fastForEach if (par.get(1) && !par[1].is_nil()) { - state->eval->varspace->varspace.insert({ "_this"sv, par[1] }); + state->eval->local->variables.insert({ "_this"sv, par[1] }); } //prep for action @@ -484,7 +485,7 @@ uint32_t getRandColor() { return colors[colorsDist(rng)]; } -std::string getScriptFromFirstLine(game_instruction::sourcedocpos& pos, bool compact) {//https://github.com/dedmen/ArmaDebugEngine/blob/master/BIDebugEngine/BIDebugEngine/Script.cpp +std::string getScriptFromFirstLine(sourcedocpos& pos, bool compact) {//https://github.com/dedmen/ArmaDebugEngine/blob/master/BIDebugEngine/BIDebugEngine/Script.cpp if (pos.content.empty()) return pos.content.data(); auto needSourceFile = pos.sourcefile.empty(); int line = pos.sourceline + 1; @@ -838,7 +839,7 @@ class GameInstructionOperator : public game_instruction { static inline std::map descriptions; virtual bool exec(game_state& state, vm_context& t) { - if (false && !sqf::can_suspend() && !state.eval->varspace->varspace.has_key("1scp")) { + if (false && !sqf::can_suspend() && !state.eval->local->variables.has_key("1scp")) { auto found = descriptions.find(sdp.content.hash()); if (found == descriptions.end()) { found = descriptions.insert({ sdp.content.hash(),::Brofiler::EventDescription::Create(_operators->_name, sdp.sourcefile, sdp.sourceline) }).first; @@ -849,10 +850,10 @@ class GameInstructionOperator : public game_instruction { #else std::chrono::high_resolution_clock::now(), profiler.startNewScope(), #endif - state.eval->varspace->varspace.get("_this").val, + state.eval->local->variables.get("_this").value, (found->second)); auto newScope = new GameDataProfileScope(std::move(data)); - state.eval->varspace->varspace.insert( + state.eval->local->variables.insert( game_variable("1scp"sv, game_value(newScope), false) );