From 653db9ab9b5fa6027a7a71c95660239a0a12e85d Mon Sep 17 00:00:00 2001 From: Green Sky Date: Fri, 25 Oct 2024 12:57:00 +0200 Subject: [PATCH] use sr --- external/CMakeLists.txt | 3 ++- src/solanaceae/toxic_games/toxic_games.cpp | 10 ++++++---- src/solanaceae/toxic_games/toxic_games.hpp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 3b957f3..0a87f7d 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -6,7 +6,7 @@ if (NOT TARGET imgui) message("II using FetchContent imgui") FetchContent_Declare(imgui GIT_REPOSITORY https://github.com/ocornut/imgui.git - GIT_TAG 8199457 # v1.91.0 + GIT_TAG cb16568 # v1.91.3 EXCLUDE_FROM_ALL ) @@ -32,6 +32,7 @@ if (NOT TARGET imgui) ) target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR}) target_compile_features(imgui PUBLIC cxx_std_11) + target_compile_definitions(imgui PUBLIC IMGUI_USE_WCHAR32) endif() endif() diff --git a/src/solanaceae/toxic_games/toxic_games.cpp b/src/solanaceae/toxic_games/toxic_games.cpp index 5038fbc..98c1ad0 100644 --- a/src/solanaceae/toxic_games/toxic_games.cpp +++ b/src/solanaceae/toxic_games/toxic_games.cpp @@ -18,7 +18,7 @@ ToxicGames::ToxicGames( ) : _cr(cr), _t(t), - _tep(tep), + _tep_sr(tep.newSubRef(this)), _tcm(tcm) { @@ -29,9 +29,11 @@ ToxicGames::ToxicGames( } // register custom packet handlers - _tep.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_LOSSLESS_PACKET); - _tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PACKET); - _tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PRIVATE_PACKET); + _tep_sr + .subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_LOSSLESS_PACKET) + .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PACKET) + .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PRIVATE_PACKET) + ; } //void ToxicGames::addGameInstance(uint8_t game_type, uint32_t game_id, std::unique_ptr instance) { diff --git a/src/solanaceae/toxic_games/toxic_games.hpp b/src/solanaceae/toxic_games/toxic_games.hpp index 7f3a9f0..cfda402 100644 --- a/src/solanaceae/toxic_games/toxic_games.hpp +++ b/src/solanaceae/toxic_games/toxic_games.hpp @@ -16,7 +16,7 @@ class ToxicGames : public ToxEventI { Contact3Registry& _cr; ToxI& _t; - ToxEventProviderI& _tep; + ToxEventProviderI::SubscriptionReference _tep_sr; ToxContactModel2& _tcm; std::map> _game_types;