Skip to content

Commit

Permalink
Reduced startup delay
Browse files Browse the repository at this point in the history
  • Loading branch information
andon authored and andon committed Jan 27, 2017
1 parent 1eaf5a4 commit 565050b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion include/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define TBF_MAJOR 0
#define TBF_MINOR 4
#define TBF_BUILD 2
#define TBF_REV 1
#define TBF_REV 2



Expand Down
38 changes: 20 additions & 18 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ SKPlugIn_Init (HMODULE hModSpecialK)
if (SKX_SetPluginName != nullptr)
SKX_SetPluginName (plugin_name.c_str ());

static SK_UpdateSoftware_pfn SK_UpdateSoftware =
TBF_ImportFunctionFromSpecialK ( "SK_UpdateSoftware",
SK_UpdateSoftware );

static SK_FetchVersionInfo_pfn SK_FetchVersionInfo =
TBF_ImportFunctionFromSpecialK ( "SK_FetchVersionInfo",
SK_FetchVersionInfo );

if (TBF_Init_MinHook () == MH_OK) {
extern void TBFix_ImGui_Init (void);
TBFix_ImGui_Init ();
Expand All @@ -135,6 +143,18 @@ SKPlugIn_Init (HMODULE hModSpecialK)
CreateThread ( nullptr, 0,
[](LPVOID user) ->
DWORD {
if (! wcsstr (injector_dll.c_str (), L"SpecialK"))
{
if ( SK_FetchVersionInfo != nullptr &&
SK_UpdateSoftware != nullptr )
{
if (SK_FetchVersionInfo (L"TBF"))
{
SK_UpdateSoftware (L"TBF");
}
}
}

// Wait for Denuvo to finish its thing...
Sleep (15000UL);
tbf::FrameRateFix::Init ();
Expand All @@ -150,24 +170,6 @@ SKPlugIn_Init (HMODULE hModSpecialK)
//CoUninitialize ();
}

static SK_UpdateSoftware_pfn SK_UpdateSoftware =
TBF_ImportFunctionFromSpecialK ( "SK_UpdateSoftware",
SK_UpdateSoftware );

static SK_FetchVersionInfo_pfn SK_FetchVersionInfo =
TBF_ImportFunctionFromSpecialK ( "SK_FetchVersionInfo",
SK_FetchVersionInfo );

if (! wcsstr (injector_dll.c_str (), L"SpecialK"))
{
if ( SK_FetchVersionInfo != nullptr &&
SK_UpdateSoftware != nullptr ) {
if (SK_FetchVersionInfo (L"TBF")) {
SK_UpdateSoftware (L"TBF");
}
}
}

return TRUE;
}

Expand Down
Binary file modified version.ini
Binary file not shown.

0 comments on commit 565050b

Please sign in to comment.