diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-02-27 03:30:20 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-03-08 12:36:39 +0100 |
commit | b8ddaf9c33107e01928e04ed462aa08d4017247b (patch) | |
tree | 6ab71cdcbfd372e8390baa6ac30a2974fe43d119 /servers/register_server_types.cpp | |
parent | d0009636df6544dd26ab7c568a0244af6a20634a (diff) | |
download | redot-engine-b8ddaf9c33107e01928e04ed462aa08d4017247b.tar.gz |
Refactor ScriptDebugger.
EngineDebugger is the new interface to access the debugger.
It tries to be as agnostic as possible on the data that various
subsystems can expose.
It allows 2 types of interactions:
- Profilers:
A subsystem can register a profiler, assigning it a unique name.
That name can be used to activate the profiler or add data to it.
The registered profiler can be composed of up to 3 functions:
- Toggle: called when the profiler is activated/deactivated.
- Add: called whenever data is added to the debugger
(via `EngineDebugger::profiler_add_frame_data`)
- Tick: called every frame (during idle), receives frame times.
- Captures: (Only relevant in remote debugger for now)
A subsystem can register a capture, assigning it a unique name.
When receiving a message, the remote debugger will check if it starts
with `[prefix]:` and call the associated capture with name `prefix`.
Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new
profiler system.
Port SceneDebugger and RemoteDebugger to the new capture system.
The LocalDebugger also uses the new profiler system for scripts
profiling.
Diffstat (limited to 'servers/register_server_types.cpp')
-rw-r--r-- | servers/register_server_types.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index c9f5277a4d..fd65f57380 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -56,7 +56,6 @@ #include "audio_server.h" #include "camera/camera_feed.h" #include "camera_server.h" -#include "core/script_debugger_remote.h" #include "navigation_2d_server.h" #include "navigation_server.h" #include "physics/physics_server_sw.h" @@ -67,27 +66,6 @@ #include "visual/shader_types.h" #include "visual_server.h" -static void _debugger_get_resource_usage(ScriptDebuggerRemote::ResourceUsage *r_usage) { - - List<VS::TextureInfo> tinfo; - VS::get_singleton()->texture_debug_usage(&tinfo); - - for (List<VS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) { - - ScriptDebuggerRemote::ResourceInfo usage; - usage.path = E->get().path; - usage.vram = E->get().bytes; - usage.id = E->get().texture; - usage.type = "Texture"; - if (E->get().depth == 0) { - usage.format = itos(E->get().width) + "x" + itos(E->get().height) + " " + Image::get_format_name(E->get().format); - } else { - usage.format = itos(E->get().width) + "x" + itos(E->get().height) + "x" + itos(E->get().depth) + " " + Image::get_format_name(E->get().format); - } - r_usage->infos.push_back(usage); - } -} - ShaderTypes *shader_types = NULL; PhysicsServer *_createGodotPhysicsCallback() { @@ -189,8 +167,6 @@ void register_server_types() { ClassDB::register_virtual_class<PhysicsDirectSpaceState>(); ClassDB::register_virtual_class<PhysicsShapeQueryResult>(); - ScriptDebuggerRemote::resource_usage_func = _debugger_get_resource_usage; - // Physics 2D GLOBAL_DEF(Physics2DServerManager::setting_property_name, "DEFAULT"); ProjectSettings::get_singleton()->set_custom_property_info(Physics2DServerManager::setting_property_name, PropertyInfo(Variant::STRING, Physics2DServerManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT")); |