mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
e149ad4f0a
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
43 lines
824 B
C++
43 lines
824 B
C++
// Copyright 2018 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "Common/SFMLHelper.h"
|
|
|
|
#include <SFML/Network/Packet.hpp>
|
|
|
|
sf::Packet& operator>>(sf::Packet& packet, Common::BigEndianValue<u16>& data)
|
|
{
|
|
u16 tmp;
|
|
packet >> tmp;
|
|
data = tmp;
|
|
return packet;
|
|
}
|
|
|
|
sf::Packet& operator>>(sf::Packet& packet, Common::BigEndianValue<u32>& data)
|
|
{
|
|
u32 tmp;
|
|
packet >> tmp;
|
|
data = tmp;
|
|
return packet;
|
|
}
|
|
|
|
sf::Packet& operator>>(sf::Packet& packet, Common::BigEndianValue<u64>& data)
|
|
{
|
|
sf::Uint64 tmp;
|
|
packet >> tmp;
|
|
data = tmp;
|
|
return packet;
|
|
}
|
|
|
|
namespace Common
|
|
{
|
|
// SFML's Uint64 type is different depending on platform,
|
|
// so we have this for cleaner code.
|
|
u64 PacketReadU64(sf::Packet& packet)
|
|
{
|
|
sf::Uint64 value;
|
|
packet >> value;
|
|
return value;
|
|
}
|
|
} // namespace Common
|