forked from Kenix3/libultraship
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BitConverter: fix type correcteness in loop * gbi: get rid of LoadUcode macros * Gui: add ability to make a GuiImage out of a LUS::Texture * Add GfxDebugger * GfxDebugger: add C Bridge * gfx_pc: expose internal state + intergrate debugger * Add GfxDebuggerWindow * Context: integrate GfxDebuggerWindow * update CMakeLists.txt * GfxDebugger: move inline code from header to cpp file
- Loading branch information
1 parent
9f05a1f
commit 4b0486f
Showing
16 changed files
with
2,000 additions
and
1,054 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "GfxDebugger.h" | ||
#include <spdlog/fmt/fmt.h> | ||
|
||
namespace LUS { | ||
|
||
void GfxDebugger::ResumeGame() { | ||
mIsDebugging = false; | ||
mIsDebuggingRequested = false; | ||
mDlist = nullptr; | ||
} | ||
|
||
const Gfx* GfxDebugger::GetDisplayList() const { | ||
return mDlist; | ||
} | ||
|
||
const std::vector<const Gfx*>& GfxDebugger::GetBreakPoint() const { | ||
return mBreakPoint; | ||
} | ||
|
||
void GfxDebugger::SetBreakPoint(const std::vector<const Gfx*>& bp) { | ||
mBreakPoint = bp; | ||
} | ||
|
||
void GfxDebugger::RequestDebugging() { | ||
mIsDebuggingRequested = true; | ||
} | ||
bool GfxDebugger::IsDebugging() const { | ||
return mIsDebugging; | ||
} | ||
bool GfxDebugger::IsDebuggingRequested() const { | ||
return mIsDebuggingRequested; | ||
} | ||
|
||
void GfxDebugger::DebugDisplayList(Gfx* cmds) { | ||
mDlist = cmds; | ||
mIsDebuggingRequested = false; | ||
mIsDebugging = true; | ||
mBreakPoint = { cmds }; | ||
} | ||
|
||
bool GfxDebugger::HasBreakPoint(const std::vector<const Gfx*>& 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 LUS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include "libultraship/libultra/gbi.h" | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace LUS { | ||
|
||
class GfxDebugger { | ||
public: | ||
void RequestDebugging(); | ||
bool IsDebugging() const; | ||
bool IsDebuggingRequested() const; | ||
|
||
void DebugDisplayList(Gfx* cmds); | ||
|
||
void ResumeGame(); | ||
|
||
const Gfx* GetDisplayList() const; | ||
|
||
const std::vector<const Gfx*>& GetBreakPoint() const; | ||
|
||
bool HasBreakPoint(const std::vector<const Gfx*>& path) const; | ||
|
||
void SetBreakPoint(const std::vector<const Gfx*>& bp); | ||
|
||
private: | ||
bool mIsDebugging = false; | ||
bool mIsDebuggingRequested = false; | ||
Gfx* mDlist = nullptr; | ||
std::vector<const Gfx*> mBreakPoint = {}; | ||
}; | ||
|
||
} // namespace LUS |
Oops, something went wrong.