diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/performance.cpp | 8 | ||||
-rw-r--r-- | main/performance.h | 2 | ||||
-rw-r--r-- | main/tests/test_astar.cpp | 6 | ||||
-rw-r--r-- | main/tests/test_math.cpp | 18 | ||||
-rw-r--r-- | main/tests/test_physics.cpp | 8 | ||||
-rw-r--r-- | main/tests/test_physics_2d.cpp | 10 | ||||
-rw-r--r-- | main/tests/test_render.cpp | 2 |
7 files changed, 18 insertions, 36 deletions
diff --git a/main/performance.cpp b/main/performance.cpp index d829c6dfdc..c7e3a41aa6 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -49,9 +49,7 @@ void Performance::_bind_methods() { BIND_ENUM_CONSTANT(TIME_PROCESS); BIND_ENUM_CONSTANT(TIME_PHYSICS_PROCESS); BIND_ENUM_CONSTANT(MEMORY_STATIC); - BIND_ENUM_CONSTANT(MEMORY_DYNAMIC); BIND_ENUM_CONSTANT(MEMORY_STATIC_MAX); - BIND_ENUM_CONSTANT(MEMORY_DYNAMIC_MAX); BIND_ENUM_CONSTANT(MEMORY_MESSAGE_BUFFER_MAX); BIND_ENUM_CONSTANT(OBJECT_COUNT); BIND_ENUM_CONSTANT(OBJECT_RESOURCE_COUNT); @@ -95,9 +93,7 @@ String Performance::get_monitor_name(Monitor p_monitor) const { "time/process", "time/physics_process", "memory/static", - "memory/dynamic", "memory/static_max", - "memory/dynamic_max", "memory/msg_buf_max", "object/objects", "object/resources", @@ -133,9 +129,7 @@ float Performance::get_monitor(Monitor p_monitor) const { case TIME_PROCESS: return _process_time; case TIME_PHYSICS_PROCESS: return _physics_process_time; case MEMORY_STATIC: return Memory::get_mem_usage(); - case MEMORY_DYNAMIC: return MemoryPool::total_memory; case MEMORY_STATIC_MAX: return Memory::get_mem_max_usage(); - case MEMORY_DYNAMIC_MAX: return MemoryPool::max_memory; case MEMORY_MESSAGE_BUFFER_MAX: return MessageQueue::get_singleton()->get_max_buffer_usage(); case OBJECT_COUNT: return ObjectDB::get_object_count(); case OBJECT_RESOURCE_COUNT: return ResourceCache::get_cached_resource_count(); @@ -177,8 +171,6 @@ Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const MONITOR_TYPE_MEMORY, MONITOR_TYPE_MEMORY, MONITOR_TYPE_MEMORY, - MONITOR_TYPE_MEMORY, - MONITOR_TYPE_MEMORY, MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, diff --git a/main/performance.h b/main/performance.h index 638ddbe993..c0f6044ea0 100644 --- a/main/performance.h +++ b/main/performance.h @@ -55,9 +55,7 @@ public: TIME_PROCESS, TIME_PHYSICS_PROCESS, MEMORY_STATIC, - MEMORY_DYNAMIC, MEMORY_STATIC_MAX, - MEMORY_DYNAMIC_MAX, MEMORY_MESSAGE_BUFFER_MAX, OBJECT_COUNT, OBJECT_RESOURCE_COUNT, diff --git a/main/tests/test_astar.cpp b/main/tests/test_astar.cpp index dee107f0af..e82d885af2 100644 --- a/main/tests/test_astar.cpp +++ b/main/tests/test_astar.cpp @@ -68,7 +68,7 @@ public: bool test_abc() { ABCX abcx; - PoolVector<int> path = abcx.get_id_path(ABCX::A, ABCX::C); + Vector<int> path = abcx.get_id_path(ABCX::A, ABCX::C); bool ok = path.size() == 3; int i = 0; ok = ok && path[i++] == ABCX::A; @@ -79,7 +79,7 @@ bool test_abc() { bool test_abcx() { ABCX abcx; - PoolVector<int> path = abcx.get_id_path(ABCX::X, ABCX::C); + Vector<int> path = abcx.get_id_path(ABCX::X, ABCX::C); bool ok = path.size() == 4; int i = 0; ok = ok && path[i++] == ABCX::X; @@ -304,7 +304,7 @@ bool test_solutions() { for (int u = 0; u < N; u++) for (int v = 0; v < N; v++) if (u != v) { - PoolVector<int> route = a.get_id_path(u, v); + Vector<int> route = a.get_id_path(u, v); if (!Math::is_inf(d[u][v])) { // Reachable if (route.size() == 0) { diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index 2c4ba08c6d..d91503501d 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -451,34 +451,26 @@ MainLoop *test() { print_line("RGBE: " + Color(rd, gd, bd)); } - print_line("Dvectors: " + itos(MemoryPool::allocs_used)); - print_line("Mem used: " + itos(MemoryPool::total_memory)); - print_line("MAx mem used: " + itos(MemoryPool::max_memory)); - - PoolVector<int> ints; + Vector<int> ints; ints.resize(20); { - PoolVector<int>::Write w; - w = ints.write(); + int *w; + w = ints.ptrw(); for (int i = 0; i < ints.size(); i++) { w[i] = i; } } - PoolVector<int> posho = ints; + Vector<int> posho = ints; { - PoolVector<int>::Read r = posho.read(); + const int *r = posho.ptr(); for (int i = 0; i < posho.size(); i++) { print_line(itos(i) + " : " + itos(r[i])); } } - print_line("later Dvectors: " + itos(MemoryPool::allocs_used)); - print_line("later Mem used: " + itos(MemoryPool::total_memory)); - print_line("Mlater Ax mem used: " + itos(MemoryPool::max_memory)); - List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); if (cmdlargs.empty()) { diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp index 3f4f91f8f4..43958a9493 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -143,7 +143,7 @@ protected: /* BOX SHAPE */ - PoolVector<Plane> box_planes = Geometry::build_box_planes(Vector3(0.5, 0.5, 0.5)); + Vector<Plane> box_planes = Geometry::build_box_planes(Vector3(0.5, 0.5, 0.5)); RID box_mesh = vs->mesh_create(); Geometry::MeshData box_data = Geometry::build_convex_mesh(box_planes); vs->mesh_add_surface_from_mesh_data(box_mesh, box_data); @@ -155,7 +155,7 @@ protected: /* CAPSULE SHAPE */ - PoolVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 0.7, 12, Vector3::AXIS_Z); + Vector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 0.7, 12, Vector3::AXIS_Z); RID capsule_mesh = vs->mesh_create(); Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes); @@ -172,7 +172,7 @@ protected: /* CONVEX SHAPE */ - PoolVector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5, 0.7, 5, Vector3::AXIS_Z); + Vector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5, 0.7, 5, Vector3::AXIS_Z); RID convex_mesh = vs->mesh_create(); Geometry::MeshData convex_data = Geometry::build_convex_mesh(convex_planes); @@ -363,7 +363,7 @@ public: VisualServer *vs = VisualServer::get_singleton(); PhysicsServer *ps = PhysicsServer::get_singleton(); - PoolVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 1, 12, 5, Vector3::AXIS_Y); + Vector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 1, 12, 5, Vector3::AXIS_Y); RID capsule_mesh = vs->mesh_create(); Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes); diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp index 9c10fcbd56..160c25f43a 100644 --- a/main/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -72,7 +72,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 2 * 2); for (int i = 0; i < 2; i++) { @@ -97,7 +97,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 32 * 2); for (int i = 0; i < 32; i++) { @@ -124,7 +124,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 32 * 2); for (int i = 0; i < 32; i++) { @@ -151,7 +151,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 64 * 2); for (int i = 0; i < 64; i++) { @@ -185,7 +185,7 @@ class TestPhysics2DMainLoop : public MainLoop { RID convex_polygon_shape = ps->convex_polygon_shape_create(); - PoolVector<Vector2> arr; + Vector<Vector2> arr; Point2 sb(32, 32); arr.push_back(Point2(20, 3) - sb); arr.push_back(Point2(58, 23) - sb); diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp index 0e101fb566..62239a5cb5 100644 --- a/main/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -81,7 +81,7 @@ public: Vector<Vector3> vts; /* - PoolVector<Plane> sp = Geometry::build_sphere_planes(2,5,5); + Vector<Plane> sp = Geometry::build_sphere_planes(2,5,5); Geometry::MeshData md2 = Geometry::build_convex_mesh(sp); vts=md2.vertices; */ |