mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-08 03:50:47 +00:00
setup debug mode
This commit is contained in:
@@ -10,6 +10,8 @@ include_directories(bomberman sources)
|
||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
|
||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/Ray)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
|
||||
|
||||
@@ -20,8 +20,11 @@ namespace BBM
|
||||
}),
|
||||
_wal(wal),
|
||||
_window(window),
|
||||
_camera(Vector3f(), Vector3f(), Vector3f(0, 1, 0), 50, CAMERA_PERSPECTIVE)
|
||||
{}
|
||||
_camera(Vector3f(), Vector3f(), Vector3f(0, 1, 0), 50, CAMERA_PERSPECTIVE),
|
||||
_debugMode(true)
|
||||
{
|
||||
this->_window.setFPS(this->FPS);
|
||||
}
|
||||
|
||||
void RenderSystem::onSelfUpdate()
|
||||
{
|
||||
@@ -53,6 +56,8 @@ namespace BBM
|
||||
drawable.drawable->setPosition(Vector2f(pos.position.x, pos.position.y));
|
||||
drawable.drawable->drawOn(this->_window);
|
||||
}
|
||||
if (this->_debugMode)
|
||||
this->_window.drawFPS(Vector2f());
|
||||
this->_window.endDrawing();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,12 @@ namespace BBM
|
||||
//! @brief The camera used to render.
|
||||
RAY::Camera::Camera3D _camera;
|
||||
|
||||
//! @brief Defines if the debug informations must be displayed or not
|
||||
bool _debugMode;
|
||||
|
||||
//! @brief Window framerate limit
|
||||
static constexpr short FPS = 30;
|
||||
|
||||
public:
|
||||
//! @brief A method called after all entities that this system manage has been updated.
|
||||
//! @note render on screen here
|
||||
|
||||
Reference in New Issue
Block a user