summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp18
-rw-r--r--main/performance.cpp8
-rw-r--r--main/performance.h2
-rw-r--r--main/tests/test_astar.cpp6
-rw-r--r--main/tests/test_gdscript.cpp2
-rw-r--r--main/tests/test_math.cpp18
-rw-r--r--main/tests/test_physics.cpp8
-rw-r--r--main/tests/test_physics_2d.cpp10
-rw-r--r--main/tests/test_render.cpp2
9 files changed, 26 insertions, 48 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 00ce8c6f7b..d8a9cc87a7 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -44,6 +44,7 @@
#include "core/project_settings.h"
#include "core/register_core_types.h"
#include "core/script_debugger_local.h"
+#include "core/script_debugger_remote.h"
#include "core/script_language.h"
#include "core/translation.h"
#include "core/version.h"
@@ -58,7 +59,6 @@
#include "main/tests/test_main.h"
#include "modules/register_module_types.h"
#include "platform/register_platform_apis.h"
-#include "scene/debugger/script_debugger_remote.h"
#include "scene/main/scene_tree.h"
#include "scene/main/viewport.h"
#include "scene/register_scene_types.h"
@@ -203,6 +203,7 @@ void finalize_physics() {
void initialize_navigation_server() {
ERR_FAIL_COND(navigation_server != NULL);
+
navigation_server = NavigationServerManager::new_default_server();
navigation_2d_server = memnew(Navigation2DServer);
}
@@ -210,6 +211,7 @@ void initialize_navigation_server() {
void finalize_navigation_server() {
memdelete(navigation_server);
navigation_server = NULL;
+
memdelete(navigation_2d_server);
navigation_2d_server = NULL;
}
@@ -1657,12 +1659,6 @@ bool Main::start() {
if (!project_manager && !editor) { // game
if (game_path != "" || script != "") {
- if (script_debugger && script_debugger->is_remote()) {
- ScriptDebuggerRemote *remote_debugger = static_cast<ScriptDebuggerRemote *>(script_debugger);
-
- remote_debugger->set_scene_tree(sml);
- }
-
//autoload
List<PropertyInfo> props;
ProjectSettings::get_singleton()->get_property_list(&props);
@@ -1719,7 +1715,7 @@ bool Main::start() {
ERR_CONTINUE_MSG(obj == NULL, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt));
n = Object::cast_to<Node>(obj);
- n->set_script(script_res.get_ref_ptr());
+ n->set_script(script_res);
}
ERR_CONTINUE_MSG(!n, "Path in autoload not a node or script: " + path);
@@ -1823,7 +1819,7 @@ bool Main::start() {
GLOBAL_DEF("display/window/stretch/aspect", "ignore");
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/aspect", PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"));
GLOBAL_DEF("display/window/stretch/shrink", 1.0);
- ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::REAL, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1"));
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::FLOAT, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1"));
sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true));
sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true));
GLOBAL_DEF("gui/common/snap_controls_to_pixels", true);
@@ -2043,9 +2039,9 @@ bool Main::iteration() {
break;
}
- message_queue->flush();
+ NavigationServer::get_singleton_mut()->process(frame_slice * time_scale);
- NavigationServer::get_singleton_mut()->step(frame_slice * time_scale);
+ message_queue->flush();
PhysicsServer::get_singleton()->step(frame_slice * time_scale);
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_gdscript.cpp b/main/tests/test_gdscript.cpp
index a2891de8ff..0e7c45f603 100644
--- a/main/tests/test_gdscript.cpp
+++ b/main/tests/test_gdscript.cpp
@@ -128,7 +128,7 @@ static String _parser_expr(const GDScriptParser::Node *p_expr) {
case GDScriptParser::OperatorNode::OP_PARENT_CALL:
txt += ".";
- FALLTHROUGH;
+ [[fallthrough]];
case GDScriptParser::OperatorNode::OP_CALL: {
ERR_FAIL_COND_V(c_node->arguments.size() < 1, "");
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;
*/