Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Add a dummy debug drawer
Browse files Browse the repository at this point in the history
This debug drawer will do nothing, it is the same as if you disabled
the debug drawer
  • Loading branch information
arthurmco committed Oct 7, 2020
1 parent 3654580 commit 467414c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ Game::Game(Window* w, Framebuffer* fb3D, Framebuffer* fbGUI, GUIManager* gr, Pla

ObjectPathManager::getInstance()->SetTerrain(terr);

LogicService::initDebugDrawer(new GFXDebugDrawer(*rndr, *terr));
LogicService::initDebugDrawer(new DummyDebugDrawer(*terr));
//LogicService::initDebugDrawer(new GFXDebugDrawer(*rndr, *terr));

pm->olm = olm;
pm->pf = pathf;
Expand Down
22 changes: 22 additions & 0 deletions src/include/client/graphical/gfx_debug_drawer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ struct VHData {
uint64_t last_tick;
};


/**
* A dummy debug drawer
*
* It does not render anywhere
*/
class DummyDebugDrawer : public familyline::logic::DebugDrawer
{
public:
DummyDebugDrawer(const familyline::logic::Terrain &terr)
: DebugDrawer(terr) {}

virtual void drawLine(glm::vec3 start, glm::vec3 end, glm::vec4 color) {}
virtual void drawSquare(
glm::vec3 start, glm::vec3 end, glm::vec4 foreground, glm::vec4 background) {}
virtual void drawCircle(
glm::vec3 point, glm::vec3 radius, glm::vec4 foreground, glm::vec4 background) {}

/// Update some internal structure
virtual void update() {}
};

class GFXDebugDrawer : public familyline::logic::DebugDrawer
{
private:
Expand Down

0 comments on commit 467414c

Please sign in to comment.