Skip to content

Commit

Permalink
Remove frame limiter due to overlay issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maximumgame committed Apr 23, 2018
1 parent 9690cb9 commit fba936f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
2 changes: 0 additions & 2 deletions ElDorito/Source/Modules/ModuleGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,6 @@ namespace Modules

VarCefMedals = AddVariableInt("CefMedals", "cef_medals", "Enable/disable cef medals. When disabled fallback to the H3 medal system.", eCommandFlagsArchived, 0);

VarFpsLimiter = AddVariableInt("FPSLimiter", "fps_limiter", "Enable/disable framerate limiter (improves frame timing at the cost of cpu usage)", eCommandFlagsArchived, 1);

VarDiscordEnable = AddVariableInt("Discord.Enable", "discord.enable", "Enable/disable discord integration", eCommandFlagsArchived, 1);
VarDiscordAutoAccept = AddVariableInt("Discord.AutoAccept", "discord.auto_accept", "Allow auto accepting join requests", eCommandFlagsArchived, 0);

Expand Down
1 change: 0 additions & 1 deletion ElDorito/Source/Modules/ModuleGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace Modules
Command* VarScreenshotsFolder;
Command *VarScreenshotNoticeDisabled;
Command* VarCefMedals;
Command* VarFpsLimiter;
Command* VarDiscordEnable;
Command* VarDiscordAutoAccept;

Expand Down
24 changes: 0 additions & 24 deletions ElDorito/Source/Patches/DirectXHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ namespace
void Video_CallsEndSceneHook();
HRESULT __stdcall ResetHook(LPDIRECT3DDEVICE9 device, D3DPRESENT_PARAMETERS *params);
void HandleTakeScreenshotHook();

LARGE_INTEGER start, end, elapsed, freq;
}

namespace DirectXHook
Expand Down Expand Up @@ -53,8 +51,6 @@ namespace
//DetourAttach((PVOID*)&Video_CallsD3DEndSceneOrginal, &Video_CallsEndSceneHook); // redirect Video_CallsD3DEndSceneOrginal to Video_CallsEndSceneHook
DetourAttach((PVOID*)&origResetPtr, &ResetHook); // redirect DrawIndexedPrimitive to newDrawIndexedPrimitive
DetourAttach((PVOID*)&origEndScenePtr, &EndSceneHook);
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&start);

if (DetourTransactionCommit() != NO_ERROR)
{
Expand Down Expand Up @@ -84,26 +80,6 @@ namespace
auto webRenderer = WebRenderer::GetInstance();
if (webRenderer->Initialized() && webRenderer->IsRendering())
webRenderer->Render(device);

if(Modules::ModuleGame::Instance().VarFpsLimiter->ValueInt == 0)
return (*origEndScenePtr)(device);

QueryPerformanceCounter(&end);

elapsed.QuadPart = end.QuadPart - start.QuadPart;
elapsed.QuadPart *= 100000000.0;
elapsed.QuadPart /= freq.QuadPart;

while (elapsed.QuadPart < 1666666.66)
{
QueryPerformanceCounter(&end);
elapsed.QuadPart = end.QuadPart - start.QuadPart;
elapsed.QuadPart *= 100000000.0;
elapsed.QuadPart /= freq.QuadPart;
}

QueryPerformanceCounter(&start);

return (*origEndScenePtr)(device);
}

Expand Down

0 comments on commit fba936f

Please sign in to comment.