-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts: apps/opencs/CMakeLists.txt extern/ogre-ffmpeg-videoplayer/CMakeLists.txt
- Loading branch information
Showing
22 changed files
with
416 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "soundgencheck.hpp" | ||
|
||
#include <sstream> | ||
|
||
#include "../world/refiddata.hpp" | ||
#include "../world/universalid.hpp" | ||
|
||
CSMTools::SoundGenCheckStage::SoundGenCheckStage(const CSMWorld::IdCollection<ESM::SoundGenerator> &soundGens, | ||
const CSMWorld::IdCollection<ESM::Sound> &sounds, | ||
const CSMWorld::RefIdCollection &referenceables) | ||
: mSoundGens(soundGens), | ||
mSounds(sounds), | ||
mReferenceables(referenceables) | ||
{} | ||
|
||
int CSMTools::SoundGenCheckStage::setup() | ||
{ | ||
return mSoundGens.getSize(); | ||
} | ||
|
||
void CSMTools::SoundGenCheckStage::perform(int stage, CSMDoc::Messages &messages) | ||
{ | ||
const CSMWorld::Record<ESM::SoundGenerator> &record = mSoundGens.getRecord(stage); | ||
if (record.isDeleted()) | ||
{ | ||
return; | ||
} | ||
|
||
const ESM::SoundGenerator soundGen = record.get(); | ||
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_SoundGen, soundGen.mId); | ||
|
||
if (!soundGen.mCreature.empty()) | ||
{ | ||
CSMWorld::RefIdData::LocalIndex creatureIndex = mReferenceables.getDataSet().searchId(soundGen.mCreature); | ||
if (creatureIndex.first == -1) | ||
{ | ||
messages.push_back(std::make_pair(id, "No such creature '" + soundGen.mCreature + "'")); | ||
} | ||
else if (creatureIndex.second != CSMWorld::UniversalId::Type_Creature) | ||
{ | ||
messages.push_back(std::make_pair(id, "'" + soundGen.mCreature + "' is not a creature")); | ||
} | ||
} | ||
|
||
if (soundGen.mSound.empty()) | ||
{ | ||
messages.push_back(std::make_pair(id, "Sound is not specified")); | ||
} | ||
else if (mSounds.searchId(soundGen.mSound) == -1) | ||
{ | ||
messages.push_back(std::make_pair(id, "No such sound '" + soundGen.mSound + "'")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef CSM_TOOLS_SOUNDGENCHECK_HPP | ||
#define CSM_TOOLS_SOUNDGENCHECK_HPP | ||
|
||
#include "../world/data.hpp" | ||
|
||
#include "../doc/stage.hpp" | ||
|
||
namespace CSMTools | ||
{ | ||
/// \brief VerifyStage: make sure that sound gen records are internally consistent | ||
class SoundGenCheckStage : public CSMDoc::Stage | ||
{ | ||
const CSMWorld::IdCollection<ESM::SoundGenerator> &mSoundGens; | ||
const CSMWorld::IdCollection<ESM::Sound> &mSounds; | ||
const CSMWorld::RefIdCollection &mReferenceables; | ||
|
||
public: | ||
SoundGenCheckStage(const CSMWorld::IdCollection<ESM::SoundGenerator> &soundGens, | ||
const CSMWorld::IdCollection<ESM::Sound> &sounds, | ||
const CSMWorld::RefIdCollection &referenceables); | ||
|
||
virtual int setup(); | ||
///< \return number of steps | ||
|
||
virtual void perform(int stage, CSMDoc::Messages &messages); | ||
///< Messages resulting from this stage will be appended to \a messages. | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.