1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Bring that Whole New World to the Old Continent too

Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
Rémi Verschelde
2017-03-19 00:36:26 +01:00
parent 1d418afe86
commit f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions

View File

@@ -27,57 +27,53 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "performance.h"
#include "message_queue.h"
#include "os/os.h"
#include "servers/visual_server.h"
#include "scene/main/scene_main_loop.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;
#include "servers/visual_server.h"
Performance *Performance::singleton = NULL;
void Performance::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_monitor","monitor"),&Performance::get_monitor);
ObjectTypeDB::bind_method(_MD("get_monitor", "monitor"), &Performance::get_monitor);
BIND_CONSTANT( TIME_FPS );
BIND_CONSTANT( TIME_PROCESS );
BIND_CONSTANT( TIME_FIXED_PROCESS );
BIND_CONSTANT( MEMORY_STATIC );
BIND_CONSTANT( MEMORY_DYNAMIC );
BIND_CONSTANT( MEMORY_STATIC_MAX );
BIND_CONSTANT( MEMORY_DYNAMIC_MAX );
BIND_CONSTANT( MEMORY_MESSAGE_BUFFER_MAX );
BIND_CONSTANT( OBJECT_COUNT );
BIND_CONSTANT( OBJECT_RESOURCE_COUNT );
BIND_CONSTANT( OBJECT_NODE_COUNT );
BIND_CONSTANT( RENDER_OBJECTS_IN_FRAME );
BIND_CONSTANT( RENDER_VERTICES_IN_FRAME );
BIND_CONSTANT( RENDER_MATERIAL_CHANGES_IN_FRAME );
BIND_CONSTANT( RENDER_SHADER_CHANGES_IN_FRAME );
BIND_CONSTANT( RENDER_SURFACE_CHANGES_IN_FRAME );
BIND_CONSTANT( RENDER_DRAW_CALLS_IN_FRAME );
BIND_CONSTANT( RENDER_USAGE_VIDEO_MEM_TOTAL );
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 );
BIND_CONSTANT(TIME_FPS);
BIND_CONSTANT(TIME_PROCESS);
BIND_CONSTANT(TIME_FIXED_PROCESS);
BIND_CONSTANT(MEMORY_STATIC);
BIND_CONSTANT(MEMORY_DYNAMIC);
BIND_CONSTANT(MEMORY_STATIC_MAX);
BIND_CONSTANT(MEMORY_DYNAMIC_MAX);
BIND_CONSTANT(MEMORY_MESSAGE_BUFFER_MAX);
BIND_CONSTANT(OBJECT_COUNT);
BIND_CONSTANT(OBJECT_RESOURCE_COUNT);
BIND_CONSTANT(OBJECT_NODE_COUNT);
BIND_CONSTANT(RENDER_OBJECTS_IN_FRAME);
BIND_CONSTANT(RENDER_VERTICES_IN_FRAME);
BIND_CONSTANT(RENDER_MATERIAL_CHANGES_IN_FRAME);
BIND_CONSTANT(RENDER_SHADER_CHANGES_IN_FRAME);
BIND_CONSTANT(RENDER_SURFACE_CHANGES_IN_FRAME);
BIND_CONSTANT(RENDER_DRAW_CALLS_IN_FRAME);
BIND_CONSTANT(RENDER_USAGE_VIDEO_MEM_TOTAL);
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);
}
String Performance::get_monitor_name(Monitor p_monitor) const {
ERR_FAIL_INDEX_V(p_monitor,MONITOR_MAX,String());
static const char* names[MONITOR_MAX]={
ERR_FAIL_INDEX_V(p_monitor, MONITOR_MAX, String());
static const char *names[MONITOR_MAX] = {
"time/fps",
"time/process",
@@ -110,14 +106,11 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
};
return names[p_monitor];
}
float Performance::get_monitor(Monitor p_monitor) const {
switch(p_monitor) {
switch (p_monitor) {
case TIME_FPS: return OS::get_singleton()->get_frames_per_second();
case TIME_PROCESS: return _process_time;
case TIME_FIXED_PROCESS: return _fixed_process_time;
@@ -137,7 +130,6 @@ float Performance::get_monitor(Monitor p_monitor) const {
if (!sml)
return 0;
return sml->get_node_count();
};
case RENDER_OBJECTS_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_OBJECTS_IN_FRAME);
case RENDER_VERTICES_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_VERTICES_IN_FRAME);
@@ -164,18 +156,17 @@ float Performance::get_monitor(Monitor p_monitor) const {
void Performance::set_process_time(float p_pt) {
_process_time=p_pt;
_process_time = p_pt;
}
void Performance::set_fixed_process_time(float p_pt) {
_fixed_process_time=p_pt;
_fixed_process_time = p_pt;
}
Performance::Performance() {
_process_time=0;
_fixed_process_time=0;
singleton=this;
_process_time = 0;
_fixed_process_time = 0;
singleton = this;
}