mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
Check for gamex86.dll if game.dll wasn't found
This change allows the usage of old mods without renaming their game lib. This is applied to windows only because the few Linux mods out there are broken since a long time due to incompatible changes in libc and the kernel. Requested by Victor Sergeevich.
This commit is contained in:
parent
55a65bb53e
commit
de3da4ba70
1 changed files with 12 additions and 2 deletions
|
@ -328,7 +328,6 @@ void *
|
|||
Sys_GetGameAPI(void *parms)
|
||||
{
|
||||
void *(*GetGameAPI)(void *);
|
||||
const char *gamename = "game.dll";
|
||||
char name[MAX_OSPATH];
|
||||
char *path = NULL;
|
||||
|
||||
|
@ -349,7 +348,8 @@ Sys_GetGameAPI(void *parms)
|
|||
return NULL; /* couldn't find one anywhere */
|
||||
}
|
||||
|
||||
Com_sprintf(name, sizeof(name), "%s/%s", path, gamename);
|
||||
/* Try game.dll */
|
||||
Com_sprintf(name, sizeof(name), "%s/%s", path, "game.dll");
|
||||
game_library = LoadLibrary(name);
|
||||
|
||||
if (game_library)
|
||||
|
@ -357,6 +357,16 @@ Sys_GetGameAPI(void *parms)
|
|||
Com_DPrintf("LoadLibrary (%s)\n", name);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Try gamex86.dll as fallback */
|
||||
Com_sprintf(name, sizeof(name), "%s/%s", path, "gamex86.dll");
|
||||
game_library = LoadLibrary(name);
|
||||
|
||||
if (game_library)
|
||||
{
|
||||
Com_DPrintf("LoadLibrary (%s)\n", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GetGameAPI = (void *)GetProcAddress(game_library, "GetGameAPI");
|
||||
|
|
Loading…
Reference in a new issue