MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DebugLoop

Method DebugLoop

Source/Scripting/angelscript/asdebugger.cpp:447–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447void ASDebugger::DebugLoop() {
448 Graphics* graphics = Graphics::Instance();
449 Input* input = Input::Instance();
450
451 input->cursor->SetVisible(true);
452 input->SetGrabMouse(false);
453 while (paused) {
454 ctx->ClearLineCallback();
455 PollEvents();
456
457 bool imgui_begun = true; // ImGui::FrameBegun();
458 if (imgui_begun) {
459 ImGui::EndFrame();
460 }
461
462 ImGui_ImplSdlGL3_NewFrame(graphics->sdl_window_, input->GetGrabMouse());
463 bool update_variables = true;
464 switch (UpdateGUI()) {
465 case CONTINUE:
466 continue_break = false;
467 ctx->SetLineCallback(asMETHOD(ASDebugger, Continue), this, asCALL_THISCALL);
468 paused = false;
469 do {
470 int ret = ctx->Execute();
471 if (ret == asEXECUTION_FINISHED) {
472 ctx->SetLineCallback(asMETHOD(ASDebugger, LineCallback), this, asCALL_THISCALL);
473 ImGui::Render();
474 if (imgui_begun) {
475 ImGui_ImplSdlGL3_NewFrame(graphics->sdl_window_, input->GetGrabMouse());
476 }
477 return;
478 }
479 } while (!paused);
480 break;
481 case OVER:
482 current_stack_level = ctx->GetCallstackSize();
483 ctx->SetLineCallback(asMETHOD(ASDebugger, StepOver), this, asCALL_THISCALL);
484 paused = false;
485 do {
486 int ret = ctx->Execute();
487 if (ret == asEXECUTION_FINISHED) {
488 ctx->SetLineCallback(asMETHOD(ASDebugger, LineCallback), this, asCALL_THISCALL);
489 ImGui::Render();
490 if (imgui_begun) {
491 ImGui_ImplSdlGL3_NewFrame(graphics->sdl_window_, input->GetGrabMouse());
492 }
493 return;
494 }
495 } while (!paused);
496 break;
497 case INTO:
498 ctx->SetLineCallback(asMETHOD(ASDebugger, StepInto), this, asCALL_THISCALL);
499 paused = false;
500 do {
501 int ret = ctx->Execute();
502 if (ret == asEXECUTION_FINISHED) {
503 ctx->SetLineCallback(asMETHOD(ASDebugger, LineCallback), this, asCALL_THISCALL);
504 ImGui::Render();

Callers

nothing calls this directly

Calls 15

SDL_TS_GetTicksFunction · 0.85
SetGrabMouseMethod · 0.80
ClearLineCallbackMethod · 0.80
GetGrabMouseMethod · 0.80
SetLineCallbackMethod · 0.80
GetCallstackSizeMethod · 0.80
PushViewportMethod · 0.80
PushFramebufferMethod · 0.80
bindFramebufferMethod · 0.80
SwapToScreenMethod · 0.80
PopFramebufferMethod · 0.80

Tested by

no test coverage detected