Merge pull request #5471 from spycrab/qt_crash_gamestart
Qt: Fix games crashing on start
This commit is contained in:
commit
0d7faf8b61
|
@ -15,8 +15,6 @@
|
|||
|
||||
GCKeyboardEmu::GCKeyboardEmu(MappingWindow* window) : MappingWidget(window)
|
||||
{
|
||||
Keyboard::Initialize();
|
||||
|
||||
CreateMainLayout();
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window)
|
||||
{
|
||||
Pad::Initialize();
|
||||
|
||||
CreateMainLayout();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,11 @@
|
|||
#include "DolphinQt2/Config/Mapping/WiimoteEmuMotionControl.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
#include "InputCommon/InputConfig.h"
|
||||
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
|
||||
MappingWindow::MappingWindow(QWidget* parent, int port_num) : QDialog(parent), m_port(port_num)
|
||||
{
|
||||
setWindowTitle(tr("Port %1").arg(port_num + 1));
|
||||
|
@ -38,8 +39,6 @@ MappingWindow::MappingWindow(QWidget* parent, int port_num) : QDialog(parent), m
|
|||
CreateResetLayout();
|
||||
CreateMainLayout();
|
||||
ConnectWidgets();
|
||||
|
||||
g_controller_interface.Initialize(reinterpret_cast<void*>(winId()));
|
||||
}
|
||||
|
||||
void MappingWindow::CreateDevicesLayout()
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
WiimoteEmuExtension::WiimoteEmuExtension(MappingWindow* window) : MappingWidget(window)
|
||||
{
|
||||
Wiimote::Initialize(Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES);
|
||||
|
||||
CreateClassicLayout();
|
||||
CreateDrumsLayout();
|
||||
CreateGuitarLayout();
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
WiimoteEmuGeneral::WiimoteEmuGeneral(MappingWindow* window, WiimoteEmuExtension* extension)
|
||||
: MappingWidget(window), m_extension_widget(extension)
|
||||
{
|
||||
Wiimote::Initialize(Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES);
|
||||
|
||||
CreateMainLayout();
|
||||
Connect();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
WiimoteEmuMotionControl::WiimoteEmuMotionControl(MappingWindow* window) : MappingWidget(window)
|
||||
{
|
||||
Wiimote::Initialize(Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES);
|
||||
CreateMainLayout();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,12 @@
|
|||
#include "Core/BootManager.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/GCKeyboard.h"
|
||||
#include "Core/HW/GCPad.h"
|
||||
#include "Core/HW/ProcessorInterface.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||
#include "Core/HotkeyManager.h"
|
||||
#include "Core/Movie.h"
|
||||
#include "Core/NetPlayProto.h"
|
||||
#include "Core/State.h"
|
||||
|
@ -24,6 +29,8 @@
|
|||
#include "DolphinQt2/Resources.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
|
||||
MainWindow::MainWindow() : QMainWindow(nullptr)
|
||||
{
|
||||
setWindowTitle(tr("Dolphin"));
|
||||
|
@ -38,6 +45,8 @@ MainWindow::MainWindow() : QMainWindow(nullptr)
|
|||
ConnectRenderWidget();
|
||||
ConnectStack();
|
||||
ConnectMenuBar();
|
||||
|
||||
InitControllers();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -45,6 +54,18 @@ MainWindow::~MainWindow()
|
|||
m_render_widget->deleteLater();
|
||||
}
|
||||
|
||||
void MainWindow::InitControllers()
|
||||
{
|
||||
if (g_controller_interface.IsInit())
|
||||
return;
|
||||
|
||||
g_controller_interface.Initialize(reinterpret_cast<void*>(winId()));
|
||||
Pad::Initialize();
|
||||
Keyboard::Initialize();
|
||||
Wiimote::Initialize(Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES);
|
||||
HotkeyManagerEmu::Initialize();
|
||||
}
|
||||
|
||||
void MainWindow::CreateComponents()
|
||||
{
|
||||
m_menu_bar = new MenuBar(this);
|
||||
|
|
|
@ -65,6 +65,8 @@ private:
|
|||
void ConnectToolBar();
|
||||
void ConnectPathsDialog();
|
||||
|
||||
void InitControllers();
|
||||
|
||||
void StartGame(const QString& path);
|
||||
void ShowRenderWidget();
|
||||
void HideRenderWidget();
|
||||
|
|
Loading…
Reference in New Issue