mirror of
https://github.com/izzy2lost/Starship.git
synced 2026-07-05 15:19:42 -07:00
Add debug files
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user