Check if renderer lib exists before loading it.

This is a noop change, we're just bailing out somewhat earlier.
This commit is contained in:
Yamagi 2021-05-25 11:43:11 +02:00
parent 496985eb90
commit 84312ae8b7

View file

@ -404,6 +404,14 @@ VID_LoadRenderer(void)
VID_GetRendererLibPath(vid_renderer->string, reflib_path, sizeof(reflib_path));
Com_Printf("Loading library: %s\n", reflib_name);
// Check if the renderer libs exists.
if (!VID_HasRenderer(vid_renderer->string))
{
Com_Printf("Library %s cannot be found!\n", reflib_name);
return false;
}
// Mkay, let's load the requested renderer.
GetRefAPI = Sys_LoadLibrary(reflib_path, "GetRefAPI", &reflib_handle);
@ -411,7 +419,7 @@ VID_LoadRenderer(void)
// caller to recover from this.
if (GetRefAPI == NULL)
{
Com_Printf("Loading %s as renderer lib failed!", reflib_path);
Com_Printf("Loading %s as renderer lib failed!\n", reflib_name);
return false;
}