diff options
Diffstat (limited to 'src/libui_sdl/Platform.cpp')
-rw-r--r-- | src/libui_sdl/Platform.cpp | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 5cbb142..2c467ac 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -22,7 +22,8 @@ #include <SDL2/SDL.h> #include "../Platform.h" #include "../Config.h" -#include "LAN.h" +#include "LAN_Socket.h" +#include "LAN_PCap.h" #ifdef __WIN32__ #include <winsock2.h> @@ -261,23 +262,43 @@ int MP_RecvPacket(u8* data, bool block) bool LAN_Init() { - if (!LAN::Init()) return false; + if (Config::DirectLAN) + { + if (!LAN_PCap::Init()) + return false; + } + else + { + if (!LAN_Socket::Init()) + return false; + } + return true; } void LAN_DeInit() { - LAN::DeInit(); + // checkme. blarg + if (Config::DirectLAN) + LAN_PCap::DeInit(); + else + LAN_Socket::DeInit(); } int LAN_SendPacket(u8* data, int len) { - return LAN::SendPacket(data, len); + if (Config::DirectLAN) + return LAN_PCap::SendPacket(data, len); + else + return LAN_Socket::SendPacket(data, len); } int LAN_RecvPacket(u8* data) { - return LAN::RecvPacket(data); + if (Config::DirectLAN) + return LAN_PCap::RecvPacket(data); + else + return LAN_Socket::RecvPacket(data); } |