aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/menu_views.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/menu_views.cpp')
-rw-r--r--engines/mads/menu_views.cpp51
1 files changed, 15 insertions, 36 deletions
diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp
index 857db68fa6..03afc70c3e 100644
--- a/engines/mads/menu_views.cpp
+++ b/engines/mads/menu_views.cpp
@@ -80,6 +80,15 @@ bool MenuView::onEvent(Common::Event &event) {
return false;
}
+Common::String MenuView::getResourceName() {
+ Common::String s(_filename);
+ s.toLowercase();
+ while (s.contains('.'))
+ s.deleteLastChar();
+
+ return s;
+}
+
/*------------------------------------------------------------------------*/
char TextView::_resourceName[100];
@@ -112,12 +121,17 @@ TextView::TextView(MADSEngine *vm) : MenuView(vm) {
}
TextView::~TextView() {
+ // Turn off palette cycling as well as any playing sound
+ Scene &scene = _vm->_game->_scene;
+ scene._cyclingActive = false;
+ _vm->_sound->stop();
}
void TextView::load() {
Common::String scriptName(_resourceName);
scriptName += ".txr";
+ _filename = scriptName;
if (!_script.open(scriptName))
error("Could not open resource %s", _resourceName);
@@ -491,6 +505,7 @@ void AnimationView::load() {
if (!resName.hasSuffix("."))
resName += ".res";
+ _filename = resName;
if (!_script.open(resName))
error("Could not open resource %s", resName.c_str());
@@ -750,40 +765,4 @@ int AnimationView::getParameter() {
return result;
}
-void AnimationView::checkResource(const Common::String &resourceName) {
- //bool hasSuffix = false;
-
-}
-
-int AnimationView::scanResourceIndex(const Common::String &resourceName) {
- int foundIndex = -1;
-
- if (_v1) {
- const char *chP = strchr(resourceName.c_str(), '\\');
- if (!chP) {
- chP = strchr(resourceName.c_str(), '*');
- }
-
- Common::String resName = chP ? Common::String(chP + 1) : resourceName;
-
- if (_v2 != 3) {
- assert(_resIndex.size() == 0);
- }
-
- // Scan for the resource name
- for (uint resIndex = 0; resIndex < _resIndex.size(); ++resIndex) {
- ResIndexEntry &resEntry = _resIndex[resIndex];
- if (resEntry._resourceName.compareToIgnoreCase(resourceName)) {
- foundIndex = resIndex;
- break;
- }
- }
- }
-
- if (foundIndex >= 0) {
- // TODO
- }
- return -1;
-}
-
} // End of namespace MADS