Skip to content

Commit dec931c

Browse files
committed
Merge branch 'new-readme' into 'main'
Update the README basing on union-api See merge request union-framework/gothic-api!39 Merge branch 'main' into 'main' Update dependencies repositories url See merge request union-framework/union-api!14
1 parent f8ce719 commit dec931c

3 files changed

Lines changed: 58 additions & 2 deletions

File tree

dependencies/union/gothic-api

Submodule gothic-api updated from 6ed3b83 to 82611e4

dependencies/union/union-api

Submodule union-api updated from ede619b to 0105250

src/DllMain.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include <Windows.h>
2+
#include <ZenGin/zGothicAPI.h>
3+
4+
BOOL WINAPI DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpvReserved)
5+
{
6+
switch (fdwReason)
7+
{
8+
case DLL_PROCESS_ATTACH:
9+
// Initialize once for each new process.
10+
// Return FALSE to fail DLL load.
11+
12+
switch (GetGameVersion())
13+
{
14+
#ifdef __G1
15+
case Engine_G1:
16+
break;
17+
#endif
18+
19+
#ifdef __G1A
20+
case Engine_G1A:
21+
break;
22+
#endif
23+
24+
#ifdef __G2
25+
case Engine_G2:
26+
break;
27+
#endif
28+
29+
#ifdef __G2A
30+
case Engine_G2A:
31+
break;
32+
#endif
33+
34+
default:
35+
return FALSE;
36+
}
37+
break;
38+
39+
case DLL_PROCESS_DETACH:
40+
if (lpvReserved != nullptr)
41+
break; // do not do cleanup if process termination scenario
42+
43+
// Perform any necessary cleanup.
44+
break;
45+
46+
case DLL_THREAD_ATTACH:
47+
// Do thread-specific initialization.
48+
break;
49+
50+
case DLL_THREAD_DETACH:
51+
// Do thread-specific cleanup.
52+
break;
53+
}
54+
55+
return TRUE;
56+
}

0 commit comments

Comments
 (0)