diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 0ecbf576cb6..0b2b59dc87f 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -919,7 +919,7 @@ void _OS::delay_msec(int p_msec) const { OS::get_singleton()->delay_usec(int64_t(p_msec) * 1000); } -uint32_t _OS::get_ticks_msec() const { +uint64_t _OS::get_ticks_msec() const { return OS::get_singleton()->get_ticks_msec(); } diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 8d63506ab6f..25e44460498 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -312,7 +312,7 @@ public: void delay_usec(int p_usec) const; void delay_msec(int p_msec) const; - uint32_t get_ticks_msec() const; + uint64_t get_ticks_msec() const; uint64_t get_ticks_usec() const; uint32_t get_splash_tick_msec() const; diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index bd5e9303a0d..573253ec33c 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -887,8 +887,8 @@ int MultiplayerAPI::get_outgoing_bandwidth_usage() { int MultiplayerAPI::_get_bandwidth_usage(const Vector &p_buffer, int p_pointer) { int total_bandwidth = 0; - uint32_t timestamp = OS::get_singleton()->get_ticks_msec(); - uint32_t final_timestamp = timestamp - 1000; + uint64_t timestamp = OS::get_singleton()->get_ticks_msec(); + uint64_t final_timestamp = timestamp - 1000; int i = (p_pointer + p_buffer.size() - 1) % p_buffer.size(); diff --git a/core/io/multiplayer_api.h b/core/io/multiplayer_api.h index 1abd64d634f..2add81de972 100644 --- a/core/io/multiplayer_api.h +++ b/core/io/multiplayer_api.h @@ -66,7 +66,7 @@ private: #ifdef DEBUG_ENABLED struct BandwidthFrame { - uint32_t timestamp; + uint64_t timestamp; int packet_size; }; diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index f54f1ca1e27..e4042d01d49 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -58,7 +58,7 @@ void UndoRedo::_discard_redo() { } void UndoRedo::create_action(const String &p_name, MergeMode p_mode) { - uint32_t ticks = OS::get_singleton()->get_ticks_msec(); + uint64_t ticks = OS::get_singleton()->get_ticks_msec(); if (action_level == 0) { _discard_redo(); diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 4dd53675464..0853ad521a5 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -371,7 +371,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)p_udata; unsigned int write_ofs = 0; size_t avail_bytes = 0; - uint32_t default_device_msec = OS::get_singleton()->get_ticks_msec(); + uint64_t default_device_msec = OS::get_singleton()->get_ticks_msec(); while (!ad->exit_thread) { size_t read_bytes = 0; @@ -463,7 +463,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { // If we're using the default device check that the current device is still the default if (ad->device_name == "Default") { - uint32_t msec = OS::get_singleton()->get_ticks_msec(); + uint64_t msec = OS::get_singleton()->get_ticks_msec(); if (msec > (default_device_msec + 1000)) { String old_default_device = ad->default_device; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f68ae39976e..5ce29419749 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -436,9 +436,9 @@ void EditorNode::_notification(int p_what) { last_checked_version = editor_data.get_undo_redo().get_version(); } - // update the animation frame of the update spinner + // Update the animation frame of the update spinner. uint64_t frame = Engine::get_singleton()->get_frames_drawn(); - uint32_t tick = OS::get_singleton()->get_ticks_msec(); + uint64_t tick = OS::get_singleton()->get_ticks_msec(); if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { update_spinner_step++; @@ -449,7 +449,7 @@ void EditorNode::_notification(int p_what) { update_spinner_step_msec = tick; update_spinner_step_frame = frame + 1; - // update the icon itself only when the spinner is visible + // Update the icon itself only when the spinner is visible. if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); } diff --git a/editor/editor_node.h b/editor/editor_node.h index 430dc78e6d3..706016b4665 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -401,7 +401,7 @@ private: bool waiting_for_sources_changed; - uint32_t update_spinner_step_msec; + uint64_t update_spinner_step_msec; uint64_t update_spinner_step_frame; int update_spinner_step; diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index c30dc435182..417b5fe40c5 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -153,11 +153,11 @@ void FindInFiles::_process() { // This part can be moved to a thread if needed OS &os = *OS::get_singleton(); - float time_before = os.get_ticks_msec(); + uint64_t time_before = os.get_ticks_msec(); while (is_processing()) { _iterate(); - float elapsed = (os.get_ticks_msec() - time_before); - if (elapsed > 1000.0 / 120.0) { + uint64_t elapsed = (os.get_ticks_msec() - time_before); + if (elapsed > 8) { // Process again after waiting 8 ticks break; } } diff --git a/modules/websocket/wsl_server.h b/modules/websocket/wsl_server.h index 49a0b383e46..046cc3fe446 100644 --- a/modules/websocket/wsl_server.h +++ b/modules/websocket/wsl_server.h @@ -53,7 +53,7 @@ private: Ref connection; bool use_ssl; - int time; + uint64_t time; uint8_t req_buf[WSL_MAX_HEADER_SIZE]; int req_pos; String key;