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