1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Added option to disable animations for very low-end systems

This commit is contained in:
Ivan Savenko 2023-02-21 23:16:24 +02:00
parent 0282e6dad0
commit cda78fb30f
2 changed files with 15 additions and 1 deletions

View File

@ -90,6 +90,9 @@ size_t MapRendererContext::objectImageIndex(ObjectInstanceID objectID, size_t gr
if(groupSize == 0)
return 0;
if (!settings["adventure"]["objectAnimation"].Bool())
return 0;
// H3 timing for adventure map objects animation is 180 ms
// Terrain animations also use identical interval, however those are only present in HotA and/or HD Mod
size_t baseFrameTime = 180;
@ -106,6 +109,9 @@ size_t MapRendererContext::objectImageIndex(ObjectInstanceID objectID, size_t gr
size_t MapRendererContext::terrainImageIndex(size_t groupSize) const
{
if (!settings["adventure"]["terrainAnimation"].Bool())
return 0;
size_t baseFrameTime = 180;
size_t frameCounter = animationTime / baseFrameTime;
size_t frameIndex = frameCounter % groupSize;

View File

@ -161,7 +161,7 @@
"type" : "object",
"additionalProperties" : false,
"default": {},
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat" ],
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation" ],
"properties" : {
"heroMoveTime" : {
"type" : "number",
@ -182,6 +182,14 @@
"quickCombat" : {
"type" : "boolean",
"default" : false
},
"objectAnimation" : {
"type" : "boolean",
"default" : true
},
"terrainAnimation" : {
"type" : "boolean",
"default" : true
}
}
},