You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
837 B
C++
34 lines
837 B
C++
#include "soundcheck.hpp"
|
|
|
|
#include <sstream>
|
|
|
|
#include <components/esm/loadskil.hpp>
|
|
|
|
#include "../world/universalid.hpp"
|
|
|
|
CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds)
|
|
: mSounds (sounds)
|
|
{}
|
|
|
|
int CSMTools::SoundCheckStage::setup()
|
|
{
|
|
return mSounds.getSize();
|
|
}
|
|
|
|
void CSMTools::SoundCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
|
{
|
|
const CSMWorld::Record<ESM::Sound>& record = mSounds.getRecord (stage);
|
|
|
|
if (record.isDeleted())
|
|
return;
|
|
|
|
const ESM::Sound& sound = record.get();
|
|
|
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Sound, sound.mId);
|
|
|
|
if (sound.mData.mMinRange>sound.mData.mMaxRange)
|
|
messages.push_back (std::make_pair (id, "Maximum range larger than minimum range"));
|
|
|
|
/// \todo check, if the sound file exists
|
|
}
|