mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-06 21:40:05 +00:00
Merge pull request #3589 from mathieui/gcadapter-recording
Fix recording a movie with the GC Adapter
This commit is contained in:
commit
f752c6e704
@ -260,9 +260,25 @@ void Init()
|
|||||||
g_Channel[i].m_InLo.Hex = 0;
|
g_Channel[i].m_InLo.Hex = 0;
|
||||||
|
|
||||||
if (Movie::IsMovieActive())
|
if (Movie::IsMovieActive())
|
||||||
AddDevice(Movie::IsUsingPad(i) ? (Movie::IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
|
{
|
||||||
|
if (Movie::IsUsingPad(i))
|
||||||
|
{
|
||||||
|
SIDevices current = SConfig::GetInstance().m_SIDevice[i];
|
||||||
|
// GC pad-compatible devices can be used for both playing and recording
|
||||||
|
if (SIDevice_IsGCController(current))
|
||||||
|
AddDevice(Movie::IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : current, i);
|
||||||
|
else
|
||||||
|
AddDevice(Movie::IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER, i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddDevice(SIDEVICE_NONE, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (!NetPlay::IsNetPlayRunning())
|
else if (!NetPlay::IsNetPlayRunning())
|
||||||
|
{
|
||||||
AddDevice(SConfig::GetInstance().m_SIDevice[i], i);
|
AddDevice(SConfig::GetInstance().m_SIDevice[i], i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Poll.Hex = 0;
|
g_Poll.Hex = 0;
|
||||||
|
@ -67,6 +67,26 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Check if a device class is inheriting from CSIDevice_GCController
|
||||||
|
// The goal of this function is to avoid special casing a long list of
|
||||||
|
// device types when there is no "real" input device, e.g. when playing
|
||||||
|
// a TAS movie, or netplay input.
|
||||||
|
bool SIDevice_IsGCController(SIDevices type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case SIDEVICE_GC_CONTROLLER:
|
||||||
|
case SIDEVICE_WIIU_ADAPTER:
|
||||||
|
case SIDEVICE_GC_TARUKONGA:
|
||||||
|
case SIDEVICE_DANCEMAT:
|
||||||
|
case SIDEVICE_GC_STEERING:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// F A C T O R Y
|
// F A C T O R Y
|
||||||
std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number)
|
std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number)
|
||||||
{
|
{
|
||||||
|
@ -107,4 +107,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool SIDevice_IsGCController(SIDevices type);
|
||||||
|
|
||||||
std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number);
|
std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number);
|
||||||
|
@ -765,10 +765,10 @@ void NetPlayClient::UpdateDevices()
|
|||||||
// so they should be added first.
|
// so they should be added first.
|
||||||
for (auto player_id : m_pad_map)
|
for (auto player_id : m_pad_map)
|
||||||
{
|
{
|
||||||
// Use local controller types for local controllers
|
// Use local controller types for local controllers if they are compatible
|
||||||
if (player_id == m_local_player->pid)
|
if (player_id == m_local_player->pid)
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_SIDevice[local_pad] != SIDEVICE_NONE)
|
if (SIDevice_IsGCController(SConfig::GetInstance().m_SIDevice[local_pad]))
|
||||||
{
|
{
|
||||||
SerialInterface::AddDevice(SConfig::GetInstance().m_SIDevice[local_pad], local_pad);
|
SerialInterface::AddDevice(SConfig::GetInstance().m_SIDevice[local_pad], local_pad);
|
||||||
}
|
}
|
||||||
|
@ -797,7 +797,7 @@ void CFrame::OnRecord(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER || SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
if (SIDevice_IsGCController(SConfig::GetInstance().m_SIDevice[i]))
|
||||||
controllers |= (1 << i);
|
controllers |= (1 << i);
|
||||||
|
|
||||||
if (g_wiimote_sources[i] != WIIMOTE_SRC_NONE)
|
if (g_wiimote_sources[i] != WIIMOTE_SRC_NONE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user