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:
2026-07-17 13:54:36 +08:00
parent e511050399
commit 9617978dd5
2 changed files with 6 additions and 4 deletions

View File

@@ -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

View File

@@ -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",