Skip to content

Commit

Permalink
deprecate multiple bink versions support
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed May 22, 2024
1 parent 02625db commit 1a43d95
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions source/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,7 @@ namespace OverloadFromFolder
#define IDR_VORBISF 101
#define IDR_WNDMODE 103
#define IDR_WNDWINI 104
#define IDR_BINK00018X 105
#define IDR_BINK00019U 106
#define IDR_BINK00199W 107
#define IDR_BINK01994I 108
#define IDR_BINK 105
#endif

HMODULE LoadLib(const std::wstring& lpLibFileName);
Expand Down Expand Up @@ -532,26 +529,7 @@ void LoadOriginalLibrary()
}
else
{
SYSTEMTIME t = {};
ModuleList dlls;
dlls.Enumerate(ModuleList::SearchLocation::LocalOnly);
for (auto& e : dlls.m_moduleList)
{
auto hInstance = (size_t)std::get<HMODULE>(e);
IMAGE_NT_HEADERS* ntHeader = (IMAGE_NT_HEADERS*)(hInstance + ((IMAGE_DOS_HEADER*)hInstance)->e_lfanew);
SYSTEMTIME stUTC, stLocal;
LONGLONG ll;
FILETIME ft;
ll = Int32x32To64(ntHeader->FileHeader.TimeDateStamp, 10000000) + 116444736000000000;
ft.dwLowDateTime = (DWORD)ll;
ft.dwHighDateTime = ll >> 32;
FileTimeToSystemTime(&ft, &stUTC);
SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
if (t.wYear == 0 || t.wYear > stLocal.wYear)
t = stLocal;
}

HRSRC hResource = FindResource(hm, MAKEINTRESOURCE((t.wYear <= 2007) ? IDR_BINK00018X : (t.wYear <= 2010) ? IDR_BINK00019U : (t.wYear <= 2012) ? IDR_BINK00199W : IDR_BINK01994I), RT_RCDATA);
HRSRC hResource = FindResource(hm, MAKEINTRESOURCE(IDR_BINK), RT_RCDATA);
if (hResource)
{
HGLOBAL hLoadedResource = LoadResource(hm, hResource);
Expand Down
Binary file modified source/resources/UALx86.rc
Binary file not shown.
File renamed without changes.
Binary file removed source/resources/binkw32_1.8.18.0.dll
Binary file not shown.
Binary file removed source/resources/binkw32_1.9.21.0.dll
Binary file not shown.
Binary file removed source/resources/binkw32_1.9.99.0.dll
Binary file not shown.

0 comments on commit 1a43d95

Please sign in to comment.