Rise
The Vieneo Province
Loading...
Searching...
No Matches
TerrainSurfaceDetail.h
Go to the documentation of this file.
1#pragma once
2#include <windows.h>
3#include <cwchar>
4
6{
7 // Live A/B gate: at most twice a second, once per frame, never per tile.
8 inline bool Enabled()
9 {
10 static const bool disabledAtLaunch = wcsstr(GetCommandLineW(), L"--terrain-detail-off") != nullptr;
11 if (disabledAtLaunch) return false;
12 static ULONGLONG nextCheck = 0;
13 static bool enabled = true;
14 const ULONGLONG now = GetTickCount64();
15 if (now >= nextCheck)
16 {
17 enabled = GetFileAttributesW(L"terrain-detail.off") == INVALID_FILE_ATTRIBUTES;
18 nextCheck = now + 500;
19 }
20 return enabled;
21 }
22}