aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-04-29 00:01:00 +0200
committerStrangerke2014-04-29 00:01:00 +0200
commit487a9d4069281fa2bc1b4d2dcf0bb95007879884 (patch)
treedd816373468539266216cb12da7cf00852be1f09
parentbe75349346e943542dfc0f77933a771b2181ba16 (diff)
downloadscummvm-rg350-487a9d4069281fa2bc1b4d2dcf0bb95007879884.tar.gz
scummvm-rg350-487a9d4069281fa2bc1b4d2dcf0bb95007879884.tar.bz2
scummvm-rg350-487a9d4069281fa2bc1b4d2dcf0bb95007879884.zip
MADS: Add scene4xx common functions
-rw-r--r--engines/mads/module.mk1
-rw-r--r--engines/mads/nebular/nebular_scenes.cpp1
-rw-r--r--engines/mads/nebular/nebular_scenes4.cpp97
-rw-r--r--engines/mads/nebular/nebular_scenes4.h56
4 files changed, 155 insertions, 0 deletions
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 9d5857904e..5fe0c90603 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -13,6 +13,7 @@ MODULE_OBJS := \
nebular/nebular_scenes1.o \
nebular/nebular_scenes2.o \
nebular/nebular_scenes3.o \
+ nebular/nebular_scenes4.o \
nebular/nebular_scenes8.o \
action.o \
animation.o \
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp
index f012a6825a..19b4f9f177 100644
--- a/engines/mads/nebular/nebular_scenes.cpp
+++ b/engines/mads/nebular/nebular_scenes.cpp
@@ -31,6 +31,7 @@
#include "mads/nebular/nebular_scenes1.h"
#include "mads/nebular/nebular_scenes2.h"
#include "mads/nebular/nebular_scenes3.h"
+#include "mads/nebular/nebular_scenes4.h"
#include "mads/nebular/nebular_scenes8.h"
namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp
new file mode 100644
index 0000000000..da40d9bbbd
--- /dev/null
+++ b/engines/mads/nebular/nebular_scenes4.cpp
@@ -0,0 +1,97 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/scene.h"
+#include "mads/nebular/nebular_scenes.h"
+#include "mads/nebular/nebular_scenes4.h"
+
+namespace MADS {
+
+namespace Nebular {
+
+void Scene4xx::setAAName() {
+ _game._aaName = Resources::formatAAName(4);
+}
+
+void Scene4xx::setPlayerSpritesPrefix() {
+ _vm->_sound->command(5);
+ Common::String oldName = _game._player._spritesPrefix;
+
+ if ((_scene->_nextSceneId == 403) || (_scene->_nextSceneId == 409))
+ _game._player._spritesPrefix = "";
+ else if (_globals[kSexOfRex] == REX_FEMALE)
+ _game._player._spritesPrefix = "ROX";
+ else
+ _game._player._spritesPrefix = "RXM";
+
+ _game._player._scalingVelocity = true;
+
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+
+ _vm->_palette->setEntry(16, 10, 63, 63);
+ _vm->_palette->setEntry(17, 10, 45, 45);
+}
+
+void Scene4xx::sceneEntrySound() {
+ if (!_vm->_musicFlag) {
+ _vm->_sound->command(2);
+ return;
+ }
+
+ switch (_scene->_nextSceneId) {
+ case 401:
+ _vm->_sound->startQueuedCommands();
+ if (_scene->_priorSceneId == 402)
+ _vm->_sound->command(12, 64);
+ else
+ _vm->_sound->command(12, 1);
+ break;
+
+ case 402:
+ _vm->_sound->startQueuedCommands();
+ _vm->_sound->command(12, 127);
+ break;
+
+ case 405:
+ case 407:
+ case 409:
+ case 410:
+ case 413:
+ _vm->_sound->command(10);
+ break;
+
+ case 408:
+ _vm->_sound->command(52);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Nebular
+} // End of namespace MADS
diff --git a/engines/mads/nebular/nebular_scenes4.h b/engines/mads/nebular/nebular_scenes4.h
new file mode 100644
index 0000000000..4de6c383b3
--- /dev/null
+++ b/engines/mads/nebular/nebular_scenes4.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef MADS_NEBULAR_SCENES4_H
+#define MADS_NEBULAR_SCENES4_H
+
+#include "common/scummsys.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/nebular/nebular_scenes.h"
+
+namespace MADS {
+
+namespace Nebular {
+
+class Scene4xx : public NebularScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+
+ void sceneEntrySound();
+
+public:
+ Scene4xx(MADSEngine *vm) : NebularScene(vm) {}
+};
+
+} // End of namespace Nebular
+} // End of namespace MADS
+
+#endif /* MADS_NEBULAR_SCENES4_H */