aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/gfx/music_switch_reverse.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-25 22:13:04 -0400
committerPaul Gilbert2016-08-25 22:13:04 -0400
commit9a71c9166b1ef8c7d0e57cfdfac6eb25f5332c69 (patch)
tree60bea0262805a98f2cdaf5ea0a34f4e9e198e72e /engines/titanic/gfx/music_switch_reverse.cpp
parent1f0b9cb68d02d956ec745bef16f0dbddaa743bec (diff)
downloadscummvm-rg350-9a71c9166b1ef8c7d0e57cfdfac6eb25f5332c69.tar.gz
scummvm-rg350-9a71c9166b1ef8c7d0e57cfdfac6eb25f5332c69.tar.bz2
scummvm-rg350-9a71c9166b1ef8c7d0e57cfdfac6eb25f5332c69.zip
TITANIC: Implemented more game classes and music widget classes
Diffstat (limited to 'engines/titanic/gfx/music_switch_reverse.cpp')
-rw-r--r--engines/titanic/gfx/music_switch_reverse.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/engines/titanic/gfx/music_switch_reverse.cpp b/engines/titanic/gfx/music_switch_reverse.cpp
new file mode 100644
index 0000000000..9fe6d51d47
--- /dev/null
+++ b/engines/titanic/gfx/music_switch_reverse.cpp
@@ -0,0 +1,66 @@
+/* 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 "titanic/gfx/music_switch_reverse.h"
+
+namespace Titanic {
+
+BEGIN_MESSAGE_MAP(CMusicSwitchReverse, CMusicSwitch)
+ ON_MESSAGE(MusicSettingChangedMsg)
+ ON_MESSAGE(EnterViewMsg)
+ ON_MESSAGE(QueryMusicControlSettingMsg)
+END_MESSAGE_MAP()
+
+void CMusicSwitchReverse::save(SimpleFile *file, int indent) {
+ file->writeNumberLine(1, indent);
+ CMusicSwitch::save(file, indent);
+}
+
+void CMusicSwitchReverse::load(SimpleFile *file) {
+ file->readNumber();
+ CMusicSwitch::load(file);
+}
+bool CMusicSwitchReverse::MusicSettingChangedMsg(CMusicSettingChangedMsg *msg) {
+ if (_fieldEC) {
+ if (++_controlVal > _controlMax)
+ _controlVal = 0;
+
+ loadFrame(_controlVal);
+ playSound("z#59.wav", 50);
+ } else {
+ playSound("z#46.wav");
+ }
+
+ return true;
+}
+
+bool CMusicSwitchReverse::EnterViewMsg(CEnterViewMsg *msg) {
+ loadFrame(_controlVal);
+ return true;
+}
+
+bool CMusicSwitchReverse::QueryMusicControlSettingMsg(CQueryMusicControlSettingMsg *msg) {
+ msg->_value = _controlVal;
+ return true;
+}
+
+} // End of namespace Titanic