mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
KYRA: (LoK/Mac) - add support for low quality music
(the driver support was already there, this commit just adds the additional menu setting and the necessary adjustments)
This commit is contained in:
parent
4fda51a823
commit
a939862cec
@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
enum {
|
||||
kKyraDatVersion = 115
|
||||
kKyraDatVersion = 116
|
||||
};
|
||||
|
||||
const ExtractFilename extractFilenames[] = {
|
||||
@ -89,6 +89,7 @@ const ExtractFilename extractFilenames[] = {
|
||||
// GUI strings table
|
||||
{ k1GUIStrings, kStringList, true },
|
||||
{ k1ConfigStrings, kStringList, true },
|
||||
{ k1ConfigStrings2, kStringList, true },
|
||||
|
||||
// ROOM table/filenames
|
||||
{ k1RoomList, kRoomList, false },
|
||||
|
@ -129,6 +129,7 @@ enum kExtractID {
|
||||
|
||||
k1GUIStrings,
|
||||
k1ConfigStrings,
|
||||
k1ConfigStrings2,
|
||||
|
||||
k1AudioTracks,
|
||||
k1AudioTracksIntro,
|
||||
|
@ -794,6 +794,7 @@ const int kyra1MacNeed[] = {
|
||||
k1GUIStrings,
|
||||
k1NewGameString,
|
||||
k1ConfigStrings,
|
||||
k1ConfigStrings2,
|
||||
k1CreditsStrings,
|
||||
-1
|
||||
};
|
||||
|
@ -1038,6 +1038,7 @@ static const ResourceProvider resourceProviders[] = {
|
||||
{ k1GUIStrings, kKyra1, kPlatformMacintosh, kNoSpecial, EN_ANY, &k1GUIStringsMacEnglishProvider },
|
||||
{ k1NewGameString, kKyra1, kPlatformMacintosh, kNoSpecial, EN_ANY, &k1NewGameStringMacEnglishProvider },
|
||||
{ k1ConfigStrings, kKyra1, kPlatformMacintosh, kNoSpecial, EN_ANY, &k1ConfigStringsMacEnglishProvider },
|
||||
{ k1ConfigStrings2, kKyra1, kPlatformMacintosh, kNoSpecial, EN_ANY, &k1ConfigStrings2MacEnglishProvider },
|
||||
{ k1CreditsStrings, kKyra1, kPlatformMacintosh, kNoSpecial, EN_ANY, &k1CreditsStringsMacEnglishProvider },
|
||||
|
||||
{ k2SeqplayPakFiles, kKyra2, kPlatformDOS, kDemoVersion, UNK_LANG, &k2SeqplayPakFilesDOSDemoProvider },
|
||||
|
@ -333,6 +333,14 @@ static const char *const k1ConfigStringsMacEnglish[9] = {
|
||||
|
||||
static const StringListProvider k1ConfigStringsMacEnglishProvider = { ARRAYSIZE(k1ConfigStringsMacEnglish), k1ConfigStringsMacEnglish };
|
||||
|
||||
static const char *const k1ConfigStrings2MacEnglish[3] = {
|
||||
"None",
|
||||
"High Quality",
|
||||
"Low Impact"
|
||||
};
|
||||
|
||||
static const StringListProvider k1ConfigStrings2MacEnglishProvider = { ARRAYSIZE(k1ConfigStrings2MacEnglish), k1ConfigStrings2MacEnglish };
|
||||
|
||||
static const uint8 k1CreditsStringsMacEnglish[] = {
|
||||
0x0a, 0x02, 0x54, 0x48, 0x45, 0x20, 0x45, 0x4e,
|
||||
0x44, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a,
|
||||
|
Binary file not shown.
@ -196,8 +196,8 @@ Common::Error KyraEngine_LoK::init() {
|
||||
_trackMap = _amigaTrackMap;
|
||||
_trackMapSize = _amigaTrackMapSize;
|
||||
} else if (_flags.platform == Common::kPlatformMacintosh) {
|
||||
_trackMap = _macHQTrackMap;
|
||||
_trackMapSize = _macHQTrackMapSize;
|
||||
_trackMap = (_configMusic == 1) ? _macHQTrackMap : _macLQTrackMap;
|
||||
_trackMapSize = (_configMusic == 1) ? _macHQTrackMapSize : _macLQTrackMapSize;
|
||||
} else {
|
||||
_trackMap = _dosTrackMap;
|
||||
_trackMapSize = _dosTrackMapSize;
|
||||
@ -976,6 +976,11 @@ void KyraEngine_LoK::readSettings() {
|
||||
_configTextspeed = 2; // Fast
|
||||
|
||||
KyraEngine_v1::readSettings();
|
||||
|
||||
if (_flags.platform == Common::kPlatformMacintosh) {
|
||||
_trackMap = (_configMusic == 1) ? _macHQTrackMap : _macLQTrackMap;
|
||||
_trackMapSize = (_configMusic == 1) ? _macHQTrackMapSize : _macLQTrackMapSize;
|
||||
}
|
||||
}
|
||||
|
||||
void KyraEngine_LoK::writeSettings() {
|
||||
@ -997,6 +1002,11 @@ void KyraEngine_LoK::writeSettings() {
|
||||
|
||||
ConfMan.setInt("talkspeed", talkspeed);
|
||||
|
||||
if (_flags.platform == Common::kPlatformMacintosh) {
|
||||
_trackMap = (_configMusic == 1) ? _macHQTrackMap : _macLQTrackMap;
|
||||
_trackMapSize = (_configMusic == 1) ? _macHQTrackMapSize : _macLQTrackMapSize;
|
||||
}
|
||||
|
||||
KyraEngine_v1::writeSettings();
|
||||
}
|
||||
|
||||
|
@ -549,6 +549,8 @@ void KyraEngine_v1::delayWithTicks(int ticks) {
|
||||
void KyraEngine_v1::registerDefaultSettings() {
|
||||
if (_flags.platform == Common::kPlatformFMTowns)
|
||||
ConfMan.registerDefault("cdaudio", true);
|
||||
else if (_flags.platform == Common::kPlatformMacintosh)
|
||||
ConfMan.registerDefault("hqmusic", true);
|
||||
if (_flags.fanLang != Common::UNK_LANG) {
|
||||
// HACK/WORKAROUND: Since we can't use registerDefault here to overwrite
|
||||
// the global subtitles settings, we're using this hack to enable subtitles
|
||||
@ -566,6 +568,8 @@ void KyraEngine_v1::readSettings() {
|
||||
if (!ConfMan.getBool("music_mute")) {
|
||||
if (_flags.platform == Common::kPlatformFMTowns)
|
||||
_configMusic = ConfMan.getBool("cdaudio") ? 2 : 1;
|
||||
else if (_flags.platform == Common::kPlatformMacintosh)
|
||||
_configMusic = ConfMan.getBool("hqmusic") ? 1 : 2;
|
||||
else
|
||||
_configMusic = 1;
|
||||
}
|
||||
@ -596,6 +600,8 @@ void KyraEngine_v1::writeSettings() {
|
||||
ConfMan.setBool("music_mute", _configMusic == 0);
|
||||
if (_flags.platform == Common::kPlatformFMTowns)
|
||||
ConfMan.setBool("cdaudio", _configMusic == 2);
|
||||
else if (_flags.platform == Common::kPlatformMacintosh)
|
||||
ConfMan.setBool("hqmusic", _configMusic == 1);
|
||||
ConfMan.setBool("sfx_mute", _configSounds == 0);
|
||||
|
||||
switch (_configVoice) {
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "kyra/text/text.h"
|
||||
#include "kyra/engine/timer.h"
|
||||
#include "kyra/engine/util.h"
|
||||
#include "kyra/resource/resource.h"
|
||||
|
||||
#include "common/savefile.h"
|
||||
#include "common/system.h"
|
||||
@ -186,6 +187,7 @@ GUI_LoK::GUI_LoK(KyraEngine_LoK *vm, Screen_LoK *screen) : GUI_v1(vm), _vm(vm),
|
||||
_scrollUpFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::scrollUp);
|
||||
_scrollDownFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::scrollDown);
|
||||
_saveLoadNumSlots = (vm->gameFlags().lang == Common::ZH_TWN) ? 4 : 5;
|
||||
_confMusicMenuMod = (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformMacintosh) ? 3 : 2;
|
||||
}
|
||||
|
||||
GUI_LoK::~GUI_LoK() {
|
||||
@ -454,7 +456,17 @@ void GUI_LoK::setGUILabels() {
|
||||
_textSpeedString = _vm->_guiStrings[25 + offsetOptions];
|
||||
_onString = _vm->_guiStrings[20 + offsetOn];
|
||||
_offString = _vm->_guiStrings[21 + offset];
|
||||
_onCDString = _vm->_guiStrings[21];
|
||||
|
||||
if (_vm->gameFlags().platform == Common::kPlatformMacintosh) {
|
||||
int temp;
|
||||
const char *const *musicMenuStr = _vm->staticres()->loadStrings(k1ConfigStrings2, temp);
|
||||
for (int i = 0; i < temp; ++i)
|
||||
_confMusicMenuStrings[i] = musicMenuStr[i];
|
||||
} else {
|
||||
_confMusicMenuStrings[0] = _offString;
|
||||
_confMusicMenuStrings[1] = _onString;
|
||||
_confMusicMenuStrings[2] = _vm->_guiStrings[21]; // FM-Towns: "On +CD"
|
||||
}
|
||||
}
|
||||
|
||||
int GUI_LoK::buttonMenuCallback(Button *caller) {
|
||||
@ -899,6 +911,8 @@ int GUI_LoK::gameControlsMenu(Button *button) {
|
||||
_displaySubMenu = true;
|
||||
_cancelSubMenu = false;
|
||||
|
||||
int confMus = _vm->_configMusic;
|
||||
|
||||
while (_displaySubMenu && !_vm->shouldQuit()) {
|
||||
processHighlights(_menu[5]);
|
||||
getInput();
|
||||
@ -911,19 +925,23 @@ int GUI_LoK::gameControlsMenu(Button *button) {
|
||||
initMenu(_menu[_toplevelMenu]);
|
||||
updateAllMenuButtons();
|
||||
}
|
||||
|
||||
if (_vm->_configMusic && _vm->_configMusic != confMus && _vm->_lastMusicCommand != -1)
|
||||
_vm->snd_playWanderScoreViaMap(_vm->_lastMusicCommand, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GUI_LoK::setupControls(Menu &menu) {
|
||||
switch (_vm->_configMusic) {
|
||||
case 0:
|
||||
menu.item[0].itemString = _offString; //"Off"
|
||||
menu.item[0].itemString = _confMusicMenuStrings[0]; //"Off" (Mac: "None")
|
||||
break;
|
||||
case 1:
|
||||
menu.item[0].itemString = _onString; //"On"
|
||||
menu.item[0].itemString = _confMusicMenuStrings[1]; //"On" (Mac: "High Quality")
|
||||
break;
|
||||
case 2:
|
||||
menu.item[0].itemString = _onCDString; //"On + CD"
|
||||
menu.item[0].itemString = _confMusicMenuStrings[2]; //"On + CD" (Mac: "Low Impact")
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -934,7 +952,6 @@ void GUI_LoK::setupControls(Menu &menu) {
|
||||
else
|
||||
menu.item[1].itemString = _offString; //"Off"
|
||||
|
||||
|
||||
switch (_vm->_configWalkspeed) {
|
||||
case 0:
|
||||
menu.item[2].itemString = _vm->_configStrings[0]; //"Slowest"
|
||||
@ -1017,7 +1034,7 @@ void GUI_LoK::setupControls(Menu &menu) {
|
||||
int GUI_LoK::controlsChangeMusic(Button *button) {
|
||||
updateMenuButton(button);
|
||||
|
||||
_vm->_configMusic = (_vm->_configMusic + 1) % ((_vm->gameFlags().platform == Common::kPlatformFMTowns) ? 3 : 2);
|
||||
_vm->_configMusic = (_vm->_configMusic + 1) % _confMusicMenuMod;
|
||||
setupControls(_menu[5]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -178,7 +178,8 @@ private:
|
||||
const char *_textSpeedString;
|
||||
const char *_onString;
|
||||
const char *_offString;
|
||||
const char *_onCDString;
|
||||
const char *_confMusicMenuStrings[3];
|
||||
uint8 _confMusicMenuMod;
|
||||
};
|
||||
|
||||
} // End of namespace Kyra
|
||||
|
@ -217,6 +217,7 @@ enum KyraResources {
|
||||
|
||||
k1GUIStrings,
|
||||
k1ConfigStrings,
|
||||
k1ConfigStrings2,
|
||||
|
||||
k1AudioTracks,
|
||||
k1AudioTracksIntro,
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
namespace Kyra {
|
||||
|
||||
#define RESFILE_VERSION 115
|
||||
#define RESFILE_VERSION 116
|
||||
|
||||
namespace {
|
||||
bool checkKyraDat(Common::SeekableReadStream *file) {
|
||||
|
@ -227,7 +227,7 @@ public:
|
||||
*/
|
||||
virtual void pause(bool paused) {}
|
||||
|
||||
void enableMusic(int enable) { _musicEnabled = enable; }
|
||||
virtual void enableMusic(int enable) { _musicEnabled = enable; }
|
||||
int musicEnabled() const { return _musicEnabled; }
|
||||
void enableSFX(bool enable) { _sfxEnabled = enable; }
|
||||
bool sfxEnabled() const { return _sfxEnabled; }
|
||||
|
@ -140,6 +140,7 @@ public:
|
||||
void beginFadeOut() override;
|
||||
|
||||
void updateVolumeSettings() override;
|
||||
void enableMusic(int enable) override;
|
||||
|
||||
private:
|
||||
bool loadInstruments();
|
||||
@ -363,7 +364,7 @@ public:
|
||||
|
||||
kType getMusicType() const override;
|
||||
|
||||
bool init() override { return init(true); }
|
||||
bool init() override { return init(musicEnabled() == 1); }
|
||||
bool init(bool hiQuality);
|
||||
void initAudioResourceInfo(int, void*) override {}
|
||||
void selectAudioResourceSet(int set) override;
|
||||
@ -376,6 +377,7 @@ public:
|
||||
bool isPlaying() const override;
|
||||
void beginFadeOut() override;
|
||||
void updateVolumeSettings() override;
|
||||
void enableMusic(int enable) override;
|
||||
|
||||
private:
|
||||
void setQuality(bool hi);
|
||||
|
@ -244,6 +244,12 @@ void SoundMac::updateVolumeSettings() {
|
||||
_driver->setSoundEffectVolume(CLIP<int>(mute ? 0 : ConfMan.getInt("sfx_volume"), 0, Audio::Mixer::kMaxMixerVolume));
|
||||
}
|
||||
|
||||
void SoundMac::enableMusic(int enable) {
|
||||
if (enable && enable != _musicEnabled)
|
||||
setQuality(enable == 1);
|
||||
_musicEnabled = enable;
|
||||
}
|
||||
|
||||
void SoundMac::setQuality(bool hi) {
|
||||
static const uint16 resIds[] = {
|
||||
0x1b5b, 0x1b5c, 0x1b5e, 0x1b62, 0x1b63, 0x1b6b, 0x1b6c, 0x1b6d,
|
||||
|
@ -244,6 +244,12 @@ void SoundTowns_LoK::updateVolumeSettings() {
|
||||
_player->driver()->setSoundEffectVolume((mute ? 0 : ConfMan.getInt("sfx_volume")));
|
||||
}
|
||||
|
||||
void SoundTowns_LoK::enableMusic(int enable) {
|
||||
if (enable && enable != _musicEnabled && _lastTrack != -1)
|
||||
haltTrack();
|
||||
_musicEnabled = enable;
|
||||
}
|
||||
|
||||
void SoundTowns_LoK::stopAllSoundEffects() {
|
||||
_player->driver()->channelVolume(0x46, 0);
|
||||
_player->driver()->channelVolume(0x47, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user