|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
void test(const MWWorld::Ptr& actor, int &compiled, int &total, const Compiler::Extensions* extensions)
|
|
|
|
|
void test(const MWWorld::Ptr& actor, int &compiled, int &total, const Compiler::Extensions* extensions, int warningsMode)
|
|
|
|
|
{
|
|
|
|
|
MWDialogue::Filter filter(actor, 0, false);
|
|
|
|
|
|
|
|
|
@ -29,6 +29,7 @@ void test(const MWWorld::Ptr& actor, int &compiled, int &total, const Compiler::
|
|
|
|
|
compilerContext.setExtensions(extensions);
|
|
|
|
|
std::ostream errorStream(std::cout.rdbuf());
|
|
|
|
|
Compiler::StreamErrorHandler errorHandler(errorStream);
|
|
|
|
|
errorHandler.setWarningsMode (warningsMode);
|
|
|
|
|
|
|
|
|
|
const MWWorld::Store<ESM::Dialogue>& dialogues = MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
|
|
|
|
|
for (MWWorld::Store<ESM::Dialogue>::iterator it = dialogues.begin(); it != dialogues.end(); ++it)
|
|
|
|
@ -100,21 +101,21 @@ namespace MWDialogue
|
|
|
|
|
namespace ScriptTest
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
std::pair<int, int> compileAll(const Compiler::Extensions *extensions)
|
|
|
|
|
std::pair<int, int> compileAll(const Compiler::Extensions *extensions, int warningsMode)
|
|
|
|
|
{
|
|
|
|
|
int compiled = 0, total = 0;
|
|
|
|
|
const MWWorld::Store<ESM::NPC>& npcs = MWBase::Environment::get().getWorld()->getStore().get<ESM::NPC>();
|
|
|
|
|
for (MWWorld::Store<ESM::NPC>::iterator it = npcs.begin(); it != npcs.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), it->mId);
|
|
|
|
|
test(ref.getPtr(), compiled, total, extensions);
|
|
|
|
|
test(ref.getPtr(), compiled, total, extensions, warningsMode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const MWWorld::Store<ESM::Creature>& creatures = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>();
|
|
|
|
|
for (MWWorld::Store<ESM::Creature>::iterator it = creatures.begin(); it != creatures.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), it->mId);
|
|
|
|
|
test(ref.getPtr(), compiled, total, extensions);
|
|
|
|
|
test(ref.getPtr(), compiled, total, extensions, warningsMode);
|
|
|
|
|
}
|
|
|
|
|
return std::make_pair(total, compiled);
|
|
|
|
|
}
|
|
|
|
|