mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Added more generic way to unlock frame rate when needed
This commit is contained in:
@@ -454,6 +454,9 @@ EXPORT_MODULE namespace hex {
|
||||
|
||||
void cleanup();
|
||||
|
||||
bool frameRateUnlockRequested();
|
||||
void resetFrameRateUnlockRequested();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -720,6 +723,10 @@ EXPORT_MODULE namespace hex {
|
||||
*/
|
||||
void addMigrationRoutine(SemanticVersion migrationVersion, std::function<void()> function);
|
||||
|
||||
/**
|
||||
* @brief Unlocks the frame rate temporarily, allowing animations to run smoothly
|
||||
*/
|
||||
void unlockFrameRate();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -597,6 +597,14 @@ namespace hex {
|
||||
object->reset();
|
||||
}
|
||||
|
||||
static bool s_frameRateUnlockRequested = false;
|
||||
bool frameRateUnlockRequested() {
|
||||
return s_frameRateUnlockRequested;
|
||||
}
|
||||
|
||||
void resetFrameRateUnlockRequested() {
|
||||
s_frameRateUnlockRequested = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -967,6 +975,9 @@ namespace hex {
|
||||
impl::s_windowResizable = resizable;
|
||||
}
|
||||
|
||||
void unlockFrameRate() {
|
||||
impl::s_frameRateUnlockRequested = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user