mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Refactored window flags only being updated every 1000ms.
This commit is contained in:
committed by
Michael Steenbeek
parent
fe19d9a2a3
commit
fabf7f9fb5
@@ -72,8 +72,6 @@ private:
|
||||
SDL_Window * _window = nullptr;
|
||||
sint32 _width = 0;
|
||||
sint32 _height = 0;
|
||||
uint32 _windowFlags = 0;
|
||||
uint32 _windowFlagsLastCheckTick = 0;
|
||||
|
||||
bool _resolutionsAllowAnyAspectRatio = false;
|
||||
std::vector<Resolution> _fsResolutions;
|
||||
@@ -782,14 +780,7 @@ private:
|
||||
|
||||
uint32 GetWindowFlags()
|
||||
{
|
||||
// Don't check if window is minimised too frequently (every second is fine)
|
||||
uint32 tick = Platform::GetTicks();
|
||||
if (tick > _windowFlagsLastCheckTick + 1000)
|
||||
{
|
||||
_windowFlags = SDL_GetWindowFlags(_window);
|
||||
_windowFlagsLastCheckTick = tick;
|
||||
}
|
||||
return _windowFlags;
|
||||
return SDL_GetWindowFlags(_window);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user