diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c89f73c0f..f8279e2989 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -550,7 +550,7 @@ include_directories(Externals/Slippi) add_subdirectory(Externals/semver) include_directories(Externals/semver/include) add_subdirectory(Externals/open-vcdiff) -include_directories(Externals/open-vcdiff) +include_directories(Externals) find_package(pugixml) if(NOT pugixml_FOUND) diff --git a/Externals/Slippi/CMakeLists.txt b/Externals/Slippi/CMakeLists.txt index f51a13a932..5e7d16318b 100644 --- a/Externals/Slippi/CMakeLists.txt +++ b/Externals/Slippi/CMakeLists.txt @@ -17,5 +17,3 @@ endif() add_library(Slippi STATIC ${SRCS}) -target_include_directories(Slippi PUBLIC "../nlohmann") - diff --git a/Externals/soundtouch/FIFOSamplePipe.h b/Externals/soundtouch/FIFOSamplePipe.h index 6e3105970b..b97372591b 100644 --- a/Externals/soundtouch/FIFOSamplePipe.h +++ b/Externals/soundtouch/FIFOSamplePipe.h @@ -48,9 +48,9 @@ #ifndef FIFOSamplePipe_H #define FIFOSamplePipe_H -#include #include #include "STTypes.h" +#include namespace soundtouch { diff --git a/Externals/soundtouch/assert.h b/Externals/soundtouch/assert.h new file mode 100644 index 0000000000..802c963e9d --- /dev/null +++ b/Externals/soundtouch/assert.h @@ -0,0 +1,41 @@ +// +// assert.h +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Defines the assert macro and related functionality. +// +#if defined _VCRT_BUILD && !defined _ASSERT_OK +#error assert.h not for CRT internal use +#endif + +#include + +_CRT_BEGIN_C_HEADER + + + +#undef assert + +#ifdef NDEBUG + +#define assert(expression) ((void)0) + +#else + +_ACRTIMP void __cdecl _wassert( + _In_z_ wchar_t const* _Message, + _In_z_ wchar_t const* _File, + _In_ unsigned _Line +); + +#define assert(expression) (void)( \ + (!!(expression)) || \ + (_wassert(_CRT_WIDE(#expression), _CRT_WIDE(__FILE__), (unsigned)(__LINE__)), 0) \ + ) + +#endif + + + +_CRT_END_C_HEADER diff --git a/Source/Core/Core/NetPlayProto.h b/Source/Core/Core/NetPlayProto.h index 517abde8e9..6be21f4441 100644 --- a/Source/Core/Core/NetPlayProto.h +++ b/Source/Core/Core/NetPlayProto.h @@ -131,6 +131,11 @@ enum NP_MSG_WIIMOTE_DATA = 0x70, NP_MSG_WIIMOTE_MAPPING = 0x71, + NP_MSG_SLIPPI_PAD = 0x80, + NP_MSG_SLIPPI_PAD_ACK = 0x81, + NP_MSG_SLIPPI_MATCH_SELECTIONS = 0x82, + NP_MSG_SLIPPI_CONN_SELECTED = 0x83, + NP_MSG_GOLF_REQUEST = 0x90, NP_MSG_GOLF_SWITCH = 0x91, NP_MSG_GOLF_ACQUIRE = 0x92, diff --git a/Source/Core/Core/Slippi/SlippiNetplay.cpp b/Source/Core/Core/Slippi/SlippiNetplay.cpp index e4ddb1c8f8..9fef58456e 100644 --- a/Source/Core/Core/Slippi/SlippiNetplay.cpp +++ b/Source/Core/Core/Slippi/SlippiNetplay.cpp @@ -203,19 +203,19 @@ unsigned int SlippiNetplayClient::OnData(sf::Packet& packet) lastFrameAcked = frame > lastFrameAcked ? frame : lastFrameAcked; // Remove old timings - while (!ackTimers.Empty() && ackTimers.Front().frame < frame) + while (!ackTimers.empty() && ackTimers.front().frame < frame) { - ackTimers.Pop(); + ackTimers.pop(); } // Don't get a ping if we do not have the right ack frame - if (ackTimers.Empty() || ackTimers.Front().frame != frame) + if (ackTimers.empty() || ackTimers.front().frame != frame) { break; } - auto sendTime = ackTimers.Front().timeUs; - ackTimers.Pop(); + auto sendTime = ackTimers.front().timeUs; + ackTimers.pop(); pingUs = Common::Timer::GetTimeUs() - sendTime; if (g_ActiveConfig.bShowNetPlayPing && frame % SLIPPI_PING_DISPLAY_INTERVAL == 0) @@ -340,7 +340,7 @@ void SlippiNetplayClient::SendAsync(std::unique_ptr packet) { { std::lock_guard lkq(m_crit.async_queue_write); - m_async_queue.Push(std::move(packet)); + m_async_queue.push(std::move(packet)); } ENetUtil::WakeupThread(m_client); } @@ -431,10 +431,10 @@ void SlippiNetplayClient::ThreadFunc() ENetEvent netEvent; int net; net = enet_host_service(m_client, &netEvent, 250); - while (!m_async_queue.Empty()) + while (!m_async_queue.empty()) { - Send(*(m_async_queue.Front().get())); - m_async_queue.Pop(); + Send(*(m_async_queue.front().get())); + m_async_queue.pop(); } if (net > 0) { diff --git a/Source/Core/Core/Slippi/SlippiNetplay.h b/Source/Core/Core/Slippi/SlippiNetplay.h index e2202a513e..ccad38188e 100644 --- a/Source/Core/Core/Slippi/SlippiNetplay.h +++ b/Source/Core/Core/Slippi/SlippiNetplay.h @@ -6,7 +6,6 @@ #include "Common/CommonTypes.h" #include "Common/Event.h" -#include "Common/FifoQueue.h" #include "Common/Timer.h" #include "Common/TraversalClient.h" #include "Core/NetPlayProto.h" @@ -21,6 +20,7 @@ #include #include #include +#include #ifdef _WIN32 #include @@ -140,7 +140,7 @@ protected: std::recursive_mutex async_queue_write; } m_crit; - Common::FifoQueue, false> m_async_queue; + std::queue> m_async_queue; std::string oppName = ""; @@ -178,7 +178,7 @@ protected: u64 pingUs; std::deque> localPadQueue; // most recent inputs at start of deque std::deque> remotePadQueue; // most recent inputs at start of deque - Common::FifoQueue ackTimers; + std::queue ackTimers; SlippiConnectStatus slippiConnectStatus = SlippiConnectStatus::NET_CONNECT_STATUS_UNSET; SlippiMatchInfo matchInfo;