mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-17 11:59:28 +00:00
Re-implement (optionally) pre-decoding audio to reduce disk seek/decoding time.
This was removed in HG changeset 7ec478d993b7, and is now implemented in a way that is better than before: voice overs and music no longer cause decoding lag, as they are always decoded on-the-fly. The additional memory use (~40 MB) should be no problem for anyone. The default is still to decode everything on the fly.
This commit is contained in:
parent
fdce574cc5
commit
c02ea1ce83
5 changed files with 148 additions and 17 deletions
|
@ -4484,6 +4484,7 @@ void DSQ::onUpdate(float dt)
|
|||
os << " | p: " << core->processedRenderObjectCount << " | t: " << core->totalRenderObjectCount;
|
||||
os << " | s: " << dsq->continuity.seconds;
|
||||
os << " | evQ: " << core->eventQueue.getSize();
|
||||
os << " | sndQ: " << core->dbg_numThreadDecoders;
|
||||
/*
|
||||
os << " | s: " << dsq->continuity.seconds;
|
||||
os << " cr: " << core->cullRadius;
|
||||
|
|
|
@ -87,12 +87,17 @@ void UserSettings::save()
|
|||
}
|
||||
xml_audio.InsertEndChild(xml_volume);
|
||||
|
||||
|
||||
TiXmlElement xml_device("Device");
|
||||
{
|
||||
xml_device.SetAttribute("name", audio.deviceName);
|
||||
}
|
||||
xml_audio.InsertEndChild(xml_device);
|
||||
|
||||
TiXmlElement xml_prebuf("Prebuffer");
|
||||
{
|
||||
xml_prebuf.SetAttribute("on", audio.prebuffer);
|
||||
}
|
||||
xml_audio.InsertEndChild(xml_prebuf);
|
||||
}
|
||||
doc.InsertEndChild(xml_audio);
|
||||
|
||||
|
@ -393,6 +398,12 @@ void UserSettings::load(bool doApply, const std::string &overrideFile)
|
|||
{
|
||||
audio.deviceName = xml_device->Attribute("name");
|
||||
}
|
||||
|
||||
TiXmlElement *xml_prebuf = xml_audio->FirstChildElement("Prebuffer");
|
||||
if (xml_prebuf)
|
||||
{
|
||||
xml_prebuf->Attribute("on", &audio.prebuffer);
|
||||
}
|
||||
}
|
||||
TiXmlElement *xml_video = doc.FirstChildElement("Video");
|
||||
if (xml_video)
|
||||
|
@ -547,6 +558,8 @@ void UserSettings::apply()
|
|||
}
|
||||
|
||||
dsq->bindInput();
|
||||
|
||||
core->settings.prebufferSounds = audio.prebuffer;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -85,12 +85,13 @@ public:
|
|||
|
||||
struct Audio
|
||||
{
|
||||
Audio() { micOn = 0; octave=0; musvol=voxvol=sfxvol=1.0; subtitles=false; }
|
||||
Audio() { micOn = 0; octave=0; musvol=voxvol=sfxvol=1.0; subtitles=false; prebuffer=false;}
|
||||
int micOn;
|
||||
int octave;
|
||||
float voxvol, sfxvol, musvol;
|
||||
int subtitles;
|
||||
std::string deviceName;
|
||||
int prebuffer;
|
||||
} audio;
|
||||
|
||||
struct Video
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue