mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
fix: invert debug flag logic and rename to no_debug
The previous 'debug_on' field was never set to true by default, causing debug mode to never be enabled. Now renamed to 'no_debug' and the renderer initializes with debug enabled unless the --no-debug flag is given.
This commit is contained in:
@@ -6,7 +6,7 @@ struct Argument {
|
||||
std::optional<int> port;
|
||||
std::optional<std::string> ip;
|
||||
std::optional<std::string> player;
|
||||
std::optional<bool> debug_on;
|
||||
std::optional<bool> no_debug;
|
||||
std::optional<std::string> language;
|
||||
};
|
||||
} // namespace Cubed
|
||||
@@ -47,8 +47,10 @@ void App::init(int argc, char** argv) {
|
||||
|
||||
m_audio.init();
|
||||
BlockManager::init();
|
||||
if (m_argument.debug_on) {
|
||||
m_renderer.init(*m_argument.debug_on);
|
||||
if (m_argument.no_debug) {
|
||||
m_renderer.init(*m_argument.no_debug);
|
||||
} else {
|
||||
m_renderer.init(true);
|
||||
}
|
||||
Logger::info("Renderer Init Success");
|
||||
// MapTable::init_map();
|
||||
@@ -113,7 +115,7 @@ void App::handle_argument(int argc, char** argv) {
|
||||
|
||||
{"--no-debug",
|
||||
[&](ArgParser) {
|
||||
m_argument.debug_on = false;
|
||||
m_argument.no_debug = false;
|
||||
Logger::info("Switch off opengl debug out put");
|
||||
}},
|
||||
{"--language",
|
||||
|
||||
Reference in New Issue
Block a user