Add debug files

This commit is contained in:
izzy2lost
2025-07-28 00:08:57 +00:00
committed by GitHub
parent e866a11b83
commit eeb20a9ba8
2 changed files with 87 additions and 0 deletions
@@ -0,0 +1,54 @@
#include "GfxDebugger.h"
#include <stddef.h>
namespace Fast {
void GfxDebugger::ResumeGame() {
mIsDebugging = false;
mIsDebuggingRequested = false;
mDlist = nullptr;
}
const F3DGfx* GfxDebugger::GetDisplayList() const {
return mDlist;
}
const std::vector<const F3DGfx*>& GfxDebugger::GetBreakPoint() const {
return mBreakPoint;
}
void GfxDebugger::SetBreakPoint(const std::vector<const F3DGfx*>& bp) {
mBreakPoint = bp;
}
void GfxDebugger::RequestDebugging() {
mIsDebuggingRequested = true;
}
bool GfxDebugger::IsDebugging() const {
return mIsDebugging;
}
bool GfxDebugger::IsDebuggingRequested() const {
return mIsDebuggingRequested;
}
void GfxDebugger::DebugDisplayList(F3DGfx* cmds) {
mDlist = cmds;
mIsDebuggingRequested = false;
mIsDebugging = true;
mBreakPoint = { cmds };
}
bool GfxDebugger::HasBreakPoint(const std::vector<const F3DGfx*>& path) const {
if (path.size() != mBreakPoint.size())
return false;
for (size_t i = 0; i < path.size(); i++) {
if (path[i] != mBreakPoint[i]) {
return false;
}
}
return true;
}
} // namespace Fast
@@ -0,0 +1,33 @@
#pragma once
#include <vector>
namespace Fast {
union F3DGfx;
class GfxDebugger {
public:
void RequestDebugging();
bool IsDebugging() const;
bool IsDebuggingRequested() const;
void DebugDisplayList(F3DGfx* cmds);
void ResumeGame();
const F3DGfx* GetDisplayList() const;
const std::vector<const F3DGfx*>& GetBreakPoint() const;
bool HasBreakPoint(const std::vector<const F3DGfx*>& path) const;
void SetBreakPoint(const std::vector<const F3DGfx*>& bp);
private:
bool mIsDebugging = false;
bool mIsDebuggingRequested = false;
F3DGfx* mDlist = nullptr;
std::vector<const F3DGfx*> mBreakPoint = {};
};
} // namespace Fast