mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 13:15:45 -04:00
HostInterface: Fix crash on startup with controller connected
This commit is contained in:
@ -295,12 +295,6 @@ bool SDLHostInterface::Initialize()
|
||||
if (!FileSystem::SetWorkingDirectory(m_user_directory.c_str()))
|
||||
Log_ErrorPrintf("Failed to set working directory to '%s'", m_user_directory.c_str());
|
||||
|
||||
// Settings need to be loaded prior to creating the window for OpenGL bits.
|
||||
INISettingsInterface si(GetSettingsFileName());
|
||||
m_settings_copy.Load(si);
|
||||
m_settings = m_settings_copy;
|
||||
m_fullscreen = m_settings_copy.start_fullscreen;
|
||||
|
||||
if (!CreateSDLWindow())
|
||||
{
|
||||
Log_ErrorPrintf("Failed to create SDL window");
|
||||
@ -334,6 +328,15 @@ void SDLHostInterface::Shutdown()
|
||||
HostInterface::Shutdown();
|
||||
}
|
||||
|
||||
void SDLHostInterface::LoadSettings()
|
||||
{
|
||||
// Settings need to be loaded prior to creating the window for OpenGL bits.
|
||||
INISettingsInterface si(GetSettingsFileName());
|
||||
m_settings_copy.Load(si);
|
||||
m_settings = m_settings_copy;
|
||||
m_fullscreen = m_settings_copy.start_fullscreen;
|
||||
}
|
||||
|
||||
void SDLHostInterface::ReportError(const char* message)
|
||||
{
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "DuckStation", message, m_window);
|
||||
|
@ -29,19 +29,21 @@ public:
|
||||
void ReportMessage(const char* message) override;
|
||||
bool ConfirmMessage(const char* message) override;
|
||||
|
||||
bool Initialize();
|
||||
bool Initialize() override;
|
||||
void Shutdown() override;
|
||||
|
||||
void Run();
|
||||
|
||||
protected:
|
||||
void LoadSettings() override;
|
||||
|
||||
bool AcquireHostDisplay() override;
|
||||
void ReleaseHostDisplay() override;
|
||||
std::unique_ptr<AudioStream> CreateAudioStream(AudioBackend backend) override;
|
||||
|
||||
void OnSystemCreated() override;
|
||||
void OnSystemPaused(bool paused) override;
|
||||
void OnSystemDestroyed();
|
||||
void OnSystemDestroyed() override;
|
||||
void OnControllerTypeChanged(u32 slot) override;
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user