Revert the recent changes related to updating hwnd

This commit is contained in:
skidau
2015-03-28 11:08:25 +11:00
parent 74f25ad8ec
commit 4f965da4f1
5 changed files with 6 additions and 29 deletions

View File

@ -26,7 +26,6 @@
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
#include "Core/DSPEmulator.h" #include "Core/DSPEmulator.h"
#include "Core/Host.h" #include "Core/Host.h"
#include "Core/HotkeyManager.h"
#include "Core/MemTools.h" #include "Core/MemTools.h"
#include "Core/Movie.h" #include "Core/Movie.h"
#include "Core/NetPlayProto.h" #include "Core/NetPlayProto.h"
@ -97,7 +96,6 @@ static bool s_is_stopping = false;
static bool s_hardware_initialized = false; static bool s_hardware_initialized = false;
static bool s_is_started = false; static bool s_is_started = false;
static void* s_window_handle = nullptr; static void* s_window_handle = nullptr;
static bool s_window_handle_changed = false;
static std::string s_state_filename; static std::string s_state_filename;
static std::thread s_emu_thread; static std::thread s_emu_thread;
static StoppedCallbackFunc s_on_stopped_callback = nullptr; static StoppedCallbackFunc s_on_stopped_callback = nullptr;
@ -230,12 +228,7 @@ bool Init()
!!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR")); !!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
} }
s_window_handle_changed = false;
if (s_window_handle != Host_GetRenderHandle())
{
s_window_handle = Host_GetRenderHandle(); s_window_handle = Host_GetRenderHandle();
s_window_handle_changed = true;
}
// Start the emu thread // Start the emu thread
s_emu_thread = std::thread(EmuThread); s_emu_thread = std::thread(EmuThread);
@ -437,11 +430,6 @@ void EmuThread()
else else
{ {
// Update references in case controllers were refreshed // Update references in case controllers were refreshed
if (s_window_handle_changed)
{
g_controller_interface.Initialize(s_window_handle);
HotkeyManagerEmu::LoadConfig();
}
Pad::LoadConfig(); Pad::LoadConfig();
Keyboard::LoadConfig(); Keyboard::LoadConfig();
} }
@ -456,10 +444,9 @@ void EmuThread()
// Activate Wiimotes which don't have source set to "None" // Activate Wiimotes which don't have source set to "None"
for (unsigned int i = 0; i != MAX_BBMOTES; ++i) for (unsigned int i = 0; i != MAX_BBMOTES; ++i)
{
if (g_wiimote_sources[i]) if (g_wiimote_sources[i])
GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true); GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true);
}
} }
AudioCommon::InitSoundStream(); AudioCommon::InitSoundStream();
@ -570,7 +557,6 @@ void EmuThread()
if (init_controllers) if (init_controllers)
{ {
if (core_parameter.bWii)
Wiimote::Shutdown(); Wiimote::Shutdown();
Keyboard::Shutdown(); Keyboard::Shutdown();
Pad::Shutdown(); Pad::Shutdown();

View File

@ -39,4 +39,6 @@ namespace HotkeyManagerEmu
bool IsEnabled(); bool IsEnabled();
void Enable(bool enable_toggle); void Enable(bool enable_toggle);
bool IsPressed(int Id, bool held); bool IsPressed(int Id, bool held);
static bool enabled;
} }

View File

@ -1060,9 +1060,6 @@ GamepadPage::GamepadPage(wxWindow* parent, InputConfig& config, const unsigned i
mapping->Add(dio, 1, wxEXPAND|wxLEFT|wxTOP|wxBOTTOM, 5); mapping->Add(dio, 1, wxEXPAND|wxLEFT|wxTOP|wxBOTTOM, 5);
mapping->Add(control_group_sizer, 0, wxLEFT|wxEXPAND, 5); mapping->Add(control_group_sizer, 0, wxLEFT|wxEXPAND, 5);
wxCommandEvent event;
RefreshDevices(event);
UpdateGUI(); UpdateGUI();
SetSizerAndFit(mapping); // needed SetSizerAndFit(mapping); // needed

View File

@ -44,7 +44,7 @@ ControllerInterface g_controller_interface;
void ControllerInterface::Initialize(void* const hwnd) void ControllerInterface::Initialize(void* const hwnd)
{ {
if (m_is_init) if (m_is_init)
DeInit(); return;
m_hwnd = hwnd; m_hwnd = hwnd;
@ -102,11 +102,6 @@ void ControllerInterface::Shutdown()
delete d; delete d;
} }
DeInit();
}
void ControllerInterface::DeInit()
{
m_devices.clear(); m_devices.clear();
#ifdef CIFACE_USE_XINPUT #ifdef CIFACE_USE_XINPUT

View File

@ -117,9 +117,6 @@ public:
void Initialize(void* const hwnd); void Initialize(void* const hwnd);
void Reinitialize(); void Reinitialize();
void Shutdown(); void Shutdown();
void DeInit();
bool IsInit() const { return m_is_init; } bool IsInit() const { return m_is_init; }
void UpdateReference(ControlReference* control, const ciface::Core::DeviceQualifier& default_device) const; void UpdateReference(ControlReference* control, const ciface::Core::DeviceQualifier& default_device) const;