summaryrefslogtreecommitdiff
path: root/core/script_debugger_remote.cpp
diff options
context:
space:
mode:
authorMarianoGNU <marianognu.easyrpg@gmail.com>2015-10-24 11:55:00 -0300
committerMarianoGNU <marianognu.easyrpg@gmail.com>2015-10-24 11:55:00 -0300
commit754908844ae52c04ed68ef27c02481479f1e2ab4 (patch)
tree90b95accfabc9bc12a6479c004183ff7d28b6fcd /core/script_debugger_remote.cpp
parent6df7d923797908ecf38684c0008c0e4b6475d884 (diff)
parent4baf65dab78b6e8062de760010338c316c628394 (diff)
Merge branch 'master' of https://github.com/okamstudio/godot into posta
Diffstat (limited to 'core/script_debugger_remote.cpp')
-rw-r--r--core/script_debugger_remote.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index d42f879441..d72c9f7532 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -31,6 +31,28 @@
#include "io/ip.h"
#include "globals.h"
+void ScriptDebuggerRemote::_send_video_memory() {
+
+ List<ResourceUsage> usage;
+ if (resource_usage_func)
+ resource_usage_func(&usage);
+
+ usage.sort();
+
+ packet_peer_stream->put_var("message:video_mem");
+ packet_peer_stream->put_var(usage.size()*4);
+
+
+ for(List<ResourceUsage>::Element *E=usage.front();E;E=E->next()) {
+
+ packet_peer_stream->put_var(E->get().path);
+ packet_peer_stream->put_var(E->get().type);
+ packet_peer_stream->put_var(E->get().format);
+ packet_peer_stream->put_var(E->get().vram);
+ }
+
+}
+
Error ScriptDebuggerRemote::connect_to_host(const String& p_host,uint16_t p_port) {
@@ -248,6 +270,9 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) {
if (request_scene_tree)
request_scene_tree(request_scene_tree_ud);
+ } else if (command=="request_video_mem") {
+
+ _send_video_memory();
} else if (command=="breakpoint") {
bool set = cmd[3];
@@ -531,6 +556,9 @@ void ScriptDebuggerRemote::_poll_events() {
if (request_scene_tree)
request_scene_tree(request_scene_tree_ud);
+ } else if (command=="request_video_mem") {
+
+ _send_video_memory();
} else if (command=="breakpoint") {
bool set = cmd[3];
@@ -652,6 +680,8 @@ void ScriptDebuggerRemote::set_live_edit_funcs(LiveEditFuncs *p_funcs) {
live_edit_funcs=p_funcs;
}
+ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func=NULL;
+
ScriptDebuggerRemote::ScriptDebuggerRemote() {
tcp_client = StreamPeerTCP::create_ref();