summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp10
-rw-r--r--main/performance.cpp25
-rw-r--r--main/performance.h6
3 files changed, 40 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 702c9747d7..5b1782815e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -605,12 +605,22 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
if (use_custom_res && globals->has("display/resizable"))
video_mode.resizable=globals->get("display/resizable");
+ if (!force_res && use_custom_res && globals->has("display/test_width") && globals->has("display/test_height")) {
+ int tw = globals->get("display/test_width");
+ int th = globals->get("display/test_height");
+ if (tw>0 && th>0) {
+ video_mode.width=tw;
+ video_mode.height=th;
+ }
+ }
GLOBAL_DEF("display/width",video_mode.width);
GLOBAL_DEF("display/height",video_mode.height);
GLOBAL_DEF("display/fullscreen",video_mode.fullscreen);
GLOBAL_DEF("display/resizable",video_mode.resizable);
+ GLOBAL_DEF("display/test_width",0);
+ GLOBAL_DEF("display/test_height",0);
if (rtm==-1) {
rtm=GLOBAL_DEF("render/thread_model",OS::RENDER_THREAD_SAFE);
}
diff --git a/main/performance.cpp b/main/performance.cpp
index 81db7ae1fa..9999cc0ae0 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -29,6 +29,8 @@
#include "performance.h"
#include "os/os.h"
#include "servers/visual_server.h"
+#include "servers/physics_2d_server.h"
+#include "servers/physics_server.h"
#include "message_queue.h"
#include "scene/main/scene_main_loop.h"
Performance *Performance::singleton=NULL;
@@ -61,6 +63,13 @@ void Performance::_bind_methods() {
BIND_CONSTANT( RENDER_VIDEO_MEM_USED );
BIND_CONSTANT( RENDER_TEXTURE_MEM_USED );
BIND_CONSTANT( RENDER_VERTEX_MEM_USED );
+ BIND_CONSTANT( PHYSICS_2D_ACTIVE_OBJECTS );
+ BIND_CONSTANT( PHYSICS_2D_COLLISION_PAIRS );
+ BIND_CONSTANT( PHYSICS_2D_ISLAND_COUNT );
+ BIND_CONSTANT( PHYSICS_3D_ACTIVE_OBJECTS );
+ BIND_CONSTANT( PHYSICS_3D_COLLISION_PAIRS );
+ BIND_CONSTANT( PHYSICS_3D_ISLAND_COUNT );
+
BIND_CONSTANT( MONITOR_MAX );
}
@@ -90,7 +99,14 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
"video/video_mem",
"video/texure_mem",
"video/vertex_mem",
- "render/mem_max"
+ "video/video_mem_max",
+ "physics_2d/active_objects",
+ "physics_2d/collision_pairs",
+ "physics_2d/islands",
+ "physics_3d/active_objects",
+ "physics_3d/collision_pairs",
+ "physics_3d/islands",
+
};
return names[p_monitor];
@@ -133,6 +149,13 @@ float Performance::get_monitor(Monitor p_monitor) const {
case RENDER_TEXTURE_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_TEXTURE_MEM_USED);
case RENDER_VERTEX_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_VERTEX_MEM_USED);
case RENDER_USAGE_VIDEO_MEM_TOTAL: return VS::get_singleton()->get_render_info(VS::INFO_USAGE_VIDEO_MEM_TOTAL);
+ case PHYSICS_2D_ACTIVE_OBJECTS: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_2D_COLLISION_PAIRS: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_COLLISION_PAIRS);
+ case PHYSICS_2D_ISLAND_COUNT: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_ISLAND_COUNT);
+ case PHYSICS_3D_ACTIVE_OBJECTS: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_3D_COLLISION_PAIRS: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_COLLISION_PAIRS);
+ case PHYSICS_3D_ISLAND_COUNT: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_ISLAND_COUNT);
+
default: {}
}
diff --git a/main/performance.h b/main/performance.h
index db453d0156..1879ba39eb 100644
--- a/main/performance.h
+++ b/main/performance.h
@@ -69,6 +69,12 @@ public:
RENDER_TEXTURE_MEM_USED,
RENDER_VERTEX_MEM_USED,
RENDER_USAGE_VIDEO_MEM_TOTAL,
+ PHYSICS_2D_ACTIVE_OBJECTS,
+ PHYSICS_2D_COLLISION_PAIRS,
+ PHYSICS_2D_ISLAND_COUNT,
+ PHYSICS_3D_ACTIVE_OBJECTS,
+ PHYSICS_3D_COLLISION_PAIRS,
+ PHYSICS_3D_ISLAND_COUNT,
//physics
MONITOR_MAX
};