[Scummvm-git-logs] scummvm master -> 95c7dcce904274ef4ac36b5d2d108c34cdbca168
whiterandrek
whiterandrek at gmail.com
Sun Jul 1 09:36:28 CEST 2018
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:
95c7dcce90 PINK: added calculation of countries and domains indexes
Commit: 95c7dcce904274ef4ac36b5d2d108c34cdbca168
https://github.com/scummvm/scummvm/commit/95c7dcce904274ef4ac36b5d2d108c34cdbca168
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2018-07-01T10:36:06+03:00
Commit Message:
PINK: added calculation of countries and domains indexes
Changed paths:
engines/pink/pda_mgr.cpp
engines/pink/pda_mgr.h
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 947ebcc..0877b0b 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -201,6 +201,7 @@ void PDAMgr::initPerilButtons() {
domainButton->setAction(kInactiveAction);
updateWheels();
} else {
+ calculateIndexes();
navigatorButton->setAction(kIdleAction);
if (isDomain(_page->getName()))
domainButton->setAction(kInactiveAction);
@@ -240,4 +241,25 @@ void PDAMgr::updateLocator() {
locator->setAction(g_countries[_countryIndex]);
}
+void PDAMgr::calculateIndexes() {
+ Common::String country = Common::String::format("%.3s", _page->getName().c_str());
+ for (uint i = 0; i < 6; ++i) {
+ if (country == g_countries[i]) {
+ _countryIndex = i;
+ break;
+ }
+ }
+
+ Common::String domain = _page->getName();
+ domain.erase(0, 3);
+ if (domain.size() >= 4)
+ domain.erase(3);
+ for (uint i = 0; i < 8; ++i) {
+ if (domain == g_domains[i]) {
+ _domainIndex = i;
+ break;
+ }
+ }
+}
+
} // End of namespace Pink
diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h
index 92ebcf1..afcae1b 100644
--- a/engines/pink/pda_mgr.h
+++ b/engines/pink/pda_mgr.h
@@ -68,6 +68,8 @@ private:
void updateWheels(bool playSfx = 0);
void updateLocator();
+ void calculateIndexes();
+
static bool isNavigate(const Common::String &name);
static bool isDomain(const Common::String &name);
More information about the Scummvm-git-logs
mailing list