diff options
Diffstat (limited to 'core/message_queue.cpp')
-rw-r--r-- | core/message_queue.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 37207483fe..652c424492 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -34,7 +34,7 @@ #include "core/project_settings.h" #include "core/script_language.h" -MessageQueue *MessageQueue::singleton = NULL; +MessageQueue *MessageQueue::singleton = nullptr; MessageQueue *MessageQueue::get_singleton() { @@ -174,7 +174,7 @@ void MessageQueue::statistics() { Object *target = message->callable.get_object(); - if (target != NULL) { + if (target != nullptr) { switch (message->type & FLAG_MASK) { @@ -240,7 +240,7 @@ int MessageQueue::get_max_buffer_usage() const { void MessageQueue::_call_function(const Callable &p_callable, const Variant *p_args, int p_argcount, bool p_show_error) { - const Variant **argptrs = NULL; + const Variant **argptrs = nullptr; if (p_argcount) { argptrs = (const Variant **)alloca(sizeof(Variant *) * p_argcount); for (int i = 0; i < p_argcount; i++) { @@ -291,7 +291,7 @@ void MessageQueue::flush() { Object *target = message->callable.get_object(); - if (target != NULL) { + if (target != nullptr) { switch (message->type & FLAG_MASK) { case TYPE_CALL: { @@ -343,14 +343,14 @@ bool MessageQueue::is_flushing() const { MessageQueue::MessageQueue() { - ERR_FAIL_COND_MSG(singleton != NULL, "MessageQueue singleton already exist."); + ERR_FAIL_COND_MSG(singleton != nullptr, "A MessageQueue singleton already exists."); singleton = this; flushing = false; buffer_end = 0; buffer_max_used = 0; buffer_size = GLOBAL_DEF_RST("memory/limits/message_queue/max_size_kb", DEFAULT_QUEUE_SIZE_KB); - ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/message_queue/max_size_kb", PropertyInfo(Variant::INT, "memory/limits/message_queue/max_size_kb", PROPERTY_HINT_RANGE, "0,2048,1,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/message_queue/max_size_kb", PropertyInfo(Variant::INT, "memory/limits/message_queue/max_size_kb", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater")); buffer_size *= 1024; buffer = memnew_arr(uint8_t, buffer_size); } @@ -375,6 +375,6 @@ MessageQueue::~MessageQueue() { read_pos += sizeof(Variant) * message->args; } - singleton = NULL; + singleton = nullptr; memdelete_arr(buffer); } |