mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8932 from Robyt3/Client-Network-Before-Graphics
Initialize client networking before graphics
This commit is contained in:
commit
d5e81ca78d
|
@ -2929,6 +2929,24 @@ void CClient::Run()
|
|||
g_UuidManager.DebugDump();
|
||||
}
|
||||
|
||||
#ifndef CONF_WEBASM
|
||||
char aNetworkError[256];
|
||||
if(!InitNetworkClient(aNetworkError, sizeof(aNetworkError)))
|
||||
{
|
||||
log_error("client", "%s", aNetworkError);
|
||||
ShowMessageBox("Network Error", aNetworkError);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!m_Http.Init(std::chrono::seconds{1}))
|
||||
{
|
||||
const char *pErrorMessage = "Failed to initialize the HTTP client.";
|
||||
log_error("client", "%s", pErrorMessage);
|
||||
ShowMessageBox("HTTP Error", pErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// init graphics
|
||||
m_pGraphics = CreateEngineGraphicsThreaded();
|
||||
Kernel()->RegisterInterface(m_pGraphics); // IEngineGraphics
|
||||
|
@ -2952,24 +2970,6 @@ void CClient::Run()
|
|||
CVideo::Init();
|
||||
#endif
|
||||
|
||||
#ifndef CONF_WEBASM
|
||||
char aNetworkError[256];
|
||||
if(!InitNetworkClient(aNetworkError, sizeof(aNetworkError)))
|
||||
{
|
||||
log_error("client", "%s", aNetworkError);
|
||||
ShowMessageBox("Network Error", aNetworkError);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!m_Http.Init(std::chrono::seconds{1}))
|
||||
{
|
||||
const char *pErrorMessage = "Failed to initialize the HTTP client.";
|
||||
log_error("client", "%s", pErrorMessage);
|
||||
ShowMessageBox("HTTP Error", pErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// init text render
|
||||
m_pTextRender = Kernel()->RequestInterface<IEngineTextRender>();
|
||||
m_pTextRender->Init();
|
||||
|
|
Loading…
Reference in a new issue