Skip to content

Commit 43e794b

Browse files
committed
Fix missing miles32 import
1 parent b452480 commit 43e794b

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

src/cl_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4841,8 +4841,6 @@ int CL_ReceiveContentFromServerInBuffer(const char* url, byte* updateinfodata, i
48414841
// DHM - Nerve
48424842
void CL_GetUpdateInfo()
48434843
{
4844-
Sys_LeaveGlobalCriticalSection();
4845-
48464844
autoupdateChecked = qtrue;
48474845
}
48484846

src/win_main.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,43 @@ void Sys_CreateMainWindowClass(){
299299
}
300300
}
301301

302+
void Sys_LoadModules(HINSTANCE hInstance){
303+
HINSTANCE base;
304+
FARPROC proc;
305+
int i, copylen;
306+
char moduledir[1024];
307+
char mss32path[1024];
308+
char miles32path[1024];
309+
static qboolean loaded = qfalse;
310+
char* find;
311+
312+
if(loaded == qtrue)
313+
return;
314+
315+
copylen = GetModuleFileNameA(hInstance, moduledir, sizeof(moduledir));
316+
317+
if (copylen < 1 || strrchr(moduledir, '\\') == NULL)
318+
{
319+
Q_strncpyz(miles32path, "miles32.dll", sizeof(miles32path));
320+
} else {
321+
find = strrchr(moduledir, '\\');
322+
*find = '\0';
323+
Com_sprintf(miles32path, sizeof(miles32path), "%s\\miles32.dll", moduledir);
324+
}
325+
326+
327+
base = LoadLibraryA(miles32path);
328+
329+
if(!base){
330+
preInitError("Error loading module mss32.dll\n");
331+
}
332+
proc = GetProcAddress(base, "_AIL_set_DirectSound_HWND@8");
333+
if(!proc)
334+
preInitError("No entry point for procedure _AIL_set_DirectSound_HWND\n");
335+
336+
mss.AIL_set_DirectSound_HWND_int = (void*)proc;
337+
}
338+
302339
//================================================================
303340

304341
static char exeFilename[ MAX_STRING_CHARS ] = { 0 };
@@ -643,6 +680,8 @@ __declspec( dllexport ) int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPr
643680

644681
Sys_InitLocalization();
645682

683+
Sys_LoadModules(hInstance);
684+
646685
Com_sprintf(UPDATE_VERSION, sizeof(UPDATE_VERSION), "%s", UPDATE_VERSION_NUM);
647686

648687
if(!strstr(lpCmdLine, "allowdupe") && !strstr(lpCmdLine, "dedicated") && !strstr(lpCmdLine, "installupdatefiles") && !strstr(lpCmdLine, "ui_playerProfileAlreadyChosen"))

0 commit comments

Comments
 (0)