Skip to content

Commit aef18e3

Browse files
committed
MM: MM1: Add Clouds title music to Enhanced title screen
1 parent 7b43123 commit aef18e3

File tree

5 files changed

+94
-5
lines changed

5 files changed

+94
-5
lines changed

engines/mm/mm1/views_enh/dialogs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#include "mm/mm1/events.h"
2626
#include "mm/mm1/views/bash.h"
27-
#include "mm/mm1/views/title.h"
2827
#include "mm/mm1/views_enh/character_info.h"
2928
#include "mm/mm1/views_enh/character_inventory.h"
3029
#include "mm/mm1/views_enh/character_select.h"
@@ -44,6 +43,7 @@
4443
#include "mm/mm1/views_enh/quick_ref.h"
4544
#include "mm/mm1/views_enh/rest.h"
4645
#include "mm/mm1/views_enh/search.h"
46+
#include "mm/mm1/views_enh/title.h"
4747
#include "mm/mm1/views_enh/trade.h"
4848
#include "mm/mm1/views_enh/trap.h"
4949
#include "mm/mm1/views_enh/unlock.h"
@@ -155,6 +155,7 @@ struct Dialogs {
155155
ViewsEnh::QuickRef _quickRef;
156156
ViewsEnh::Rest _rest;
157157
ViewsEnh::Search _search;
158+
ViewsEnh::Title _title;
158159
ViewsEnh::Trade _trade;
159160
ViewsEnh::Trap _trap;
160161
ViewsEnh::Unlock _unlock;
@@ -164,7 +165,6 @@ struct Dialogs {
164165
ViewsEnh::WhoWillTry _whoWillTry;
165166
ViewsEnh::WonGame _wonGame;
166167
Views::Bash _bash;
167-
Views::Title _title;
168168
public:
169169
Dialogs() {}
170170
};

engines/mm/mm1/views_enh/title.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* ScummVM - Graphic Adventure Engine
2+
*
3+
* ScummVM is the legal property of its developers, whose names
4+
* are too numerous to list here. Please refer to the COPYRIGHT
5+
* file distributed with this source distribution.
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
#include "mm/mm1/views_enh/title.h"
23+
#include "mm/mm1/mm1.h"
24+
25+
namespace MM {
26+
namespace MM1 {
27+
namespace ViewsEnh {
28+
29+
bool Title::msgFocus(const FocusMessage &msg) {
30+
Views::Title::msgFocus(msg);
31+
g_engine->_sound->playSong("inn.m");
32+
return true;
33+
}
34+
35+
bool Title::msgUnfocus(const UnfocusMessage &msg) {
36+
g_engine->_sound->stopSong();
37+
return Views::Title::msgUnfocus(msg);
38+
}
39+
40+
} // namespace ViewsEnh
41+
} // namespace MM1
42+
} // namespace MM

engines/mm/mm1/views_enh/title.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* ScummVM - Graphic Adventure Engine
2+
*
3+
* ScummVM is the legal property of its developers, whose names
4+
* are too numerous to list here. Please refer to the COPYRIGHT
5+
* file distributed with this source distribution.
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
#ifndef MM1_VIEWS_ENH_TITLE_H
23+
#define MM1_VIEWS_ENH_TITLE_H
24+
25+
#include "mm/mm1/views/title.h"
26+
27+
namespace MM {
28+
namespace MM1 {
29+
namespace ViewsEnh {
30+
31+
class Title : public Views::Title {
32+
public:
33+
Title() : Views::Title() {}
34+
virtual ~Title() {}
35+
36+
bool msgFocus(const FocusMessage &msg) override;
37+
bool msgUnfocus(const UnfocusMessage &msg) override;
38+
};
39+
40+
} // namespace ViewsEnh
41+
} // namespace MM1
42+
} // namespace MM
43+
44+
#endif

engines/mm/module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ MODULE_OBJS += \
170170
mm1/views_enh/select_number.o \
171171
mm1/views_enh/text_entry.o \
172172
mm1/views_enh/text_view.o \
173+
mm1/views_enh/title.o \
173174
mm1/views_enh/trade.o \
174175
mm1/views_enh/trap.o \
175176
mm1/views_enh/unlock.o \

engines/mm/shared/xeen/sound.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "common/config-manager.h"
2626
#include "mm/shared/xeen/sound.h"
2727
#include "mm/shared/xeen/sound_driver_adlib.h"
28+
#include "mm/xeen/xeen.h"
2829
#include "mm/mm.h"
2930

3031
namespace MM {
@@ -215,12 +216,13 @@ void Sound::playSong(const Common::String &name, int param) {
215216
Common::File mf;
216217
if (mf.open(name)) {
217218
playSong(mf);
218-
} else {
219219
#ifdef ENABLE_XEEN
220+
} else if (dynamic_cast<MM::Xeen::XeenEngine *>(g_engine)) {
220221
File f(name, _musicSide);
221-
#else
222-
File f(name);
222+
playSong(f);
223223
#endif
224+
} else {
225+
File f(name);
224226
playSong(f);
225227
}
226228
}

0 commit comments

Comments
 (0)