[Scummvm-git-logs] scummvm master -> 8cd02a3fa3310edbe06179413def1cf19edca332
alxpnv
noreply at scummvm.org
Thu Jan 19 13:15:15 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8cd02a3fa3 ASYLUM: add a setting to control animations speed
Commit: 8cd02a3fa3310edbe06179413def1cf19edca332
https://github.com/scummvm/scummvm/commit/8cd02a3fa3310edbe06179413def1cf19edca332
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2023-01-19T16:15:34+03:00
Commit Message:
ASYLUM: add a setting to control animations speed
Changed paths:
engines/asylum/system/config.cpp
engines/asylum/system/config.h
engines/asylum/views/menu.cpp
engines/asylum/views/scene.cpp
diff --git a/engines/asylum/system/config.cpp b/engines/asylum/system/config.cpp
index a97f11de432..26410b8bc1b 100644
--- a/engines/asylum/system/config.cpp
+++ b/engines/asylum/system/config.cpp
@@ -48,6 +48,7 @@ ConfigurationManager::ConfigurationManager() {
ConfMan.registerDefault("music_status", true);
ConfMan.registerDefault("reverse_stereo", false);
ConfMan.registerDefault("performance", 4);
+ ConfMan.registerDefault("animations_speed", 1);
ConfMan.registerDefault("key_showVersion", 'v');
ConfMan.registerDefault("key_quickLoad", 'L');
ConfMan.registerDefault("key_quickSave", 'S');
@@ -76,6 +77,7 @@ ConfigurationManager::ConfigurationManager() {
gammaLevel = 0;
performance = 0;
+ animationsSpeed = 1;
keyShowVersion = 'v';
keyQuickLoad = 'L';
@@ -108,6 +110,7 @@ void ConfigurationManager::read() {
musicStatus = ConfMan.getBool("music_status");
reverseStereo = ConfMan.getBool("reverse_stereo");
performance = ConfMan.getInt("performance");
+ animationsSpeed = ConfMan.getInt("animations_speed");
// Misc options
showSceneLoading = ConfMan.getBool("show_scene_loading");
@@ -146,6 +149,7 @@ void ConfigurationManager::write() {
ConfMan.setBool("music_status", musicStatus);
ConfMan.setBool("reverse_stereo", reverseStereo);
ConfMan.setInt("performance", performance);
+ ConfMan.setInt("animations_speed", animationsSpeed);
// Misc Options
ConfMan.setBool("show_scene_loading", showSceneLoading);
diff --git a/engines/asylum/system/config.h b/engines/asylum/system/config.h
index 1a4715b3452..9220d3cf224 100644
--- a/engines/asylum/system/config.h
+++ b/engines/asylum/system/config.h
@@ -55,6 +55,7 @@ public:
bool musicStatus; // On or Off
bool reverseStereo;
int performance; ///< performance only affects sound: perf > 0 ? 22050hz/16bit : 11025hz/8bit
+ int animationsSpeed;
char keyShowVersion;
char keyQuickSave;
char keyQuickLoad;
diff --git a/engines/asylum/views/menu.cpp b/engines/asylum/views/menu.cpp
index d1e40c3caec..7769f44602e 100644
--- a/engines/asylum/views/menu.cpp
+++ b/engines/asylum/views/menu.cpp
@@ -1506,6 +1506,50 @@ void Menu::updateSettings() {
getText()->draw('*');
}
+ //////////////////////////////////////////////////////////////////////////
+ // Animations speed
+ const char *animationsSpeed;
+ switch (_vm->getLanguage()) {
+ case Common::DE_DEU:
+ animationsSpeed = "Animationen Geschwindigkeit";
+ break;
+ case Common::ES_ESP:
+ animationsSpeed = "Velocidad de animaciones";
+ break;
+ case Common::FR_FRA:
+ animationsSpeed = "Vitesse d'animations";
+ break;
+ case Common::IT_ITA:
+ animationsSpeed = "Velocità di animazioni";
+ break;
+ case Common::PL_POL:
+ animationsSpeed = "SzybkoÅÄ animacji";
+ break;
+ case Common::RU_RUS:
+ animationsSpeed = "\x91\xaa\xae\xe0\xae\xe1\xe2\xec\x20\xa0\xad\xa8\xac\xa0\xe6\xa8\xa9";
+ break;
+ default:
+ animationsSpeed = "Animations speed";
+ break;
+ }
+
+ getText()->loadFont(kFontYellow);
+ getText()->draw(Common::Point(320, 209), animationsSpeed);
+
+ switchFont(cursor.x < 350 || cursor.x > (sizeMinus + 350) || cursor.y < 209 || cursor.y > 233);
+ getText()->setPosition(Common::Point(350, 209));
+ getText()->draw("-");
+
+ switchFont(cursor.x < (sizeMinus + 360) || cursor.x > (sizeMinus + sizePlus + 360) || cursor.y < 209 || cursor.y > 233);
+ getText()->setPosition(Common::Point(sizeMinus + 360, 209));
+ getText()->draw("+");
+
+ getText()->setPosition(Common::Point(sizeMinus + sizePlus + 365, 209));
+ getText()->loadFont(kFontYellow);
+
+ for (int i = 1; i <= Config.animationsSpeed; i++)
+ getText()->drawChar(']');
+
//////////////////////////////////////////////////////////////////////////
// Back to main menu
switchFont(cursor.x < 300 || cursor.x > (300 + getText()->getWidth(MAKE_RESOURCE(kResourcePackText, 1437))) || cursor.y < 340 || cursor.y > (340 + 24));
@@ -2273,6 +2317,28 @@ void Menu::clickSettings() {
return;
}
+
+ //////////////////////////////////////////////////////////////////////////
+ // Animations speed minus
+ if (cursor.x >= 350 && cursor.x <= (sizeMinus + 350) && cursor.y >= 209 && cursor.y <= 233) {
+ if (Config.animationsSpeed == 1)
+ return;
+
+ Config.animationsSpeed--;
+
+ return;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // Animations speed plus
+ if (cursor.x >= (sizeMinus + 360) && cursor.x <= (sizeMinus + sizePlus + 360) && cursor.y >= 209 && cursor.y <= 233) {
+ if (Config.animationsSpeed == 9)
+ return;
+
+ Config.animationsSpeed++;
+
+ return;
+ }
}
void Menu::clickKeyboardConfig() {
diff --git a/engines/asylum/views/scene.cpp b/engines/asylum/views/scene.cpp
index 16936f522d4..f334c4be643 100644
--- a/engines/asylum/views/scene.cpp
+++ b/engines/asylum/views/scene.cpp
@@ -413,7 +413,7 @@ bool Scene::update() {
getSharedData()->setEventUpdate(getSharedData()->getEventUpdate() ^ 1);
getSharedData()->setFlag(kFlagRedraw, false);
- getSharedData()->setNextScreenUpdate(ticks + 55);
+ getSharedData()->setNextScreenUpdate(ticks + 55 / Config.animationsSpeed);
++_vm->screenUpdateCount;
}
}
More information about the Scummvm-git-logs
mailing list