Skip to content

Commit

Permalink
logger: Add command line switch --terain3d-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lw64 authored and TokisanGames committed Nov 20, 2023
1 parent e5e0ee2 commit 3f79ad2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/terrain_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <godot_cpp/classes/editor_script.hpp>
#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/height_map_shape3d.hpp>
#include <godot_cpp/classes/os.hpp>
#include <godot_cpp/classes/rendering_server.hpp>
#include <godot_cpp/classes/surface_tool.hpp>
#include <godot_cpp/classes/time.hpp>
Expand Down Expand Up @@ -472,6 +473,23 @@ void Terrain3D::_update_instances() {

Terrain3D::Terrain3D() {
set_notify_transform(true);
PackedStringArray args = OS::get_singleton()->get_cmdline_args();
for (int i = args.size() - 1; i >= 0; i--) {
String arg = args[i];
if (arg.begins_with("--terrain3d-debug=")) {
String value = arg.lstrip("--terrain3d-debug=");
if (value == "ERROR") {
set_debug_level(ERROR);
} else if (value == "INFO") {
set_debug_level(INFO);
} else if (value == "DEBUG") {
set_debug_level(DEBUG);
} else if (value == "DEBUG_CONT") {
set_debug_level(DEBUG_CONT);
}
break;
}
}
}

Terrain3D::~Terrain3D() {
Expand Down

0 comments on commit 3f79ad2

Please sign in to comment.