mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Don't crash on failed initialization
This commit is contained in:
parent
427004a703
commit
8cdf5a41d8
|
@ -8,15 +8,18 @@
|
|||
#include "PluginAPI.h"
|
||||
#include "FrameBuffer.h"
|
||||
|
||||
void DisplayWindow::start()
|
||||
bool DisplayWindow::start()
|
||||
{
|
||||
_start(); // TODO: process initialization error
|
||||
if (!_start())
|
||||
return false;
|
||||
|
||||
graphics::ObjectHandle::defaultFramebuffer = _getDefaultFramebuffer();
|
||||
|
||||
gfxContext.init();
|
||||
m_drawer._initData();
|
||||
m_buffersSwapCount = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DisplayWindow::stop()
|
||||
|
@ -113,7 +116,8 @@ bool DisplayWindow::resizeWindow()
|
|||
return false;
|
||||
m_drawer._destroyData();
|
||||
if (!_resizeWindow())
|
||||
_start();
|
||||
if(!_start())
|
||||
return false;
|
||||
updateScale();
|
||||
m_drawer._initData();
|
||||
m_bResizeWindow = false;
|
||||
|
|
|
@ -7,7 +7,7 @@ class DisplayWindow
|
|||
public:
|
||||
virtual ~DisplayWindow() {}
|
||||
|
||||
void start();
|
||||
bool start();
|
||||
void stop();
|
||||
void restart();
|
||||
void swapBuffers();
|
||||
|
|
|
@ -75,8 +75,6 @@ void DisplayWindowMupen64plus::_setAttributes()
|
|||
|
||||
bool DisplayWindowMupen64plus::_start()
|
||||
{
|
||||
FunctionWrapper::setThreadedMode(config.video.threadedVideo);
|
||||
|
||||
#ifdef EGL
|
||||
// Normally this is initialized externally through VidExt, but if VidExt is not implemented,
|
||||
// do this here anyways. Calling eglInitialize has no negative effect according to the spec
|
||||
|
@ -92,6 +90,7 @@ bool DisplayWindowMupen64plus::_start()
|
|||
}
|
||||
#endif
|
||||
|
||||
FunctionWrapper::setThreadedMode(config.video.threadedVideo);
|
||||
FunctionWrapper::CoreVideo_Init();
|
||||
_setAttributes();
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ EXPORT int CALL RomOpen(void)
|
|||
else
|
||||
RDRAMSize = 0;
|
||||
|
||||
api().RomOpen();
|
||||
return 1;
|
||||
return api().RomOpen();
|
||||
}
|
||||
|
||||
EXPORT m64p_error CALL PluginGetVersion(
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
void ProcessDList();
|
||||
void ProcessRDPList();
|
||||
void RomClosed();
|
||||
void RomOpen();
|
||||
int RomOpen();
|
||||
void ShowCFB();
|
||||
void UpdateScreen();
|
||||
int InitiateGFX(const GFX_INFO & _gfxInfo);
|
||||
|
|
|
@ -194,7 +194,7 @@ void PluginAPI::RomClosed()
|
|||
#endif
|
||||
}
|
||||
|
||||
void PluginAPI::RomOpen()
|
||||
int PluginAPI::RomOpen()
|
||||
{
|
||||
LOG(LOG_APIFUNC, "RomOpen");
|
||||
#ifdef RSPTHREAD
|
||||
|
@ -207,9 +207,12 @@ void PluginAPI::RomOpen()
|
|||
RSP_Init();
|
||||
GBI.init();
|
||||
Config_LoadConfig();
|
||||
dwnd().start();
|
||||
if (!dwnd().start())
|
||||
return 0;
|
||||
#endif
|
||||
m_bRomOpen = true;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void PluginAPI::ShowCFB()
|
||||
|
|
Loading…
Reference in New Issue
Block a user