From b0173f6d68f5f0940c7039d66aaab9c1c3056a90 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sat, 3 Feb 2024 15:00:32 +0100 Subject: [PATCH] tox iterate interval pow(1.6) fix faux offline inbetween timer crop by default --- src/main_screen.cpp | 7 ++++++- src/send_image_popup.hpp | 2 +- src/tox_friend_faux_offline_messaging.hpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main_screen.cpp b/src/main_screen.cpp index d68c5e1..0ab3307 100644 --- a/src/main_screen.cpp +++ b/src/main_screen.cpp @@ -5,6 +5,7 @@ #include #include +#include MainScreen::MainScreen(SDL_Renderer* renderer_, std::string save_path, std::string save_password, std::vector plugins) : renderer(renderer_), @@ -253,7 +254,9 @@ Screen* MainScreen::tick(float time_delta, bool& quit) { mts.iterate(); // compute _min_tick_interval = std::min( - tc.toxIterationInterval()/1000.f, + // HACK: pow by 1.6 to increase 50 -> ~500 (~522) + // and it does not change 1 + std::pow(tc.toxIterationInterval(), 1.6f)/1000.f, pm_interval ); _min_tick_interval = std::min( @@ -261,6 +264,8 @@ Screen* MainScreen::tick(float time_delta, bool& quit) { fo_interval ); + //std::cout << "MS: min tick interval: " << _min_tick_interval << "\n"; + switch (_compute_perf_mode) { // normal 1ms lower bound case 0: _min_tick_interval = std::max(_min_tick_interval, 0.001f); break; diff --git a/src/send_image_popup.hpp b/src/send_image_popup.hpp index 2e5f000..9e60b5e 100644 --- a/src/send_image_popup.hpp +++ b/src/send_image_popup.hpp @@ -32,7 +32,7 @@ struct SendImagePopup { Rect crop_rect; Rect crop_before_drag; - bool cropping {false}; + bool cropping {true}; bool dragging_last_frame_ul {false}; bool dragging_last_frame_lr {false}; diff --git a/src/tox_friend_faux_offline_messaging.hpp b/src/tox_friend_faux_offline_messaging.hpp index 200e827..ed0a424 100644 --- a/src/tox_friend_faux_offline_messaging.hpp +++ b/src/tox_friend_faux_offline_messaging.hpp @@ -24,7 +24,7 @@ class ToxFriendFauxOfflineMessaging : public ToxEventI { // TODO: increase timer? const float _delay_after_cc {4.5f}; - const float _delay_inbetween {1.3f}; + const float _delay_inbetween {0.3f}; const float _delay_retry {10.f}; // retry sending after 10s public: