NetPlay: Use std::array for the pad mappings

This commit is contained in:
Lioncash 2015-08-16 00:08:09 -04:00
parent e3ffb2dd16
commit b1af2a6bbc
4 changed files with 10 additions and 7 deletions

View File

@ -121,8 +121,8 @@ protected:
u32 m_current_game;
PadMapping m_pad_map[4];
PadMapping m_wiimote_map[4];
PadMappingArray m_pad_map;
PadMappingArray m_wiimote_map;
bool m_is_recording;

View File

@ -4,6 +4,7 @@
#pragma once
#include <array>
#include <vector>
#include "Common/CommonTypes.h"
#include "Core/HW/EXI_Device.h"
@ -77,8 +78,9 @@ enum
using NetWiimote = std::vector<u8>;
using MessageId = u8;
using PlayerId = u8;
using PadMapping = s8;
using FrameNum = u32;
using PadMapping = s8;
using PadMappingArray = std::array<PadMapping, 4>;
namespace NetPlay
{

View File

@ -74,8 +74,9 @@ NetPlayServer::NetPlayServer(const u16 port, bool traversal, const std::string&
PanicAlertT("Enet Didn't Initialize");
}
memset(m_pad_map, -1, sizeof(m_pad_map));
memset(m_wiimote_map, -1, sizeof(m_wiimote_map));
m_pad_map.fill(-1);
m_wiimote_map.fill(-1);
if (traversal)
{
if (!EnsureTraversalClient(centralServer, centralPort))

View File

@ -95,8 +95,8 @@ private:
bool m_update_pings;
u32 m_current_game;
unsigned int m_target_buffer_size;
PadMapping m_pad_map[4];
PadMapping m_wiimote_map[4];
PadMappingArray m_pad_map;
PadMappingArray m_wiimote_map;
std::map<PlayerId, Client> m_players;