feature: Added profiler which outputs to tty, removed subdivision entirely - to be remade later

This commit is contained in:
2025-09-04 18:04:30 +02:00
parent 8151f3864c
commit 55c1d2c39b
8 changed files with 314 additions and 311 deletions

44
src/profiler.hh Normal file
View File

@@ -0,0 +1,44 @@
#pragma once
#include <stdint.h>
namespace psxsplash::debug {
enum ProfilerSection {
PROFILER_RENDERING,
PROFILER_LUA,
PROFILER_CONTROLS,
PROFILER_NAVMESH,
};
class Profiler {
public:
// Singleton accessor
static Profiler& getInstance() {
static Profiler instance;
return instance;
}
void initialize();
void reset();
void dumpToTTY();
void setSectionTime(ProfilerSection section, uint32_t time) {
sectionTimes[section] = time;
}
private:
Profiler() = default;
~Profiler() = default;
// Delete copy/move semantics
Profiler(const Profiler&) = delete;
Profiler& operator=(const Profiler&) = delete;
Profiler(Profiler&&) = delete;
Profiler& operator=(Profiler&&) = delete;
uint32_t sectionTimes[4] = {0, 0, 0, 0};
};
} // namespace psxsplash::debug