mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
SCUMM: Add setting for the Loom Overture tempo on the Engine tab
It's hard to make this appear only on EGA Loom, so the tooltip has to document the fact that it's only useful there. The setting is made relative to the default tempo, which I feel is a much more sensible way of presenting it to the user than the raw ticks value.
This commit is contained in:
parent
c63786022d
commit
c80adc3e8b
@ -699,4 +699,69 @@ void LoomTownsDifficultyDialog::handleCommand(GUI::CommandSender *sender, uint32
|
||||
}
|
||||
}
|
||||
|
||||
EgaLoomOptionsWidget::EgaLoomOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
|
||||
OptionsContainerWidget(boss, name, "EgaLoomOptionsDialog", false, domain) {
|
||||
new GUI::StaticTextWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicksHeader", _("Overture Timing:"));
|
||||
|
||||
_overtureTicksSlider = new GUI::SliderWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicks", _("Adjusts how quickly the Overture transition happens when using replacement audio tracks."), kOvertureTicksChanged);
|
||||
|
||||
// Each step of the slider changes the assumed length of the Loom
|
||||
// Overture by ten SCUMM ticks. When I timed it, I was able to set the
|
||||
// transition to happen anywhere between approximately 1:30 and 2:20,
|
||||
// which should be more than enough. I think it's nice if the interval
|
||||
// is small enough that you can set the slider back to 0 at reasonable
|
||||
// screen resolutions.
|
||||
|
||||
_overtureTicksSlider->setMinValue(-200);
|
||||
_overtureTicksSlider->setMaxValue(200);
|
||||
|
||||
_overtureTicksLabel = new GUI::StaticTextWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicksLabel", Common::U32String());
|
||||
|
||||
_overtureTicksLabel->setFlags(GUI::WIDGET_CLEARBG);
|
||||
}
|
||||
|
||||
void EgaLoomOptionsWidget::load() {
|
||||
int loomOvertureTicks = DEFAULT_LOOM_OVERTURE_TICKS;
|
||||
|
||||
if (ConfMan.hasKey("loom_overture_ticks", _domain))
|
||||
loomOvertureTicks = ConfMan.getInt("loom_overture_ticks", _domain);
|
||||
|
||||
_overtureTicksSlider->setValue(loomOvertureTicks);
|
||||
updateOvertureTicksLabel();
|
||||
}
|
||||
|
||||
bool EgaLoomOptionsWidget::save() {
|
||||
ConfMan.setInt("loom_overture_ticks", _overtureTicksSlider->getValue(), _domain);
|
||||
return true;
|
||||
}
|
||||
|
||||
void EgaLoomOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {
|
||||
layouts.addDialog(layoutName, overlayedLayout)
|
||||
.addLayout(GUI::ThemeLayout::kLayoutHorizontal)
|
||||
.addPadding(16, 16, 16, 16)
|
||||
.addWidget("OvertureTicksHeader", "OptionsLabel")
|
||||
.addWidget("OvertureTicks", "WideSlider")
|
||||
.addSpace(8)
|
||||
.addWidget("OvertureTicksLabel", "SmallLabel")
|
||||
.closeLayout()
|
||||
.closeDialog();
|
||||
}
|
||||
|
||||
void EgaLoomOptionsWidget::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
|
||||
|
||||
switch (cmd) {
|
||||
case kOvertureTicksChanged:
|
||||
updateOvertureTicksLabel();
|
||||
break;
|
||||
default:
|
||||
GUI::OptionsContainerWidget::handleCommand(sender, cmd, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EgaLoomOptionsWidget::updateOvertureTicksLabel() {
|
||||
_overtureTicksLabel->setValue(_overtureTicksSlider->getValue());
|
||||
_overtureTicksLabel->markAsDirty();
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
||||
|
@ -209,6 +209,31 @@ private:
|
||||
int _difficulty;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options widget for EGA Loom
|
||||
*/
|
||||
class EgaLoomOptionsWidget : public GUI::OptionsContainerWidget {
|
||||
public:
|
||||
EgaLoomOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
|
||||
~EgaLoomOptionsWidget() override {};
|
||||
|
||||
void load() override;
|
||||
bool save() override;
|
||||
|
||||
private:
|
||||
enum {
|
||||
kOvertureTicksChanged = 'OTCH'
|
||||
};
|
||||
|
||||
void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
|
||||
void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||
|
||||
GUI::SliderWidget *_overtureTicksSlider;
|
||||
GUI::StaticTextWidget *_overtureTicksLabel;
|
||||
|
||||
void updateOvertureTicksLabel();
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
|
||||
#endif
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "scumm/he/intern_he.h"
|
||||
#include "scumm/scumm_v0.h"
|
||||
#include "scumm/scumm_v8.h"
|
||||
#include "scumm/dialogs.h"
|
||||
#include "scumm/resource.h"
|
||||
|
||||
// Files related for detection.
|
||||
@ -522,6 +523,26 @@ SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int
|
||||
return desc;
|
||||
}
|
||||
|
||||
GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const {
|
||||
if (ConfMan.get("gameid", target) != "loom")
|
||||
return nullptr;
|
||||
|
||||
// These Loom settings are only relevant for the EGA version, so
|
||||
// exclude non-DOS versions. If the game was added a long time ago,
|
||||
// the platform may still be listed as unknown.
|
||||
|
||||
Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
|
||||
if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS)
|
||||
return nullptr;
|
||||
|
||||
if (ConfMan.get("extra", target) == "Steam")
|
||||
return nullptr;
|
||||
|
||||
// And yet, after all this, we still can't be sure that it's not the
|
||||
// VGA version or a demo...
|
||||
return new Scumm::EgaLoomOptionsWidget(boss, name, target);
|
||||
}
|
||||
|
||||
#if PLUGIN_ENABLED_DYNAMIC(SCUMM)
|
||||
REGISTER_PLUGIN_DYNAMIC(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine);
|
||||
#else
|
||||
|
@ -35,6 +35,8 @@ class ScummMetaEngine : public MetaEngine {
|
||||
int getMaximumSaveSlot() const override;
|
||||
void removeSaveState(const char *target, int slot) const override;
|
||||
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
|
||||
|
||||
GUI::OptionsContainerWidget *buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override;
|
||||
};
|
||||
|
||||
#endif // SCUMM_METAENGINE_H
|
||||
|
@ -1541,6 +1541,7 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
|
||||
bool useReplacementAudioTracks = (_game.id == GID_LOOM && !(_game.features & GF_AUDIOTRACKS));
|
||||
|
||||
if (useReplacementAudioTracks) {
|
||||
ConfMan.registerDefault("loom_overture_ticks", DEFAULT_LOOM_OVERTURE_TICKS);
|
||||
_system->getAudioCDManager()->open();
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer, bool useReplacementAudioT
|
||||
_loomSteamCD.balance = 0;
|
||||
|
||||
_isLoomSteam = _vm->_game.id == GID_LOOM && Common::File::exists("CDDA.SOU");
|
||||
_loomOvertureTicks = DEFAULT_LOOM_OVERTURE_TICKS + 10 * ConfMan.getInt("loom_overture_ticks");
|
||||
|
||||
_loomSteamCDAudioHandle = new Audio::SoundHandle();
|
||||
_talkChannelHandle = new Audio::SoundHandle();
|
||||
@ -127,8 +128,8 @@ bool Sound::isRolandLoom() const {
|
||||
// Ozawa version of No. 10 Scène (Moderato). Good enough for now, but maybe it
|
||||
// needs to be configurable to accommodate for different recordings?
|
||||
|
||||
#define TICKS_TO_TIMER(x) ((((x) * 278) / 8940) + 1)
|
||||
#define TIMER_TO_TICKS(x) ((((x) - 1) * 8940) / 278)
|
||||
#define TICKS_TO_TIMER(x) ((((x) * 278) / _loomOvertureTicks) + 1)
|
||||
#define TIMER_TO_TICKS(x) ((((x) - 1) * _loomOvertureTicks) / 278)
|
||||
|
||||
void Sound::updateMusicTimer(int ticks) {
|
||||
bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56 && !(_vm->_game.features & GF_DEMO));
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "backends/audiocd/audiocd.h"
|
||||
#include "scumm/file.h"
|
||||
|
||||
#define DEFAULT_LOOM_OVERTURE_TICKS 8940
|
||||
|
||||
namespace Audio {
|
||||
class Mixer;
|
||||
class SoundHandle;
|
||||
@ -94,6 +96,7 @@ protected:
|
||||
bool _useReplacementAudioTracks;
|
||||
int _musicTimer;
|
||||
uint32 _scummTicks;
|
||||
uint32 _loomOvertureTicks;
|
||||
|
||||
public:
|
||||
Audio::SoundHandle *_talkChannelHandle; // Handle of mixer channel actor is talking on
|
||||
|
@ -103,6 +103,9 @@
|
||||
<widget name = 'Slider'
|
||||
size = '128, 18'
|
||||
/>
|
||||
<widget name = 'WideSlider'
|
||||
size = '-1, 18'
|
||||
/>
|
||||
<widget name = 'PopUp'
|
||||
size = '-1, 19'
|
||||
/>
|
||||
|
@ -96,6 +96,9 @@
|
||||
<widget name = 'Slider'
|
||||
size = '85, 12'
|
||||
/>
|
||||
<widget name = 'WideSlider'
|
||||
size = '-1, 12'
|
||||
/>
|
||||
<widget name = 'PopUp'
|
||||
size = '-1, 15'
|
||||
/>
|
||||
|
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
[SCUMMVM_STX0.9.1:ResidualVM Modern Theme Remastered:No Author]
|
||||
[SCUMMVM_STX0.9.2:ResidualVM Modern Theme Remastered:No Author]
|
||||
%using ../common
|
||||
%using ../common-svg
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
[SCUMMVM_STX0.9.1:ScummVM Classic Theme:No Author]
|
||||
[SCUMMVM_STX0.9.2:ScummVM Classic Theme:No Author]
|
||||
|
@ -87,6 +87,9 @@
|
||||
<widget name = 'Slider'
|
||||
size = '128, 18'
|
||||
/>
|
||||
<widget name = 'WideSlider'
|
||||
size = '-1, 18'
|
||||
/>
|
||||
<widget name = 'PopUp'
|
||||
size = '-1, 19'
|
||||
/>
|
||||
|
@ -84,6 +84,9 @@
|
||||
<widget name = 'Slider'
|
||||
size = '85, 12'
|
||||
/>
|
||||
<widget name = 'WideSlider'
|
||||
size = '-1, 12'
|
||||
/>
|
||||
<widget name = 'PopUp'
|
||||
size = '-1, 15'
|
||||
/>
|
||||
|
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
[SCUMMVM_STX0.9.1:ScummVM Modern Theme:No Author]
|
||||
[SCUMMVM_STX0.9.2:ScummVM Modern Theme:No Author]
|
||||
%using ../common
|
||||
|
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
[SCUMMVM_STX0.9.1:ScummVM Modern Theme Remastered:No Author]
|
||||
[SCUMMVM_STX0.9.2:ScummVM Modern Theme Remastered:No Author]
|
||||
%using ../common
|
||||
%using ../common-svg
|
||||
|
Loading…
x
Reference in New Issue
Block a user