From 5435a055bde131e500e5b59899ecc5e894304b84 Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 1 Jan 2025 10:36:50 +1100 Subject: remove debugger thing --- Makefile | 5 +--- c2.cpp | 3 --- debugger.cpp | 74 ------------------------------------------------------------ debugger.hpp | 8 ------- 4 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 debugger.cpp delete mode 100644 debugger.hpp diff --git a/Makefile b/Makefile index 3fc811e..0828805 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ textures = $(data_dir)/22.tex $(data_dir)/kita.tex models = $(data_dir)/monkey.mdl packed_files = $(shaders) $(textures) $(models) tools = qstd cfg sc -objects = app.o c2.o video.o pipeline.o asset.o ui.o maths.o model.o debugger.o +objects = app.o c2.o video.o pipeline.o asset.o ui.o maths.o model.o includes = -Iqstd defines = -Dplat_x86 -Dplat_posix -Dplat_x11 -Dallocation_default_alignment=8 cflags = -MMD -MF $(basename $@).d $(includes) $(defines) $(DEBUG_COMPILE_FLAG) @@ -77,9 +77,6 @@ maths.o: model.o: $(CXX) -c $(cflags) model.cpp -o model.o -debugger.o: - $(CXX) -c $(cflags) debugger.cpp -o debugger.o - c2.o: $(CXX) -c $(cflags) c2.cpp -o c2.o diff --git a/c2.cpp b/c2.cpp index fb2aa38..fd02e50 100644 --- a/c2.cpp +++ b/c2.cpp @@ -1,5 +1,4 @@ #include "app.hpp" -#include "debugger.hpp" #include "model.hpp" #include "ui.hpp" #include "video.hpp" @@ -137,8 +136,6 @@ extern "C" int entrypoint() { v3f raxis(0.0f, 1.0f, 0.0); vbo = upload_verts(dev); ui->layout(app->w, app->h); - auto toolbar = ui->create_element(ui->root); - register_debuggers(ui, toolbar); auto fps_label = ui->create_element(ui->root, ""); while (app->running) { Arena frame_arena; diff --git a/debugger.cpp b/debugger.cpp deleted file mode 100644 index 6cda856..0000000 --- a/debugger.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "debugger.hpp" -extern "C" { -#include "plat.h" -} - -struct Vram_Debugger : UI::Modal { - UI::Element* enable_btn; - - Vram_Debugger(UI* ui, UI::Element* parent): - UI::Modal(ui, parent, "VRAM debugger") { - } -}; - -struct Device_Debugger : UI::Modal { - UI::Element* enable_btn; - - Device_Debugger(UI* ui, UI::Element* parent): - UI::Modal(ui, parent, "Device debugger") { - } -}; - -void create_vram_debugger( - UI* ui, - UI::Element* parent, - UI::Element* button -) { - auto window = ui->create_element(parent); - window->enable_btn = button; - window->handler = [](UI::Element* e, const UI::Message& m) { - if (m.type == UI::Message::Type::destroy) { - auto window = (Vram_Debugger*)e; - window->enable_btn->enable(); - } - return 0; - }; - ui->create_element(window->contents, "Hello, I'm the VRAM debugger!"); -} - -void create_device_debugger( - UI* ui, - UI::Element* parent, - UI::Element* button -) { - auto window = ui->create_element(parent); - window->enable_btn = button; - window->handler = [](UI::Element* e, const UI::Message& m) { - if (m.type == UI::Message::Type::destroy) { - auto window = (Device_Debugger*)e; - window->enable_btn->enable(); - } - return 0; - }; - ui->create_element(window->contents, "Hello, I'm the device debugger!"); -} - -void register_debuggers(UI* ui, UI::Toolbar* toolbar) { - auto btnvram = ui->create_element(toolbar, "VRAM Debugger"); - btnvram->handler = [](UI::Element* e, const UI::Message& m) { - if (m.type == UI::Message::Type::click) { - e->disable(); - create_vram_debugger(e->ui, e->ui->root, e); - } - return 0; - }; - auto btndevice = ui->create_element(toolbar, "Device Debugger"); - btndevice->handler = [](UI::Element* e, const UI::Message& m) { - if (m.type == UI::Message::Type::click) { - e->disable(); - create_device_debugger(e->ui, e->ui->root, e); - } - return 0; - }; -} - diff --git a/debugger.hpp b/debugger.hpp deleted file mode 100644 index 0124f13..0000000 --- a/debugger.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef debugger_hpp -#define debugger_hpp - -#include "ui.hpp" - -void register_debuggers(UI* ui, UI::Toolbar* toolbar); - -#endif -- cgit v1.2.3-54-g00ecf