-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mod.cpp
94 lines (81 loc) · 2.9 KB
/
Mod.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "Patches.h"
#include "Util.h"
// =====================================================================================================================
BOOL APIENTRY DllMain(
HINSTANCE hInstDll,
DWORD fdwReason,
LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH) {
g_hInst = hInstDll;
}
return TRUE;
}
// =====================================================================================================================
DLLAPI void InitMod(
const char* pIniSectionName)
{
bool success = SetGameVersion(true);
// Misc
success &= SetNoCdPatch(true);
success &= SetForceMoraleFix(true);
success &= SetPrintfFloatFix(true);
success &= SetGlobalMusicFix(true);
// Graphics
success &= SetWindowFix(true);
success &= SetDwmFix(true);
success &= SetDpiFix(true);
success &= SetAlphaBlendPatch(true);
success &= SetMineVariantVisibilityPatch(true);
// Stream
success &= SetFileSearchPathPatch(true); // NOTE: This must handle loading patched DLLs like OP2Shell, odasl, etc.
success &= SetChecksumPatch(true);
success &= SetCodecFix(true);
// Netplay
success &= SetNatFix(true);
success &= SetNetGameSpeedPatch(true);
success &= SetBindAnyNetAdapterFix(true);
success &= SetNoCheatsPatch(true);
success &= SetNetProtocolEnabledPatch(true);
success &= SetGameLobbyDefaultsPatch(true);
// UI
success &= SetUiResourceReplacePatch(true);
success &= SetChatLengthPatch(true);
success &= SetChatPingLocationPatch(true);
success &= SetUiHighlightFix(true);
success &= SetIpWindowFocusPatch(true);
success &= SetMiniMapFix(true);
success &= SetLocalizationPatch(true);
success &= SetVehicleCargoDisplayPatch(true);
success &= SetMissionListNamePatch(true);
success &= SetSavantNotificationPatch(true);
success &= SetControlGroupHotkeyPatch(true);
success &= SetDefaultIniSettingsPatch(true);
success &= SetDebugRestartGamePatch(true);
success &= SetUnitHpBarVisibilityPatch(true);
// ScStub
success &= SetScStubPatch(true);
// Map
success &= SetLargeMapPatch(true);
success &= SetCustomMapFlagsPatch(true);
// Mission
success &= SetMissionCallbackPatch(true);
success &= SetMissionDebugNoInstantWin(true);
// Units
success &= SetUnitLimitPatch(true);
success &= SetDrawLightningFix(true);
success &= SetTransferUnitToGaiaFix(true);
success &= SetDoInfectFix(true);
success &= SetBuildWallFix(true);
success &= SetWreckageFix(true);
success &= SetMissileFix(true);
success &= SetPathContextLeakFix(true);
success &= SetNoAlliedDockDamageFix(true);
success &= SetAllyEdwardSurveyMinesPatch(true);
success &= SetMultipleRepairPatch(true);
success &= SetOreRoutePatch(true);
success &= SetTurretAnimationPatch(true);
success &= SetTruckLoadPartialCargoPatch(true);
}