1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-07-21 06:14:05 +00:00

Merge remote-tracking branch 'scrawl/master'

This commit is contained in:
Marc Zinnschlag 2015-02-11 11:30:44 +01:00
commit 2b619296d7
50 changed files with 1033 additions and 284 deletions

View file

@ -444,23 +444,23 @@ IF(NOT WIN32 AND NOT APPLE)
INSTALL(FILES "extern/shiny/License.txt" DESTINATION "${LICDIR}" RENAME "Shiny License.txt" ) INSTALL(FILES "extern/shiny/License.txt" DESTINATION "${LICDIR}" RENAME "Shiny License.txt" )
# Install icon and desktop file # Install icon and desktop file
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.desktop" DESTINATION "${DATAROOTDIR}/applications" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/launcher/images/openmw.png" DESTINATION "${ICONDIR}" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/launcher/images/openmw.png" DESTINATION "${ICONDIR}" COMPONENT "openmw")
IF(BUILD_OPENCS) IF(BUILD_OPENCS)
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw-cs.desktop" DESTINATION "${DATAROOTDIR}/applications" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "opencs") INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw-cs.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "opencs")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/opencs/openmw-cs.png" DESTINATION "${ICONDIR}" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "opencs") INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/opencs/openmw-cs.png" DESTINATION "${ICONDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS) ENDIF(BUILD_OPENCS)
# Install global configuration files # Install global configuration files
INSTALL(FILES "${OpenMW_BINARY_DIR}/settings-default.cfg" DESTINATION "${SYSCONFDIR}" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_BINARY_DIR}/settings-default.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/transparency-overrides.cfg" DESTINATION "${SYSCONFDIR}" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_BINARY_DIR}/transparency-overrides.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "${SYSCONFDIR}" RENAME "openmw.cfg" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "${SYSCONFDIR}" RENAME "openmw.cfg" COMPONENT "openmw")
IF(BUILD_OPENCS) IF(BUILD_OPENCS)
INSTALL(FILES "${OpenMW_BINARY_DIR}/opencs.ini" DESTINATION "${SYSCONFDIR}" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "opencs") INSTALL(FILES "${OpenMW_BINARY_DIR}/opencs.ini" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS) ENDIF(BUILD_OPENCS)
# Install resources # Install resources
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${DATADIR}" FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT "Resources") INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${DATADIR}" COMPONENT "Resources")
INSTALL(DIRECTORY DESTINATION "${DATADIR}/data" COMPONENT "Resources") INSTALL(DIRECTORY DESTINATION "${DATADIR}/data" COMPONENT "Resources")
ENDIF(NOT WIN32 AND NOT APPLE) ENDIF(NOT WIN32 AND NOT APPLE)

View file

@ -67,7 +67,7 @@ bool Launcher::GraphicsPage::setupOgre()
} }
catch(Ogre::Exception &ex) catch(Ogre::Exception &ex)
{ {
QString ogreError = QString::fromStdString(ex.getFullDescription().c_str()); QString ogreError = QString::fromUtf8(ex.getFullDescription().c_str());
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setWindowTitle("Error creating Ogre::Root"); msgBox.setWindowTitle("Error creating Ogre::Root");
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
@ -135,7 +135,7 @@ bool Launcher::GraphicsPage::setupSDL()
msgBox.setWindowTitle(tr("Error receiving number of screens")); msgBox.setWindowTitle(tr("Error receiving number of screens"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromStdString(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return false; return false;
} }
@ -237,7 +237,7 @@ QStringList Launcher::GraphicsPage::getAvailableOptions(const QString &key, Ogre
opt_it != i->second.possibleValues.end(); ++opt_it, ++idx) opt_it != i->second.possibleValues.end(); ++opt_it, ++idx)
{ {
if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0) { if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0) {
result << ((key == "FSAA") ? QString("MSAA ") : QString("")) + QString::fromStdString((*opt_it).c_str()).simplified(); result << ((key == "FSAA") ? QString("MSAA ") : QString("")) + QString::fromUtf8((*opt_it).c_str()).simplified();
} }
} }
} }
@ -266,7 +266,7 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
msgBox.setWindowTitle(tr("Error receiving resolutions")); msgBox.setWindowTitle(tr("Error receiving resolutions"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromStdString(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return result; return result;
} }
@ -279,7 +279,7 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
msgBox.setWindowTitle(tr("Error receiving resolutions")); msgBox.setWindowTitle(tr("Error receiving resolutions"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetDisplayMode failed:</b><br><br>") + QString::fromStdString(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetDisplayMode failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return result; return result;
} }

View file

@ -24,7 +24,7 @@ int main(int argc, char *argv[])
SDL_SetMainReady(); SDL_SetMainReady();
if (SDL_Init(SDL_INIT_VIDEO) != 0) if (SDL_Init(SDL_INIT_VIDEO) != 0)
{ {
qDebug() << "SDL_Init failed: " << QString::fromStdString(SDL_GetError()); qDebug() << "SDL_Init failed: " << QString::fromUtf8(SDL_GetError());
return 0; return 0;
} }
signal(SIGINT, SIG_DFL); // We don't want to use the SDL event loop in the launcher, signal(SIGINT, SIG_DFL); // We don't want to use the SDL event loop in the launcher,

View file

@ -108,12 +108,15 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
MWBase::StateManager::State_Running) MWBase::StateManager::State_Running)
{ {
if (!paused) if (!paused)
{
if (MWBase::Environment::get().getWorld()->getScriptsEnabled())
{ {
// local scripts // local scripts
executeLocalScripts(); executeLocalScripts();
// global scripts // global scripts
MWBase::Environment::get().getScriptManager()->getGlobalScripts().run(); MWBase::Environment::get().getScriptManager()->getGlobalScripts().run();
}
MWBase::Environment::get().getWorld()->markCellAsUnchanged(); MWBase::Environment::get().getWorld()->markCellAsUnchanged();
} }

View file

@ -390,12 +390,12 @@ int main(int argc, char**argv)
catch (std::exception &e) catch (std::exception &e)
{ {
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
if (isatty(fileno(stdin))) if (!isatty(fileno(stdin)))
std::cerr << "\nERROR: " << e.what() << std::endl;
else
#endif #endif
SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL); SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL);
std::cerr << "\nERROR: " << e.what() << std::endl;
ret = 1; ret = 1;
} }

View file

@ -489,6 +489,9 @@ namespace MWBase
virtual bool toggleGodMode() = 0; virtual bool toggleGodMode() = 0;
virtual bool toggleScripts() = 0;
virtual bool getScriptsEnabled() const = 0;
/** /**
* @brief startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met. * @brief startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met.
* @param actor * @param actor

View file

@ -420,7 +420,7 @@ namespace MWGui
// Give the script a chance to run once before we do anything else // Give the script a chance to run once before we do anything else
// this is important when setting pcskipequip as a reaction to onpcequip being set (bk_treasuryreport does this) // this is important when setting pcskipequip as a reaction to onpcequip being set (bk_treasuryreport does this)
if (!script.empty()) if (!script.empty() && MWBase::Environment::get().getWorld()->getScriptsEnabled())
{ {
MWScript::InterpreterContext interpreterContext (&ptr.getRefData().getLocals(), ptr); MWScript::InterpreterContext interpreterContext (&ptr.getRefData().getLocals(), ptr);
MWBase::Environment::get().getScriptManager()->run (script, interpreterContext); MWBase::Environment::get().getScriptManager()->run (script, interpreterContext);

View file

@ -95,8 +95,9 @@ namespace MWGui
return; return;
} }
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
store.setSelectedEnchantItem(it); store.setSelectedEnchantItem(it);
// to reset WindowManager::mSelectedSpell immediately
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(*it);
updateSpells(); updateSpells();
} }

View file

@ -444,5 +444,6 @@ op 0x20002fd: AddToLevItem
op 0x20002fe: RemoveFromLevItem op 0x20002fe: RemoveFromLevItem
op 0x20002ff: SetFactionReaction op 0x20002ff: SetFactionReaction
op 0x2000300: EnableLevelupMenu op 0x2000300: EnableLevelupMenu
op 0x2000301: ToggleScripts
opcodes 0x2000301-0x3ffffff unused opcodes 0x2000302-0x3ffffff unused

View file

@ -915,6 +915,19 @@ namespace MWScript
} }
}; };
class OpToggleScripts : public Interpreter::Opcode0
{
public:
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context = static_cast<InterpreterContext&> (runtime.getContext());
bool enabled = MWBase::Environment::get().getWorld()->toggleScripts();
context.report(enabled ? "Scripts -> On" : "Scripts -> Off");
}
};
class OpToggleGodMode : public Interpreter::Opcode0 class OpToggleGodMode : public Interpreter::Opcode0
{ {
public: public:
@ -1220,6 +1233,7 @@ namespace MWScript
interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVars<ImplicitRef>); interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVars<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVars<ExplicitRef>); interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVars<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleGodMode, new OpToggleGodMode); interpreter.installSegment5 (Compiler::Misc::opcodeToggleGodMode, new OpToggleGodMode);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleScripts, new OpToggleScripts);
interpreter.installSegment5 (Compiler::Misc::opcodeDisableLevitation, new OpEnableLevitation<false>); interpreter.installSegment5 (Compiler::Misc::opcodeDisableLevitation, new OpEnableLevitation<false>);
interpreter.installSegment5 (Compiler::Misc::opcodeEnableLevitation, new OpEnableLevitation<true>); interpreter.installSegment5 (Compiler::Misc::opcodeEnableLevitation, new OpEnableLevitation<true>);
interpreter.installSegment5 (Compiler::Misc::opcodeCast, new OpCast<ImplicitRef>); interpreter.installSegment5 (Compiler::Misc::opcodeCast, new OpCast<ImplicitRef>);

View file

@ -151,7 +151,8 @@ namespace MWWorld
mFallback(fallbackMap), mTeleportEnabled(true), mLevitationEnabled(true), mFallback(fallbackMap), mTeleportEnabled(true), mLevitationEnabled(true),
mGodMode(false), mContentFiles (contentFiles), mGodMode(false), mContentFiles (contentFiles),
mGoToJail(false), mDaysInPrison(0), mGoToJail(false), mDaysInPrison(0),
mStartCell (startCell), mStartupScript(startupScript) mStartCell (startCell), mStartupScript(startupScript),
mScriptsEnabled(true)
{ {
mPhysics = new PhysicsSystem(renderer); mPhysics = new PhysicsSystem(renderer);
mPhysEngine = mPhysics->getEngine(); mPhysEngine = mPhysics->getEngine();
@ -293,6 +294,7 @@ namespace MWWorld
mDoorStates.clear(); mDoorStates.clear();
mGodMode = false; mGodMode = false;
mScriptsEnabled = true;
mSky = true; mSky = true;
mTeleportEnabled = true; mTeleportEnabled = true;
mLevitationEnabled = true; mLevitationEnabled = true;
@ -2587,6 +2589,17 @@ namespace MWWorld
return mGodMode; return mGodMode;
} }
bool World::toggleScripts()
{
mScriptsEnabled = !mScriptsEnabled;
return mScriptsEnabled;
}
bool World::getScriptsEnabled() const
{
return mScriptsEnabled;
}
void World::loadContentFiles(const Files::Collections& fileCollections, void World::loadContentFiles(const Files::Collections& fileCollections,
const std::vector<std::string>& content, ContentLoader& contentLoader) const std::vector<std::string>& content, ContentLoader& contentLoader)
{ {
@ -2886,6 +2899,9 @@ namespace MWWorld
} }
else if (ptr.getClass().getTypeName() != typeid(ESM::Creature).name()) else if (ptr.getClass().getTypeName() != typeid(ESM::Creature).name())
return false; return false;
if (ptr.getClass().getCreatureStats(ptr).isDead())
return false;
} }
if (mType == World::Detect_Key && !ptr.getClass().isKey(ptr)) if (mType == World::Detect_Key && !ptr.getClass().isKey(ptr))
return false; return false;
@ -3164,6 +3180,8 @@ namespace MWWorld
breakInvisibility(actor); breakInvisibility(actor);
if (mScriptsEnabled)
{
if (!script.empty()) if (!script.empty())
{ {
getLocalScripts().setIgnore (object); getLocalScripts().setIgnore (object);
@ -3172,6 +3190,9 @@ namespace MWWorld
if (!interpreterContext.hasActivationBeenHandled()) if (!interpreterContext.hasActivationBeenHandled())
interpreterContext.executeActivation(object, actor); interpreterContext.executeActivation(object, actor);
} }
else
interpreterContext.executeActivation(object, actor);
}
struct ResetActorsFunctor struct ResetActorsFunctor
{ {

View file

@ -82,6 +82,7 @@ namespace MWWorld
boost::shared_ptr<ProjectileManager> mProjectileManager; boost::shared_ptr<ProjectileManager> mProjectileManager;
bool mGodMode; bool mGodMode;
bool mScriptsEnabled;
std::vector<std::string> mContentFiles; std::vector<std::string> mContentFiles;
// not implemented // not implemented
@ -572,6 +573,9 @@ namespace MWWorld
virtual bool toggleGodMode(); virtual bool toggleGodMode();
virtual bool toggleScripts();
virtual bool getScriptsEnabled() const;
/** /**
* @brief startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met. * @brief startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met.
* @param actor * @param actor

View file

@ -303,6 +303,7 @@ namespace Compiler
extensions.registerInstruction ("sv", "", opcodeShowVars, opcodeShowVarsExplicit); extensions.registerInstruction ("sv", "", opcodeShowVars, opcodeShowVarsExplicit);
extensions.registerInstruction("tgm", "", opcodeToggleGodMode); extensions.registerInstruction("tgm", "", opcodeToggleGodMode);
extensions.registerInstruction("togglegodmode", "", opcodeToggleGodMode); extensions.registerInstruction("togglegodmode", "", opcodeToggleGodMode);
extensions.registerInstruction("togglescripts", "", opcodeToggleScripts);
extensions.registerInstruction ("disablelevitation", "", opcodeDisableLevitation); extensions.registerInstruction ("disablelevitation", "", opcodeDisableLevitation);
extensions.registerInstruction ("enablelevitation", "", opcodeEnableLevitation); extensions.registerInstruction ("enablelevitation", "", opcodeEnableLevitation);
extensions.registerFunction ("getpcinjail", 'l', "", opcodeGetPcInJail); extensions.registerFunction ("getpcinjail", 'l', "", opcodeGetPcInJail);

View file

@ -278,6 +278,7 @@ namespace Compiler
const int opcodeShowVars = 0x200021d; const int opcodeShowVars = 0x200021d;
const int opcodeShowVarsExplicit = 0x200021e; const int opcodeShowVarsExplicit = 0x200021e;
const int opcodeToggleGodMode = 0x200021f; const int opcodeToggleGodMode = 0x200021f;
const int opcodeToggleScripts = 0x2000301;
const int opcodeDisableLevitation = 0x2000220; const int opcodeDisableLevitation = 0x2000220;
const int opcodeEnableLevitation = 0x2000221; const int opcodeEnableLevitation = 0x2000221;
const int opcodeCast = 0x2000227; const int opcodeCast = 0x2000227;

View file

@ -459,7 +459,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
EsmFile *file = new EsmFile(path); EsmFile *file = new EsmFile(path);
foreach (const ESM::Header::MasterData &item, fileReader.getGameFiles()) foreach (const ESM::Header::MasterData &item, fileReader.getGameFiles())
file->addGameFile(QString::fromStdString(item.name)); file->addGameFile(QString::fromUtf8(item.name.c_str()));
file->setAuthor (QString::fromUtf8(fileReader.getAuthor().c_str())); file->setAuthor (QString::fromUtf8(fileReader.getAuthor().c_str()));
file->setDate (info.lastModified()); file->setDate (info.lastModified());

View file

@ -11,14 +11,10 @@ namespace ESM
mServices = 0; mServices = 0;
} }
void AIPackageList::load(ESMReader &esm) void AIPackageList::add(ESMReader &esm)
{ {
mList.clear();
while (esm.hasMoreSubs()) {
// initialize every iteration
AIPackage pack; AIPackage pack;
esm.getSubName(); if (esm.retSubName() == AI_CNDT) {
if (esm.retSubName() == 0x54444e43) { // CNDT
mList.back().mCellName = esm.getHString(); mList.back().mCellName = esm.getHString();
} else if (esm.retSubName() == AI_Wander) { } else if (esm.retSubName() == AI_Wander) {
pack.mType = AI_Wander; pack.mType = AI_Wander;
@ -42,6 +38,29 @@ namespace ESM
} else { // not AI package related data, so leave } else { // not AI package related data, so leave
return; return;
} }
}
void AIPackageList::load(ESMReader &esm)
{
mList.clear();
while (esm.hasMoreSubs()) {
// initialize every iteration
esm.getSubName();
switch (esm.retSubName().val)
{
case AI_Wander:
case AI_Activate:
case AI_Escort:
case AI_Follow:
case AI_Travel:
case AI_CNDT:
add(esm);
break;
default:
return;
}
} }
} }

View file

@ -63,7 +63,8 @@ namespace ESM
AI_Travel = 0x545f4941, AI_Travel = 0x545f4941,
AI_Follow = 0x465f4941, AI_Follow = 0x465f4941,
AI_Escort = 0x455f4941, AI_Escort = 0x455f4941,
AI_Activate = 0x415f4941 AI_Activate = 0x415f4941,
AI_CNDT = 0x54444e43
}; };
/// \note Used for storaging packages in a single container /// \note Used for storaging packages in a single container
@ -90,11 +91,12 @@ namespace ESM
{ {
std::vector<AIPackage> mList; std::vector<AIPackage> mList;
/// \note This breaks consistency of subrecords reading: /// Add a single AIPackage, assumes subrecord name was already read
/// after calling it subrecord name is already read, so void add(ESMReader &esm);
/// it needs to use retSubName() if needed. But, hey, there
/// is only one field left (XSCL) and only two records uses AI /// TODO: remove this method. The ESM format does not guarantee that all AI packages follow one another
void load(ESMReader &esm); void load(ESMReader &esm);
void save(ESMWriter &esm) const; void save(ESMWriter &esm) const;
}; };
} }

View file

@ -7,16 +7,22 @@
namespace ESM namespace ESM
{ {
void PartReferenceList::load(ESMReader &esm) void PartReferenceList::add(ESMReader &esm)
{
mParts.clear();
while (esm.isNextSub("INDX"))
{ {
PartReference pr; PartReference pr;
esm.getHT(pr.mPart); // The INDX byte esm.getHT(pr.mPart); // The INDX byte
pr.mMale = esm.getHNOString("BNAM"); pr.mMale = esm.getHNOString("BNAM");
pr.mFemale = esm.getHNOString("CNAM"); pr.mFemale = esm.getHNOString("CNAM");
mParts.push_back(pr); mParts.push_back(pr);
}
void PartReferenceList::load(ESMReader &esm)
{
mParts.clear();
while (esm.isNextSub("INDX"))
{
add(esm);
} }
} }
@ -34,13 +40,42 @@ unsigned int Armor::sRecordId = REC_ARMO;
void Armor::load(ESMReader &esm) void Armor::load(ESMReader &esm)
{ {
mModel = esm.getHNString("MODL"); mParts.mParts.clear();
mName = esm.getHNOString("FNAM"); bool hasData = false;
mScript = esm.getHNOString("SCRI"); while (esm.hasMoreSubs())
esm.getHNT(mData, "AODT", 24); {
mIcon = esm.getHNOString("ITEX"); esm.getSubName();
mParts.load(esm); uint32_t name = esm.retSubName().val;
mEnchant = esm.getHNOString("ENAM"); switch (name)
{
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'A','O','D','T'>::value:
esm.getHT(mData, 24);
hasData = true;
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'I','T','E','X'>::value:
mIcon = esm.getHString();
break;
case ESM::FourCC<'E','N','A','M'>::value:
mEnchant = esm.getHString();
break;
case ESM::FourCC<'I','N','D','X'>::value:
mParts.add(esm);
break;
default:
esm.fail("Unknown subrecord");
}
}
if (!hasData)
esm.fail("Missing CTDT subrecord");
} }
void Armor::save(ESMWriter &esm) const void Armor::save(ESMWriter &esm) const

View file

@ -55,6 +55,10 @@ struct PartReferenceList
{ {
std::vector<PartReference> mParts; std::vector<PartReference> mParts;
/// Load one part, assumes the subrecord name was already read
void add(ESMReader &esm);
/// TODO: remove this method. The ESM format does not guarantee that all Part subrecords follow one another.
void load(ESMReader &esm); void load(ESMReader &esm);
void save(ESMWriter &esm) const; void save(ESMWriter &esm) const;
}; };

View file

@ -10,13 +10,41 @@ namespace ESM
void Book::load(ESMReader &esm) void Book::load(ESMReader &esm)
{ {
mModel = esm.getHNString("MODL"); bool hasData = false;
mName = esm.getHNOString("FNAM"); while (esm.hasMoreSubs())
esm.getHNT(mData, "BKDT", 20); {
mScript = esm.getHNOString("SCRI"); esm.getSubName();
mIcon = esm.getHNOString("ITEX"); uint32_t name = esm.retSubName().val;
mText = esm.getHNOString("TEXT"); switch (name)
mEnchant = esm.getHNOString("ENAM"); {
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'B','K','D','T'>::value:
esm.getHT(mData, 20);
hasData = true;
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'I','T','E','X'>::value:
mIcon = esm.getHString();
break;
case ESM::FourCC<'E','N','A','M'>::value:
mEnchant = esm.getHString();
break;
case ESM::FourCC<'T','E','X','T'>::value:
mText = esm.getHString();
break;
default:
esm.fail("Unknown subrecord");
}
}
if (!hasData)
esm.fail("Missing BKDT subrecord");
} }
void Book::save(ESMWriter &esm) const void Book::save(ESMWriter &esm) const
{ {

View file

@ -10,17 +10,42 @@ namespace ESM
void Clothing::load(ESMReader &esm) void Clothing::load(ESMReader &esm)
{ {
mModel = esm.getHNString("MODL"); mParts.mParts.clear();
mName = esm.getHNOString("FNAM"); bool hasData = false;
esm.getHNT(mData, "CTDT", 12); while (esm.hasMoreSubs())
{
mScript = esm.getHNOString("SCRI"); esm.getSubName();
mIcon = esm.getHNOString("ITEX"); uint32_t name = esm.retSubName().val;
switch (name)
mParts.load(esm); {
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
mEnchant = esm.getHNOString("ENAM"); break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'C','T','D','T'>::value:
esm.getHT(mData, 12);
hasData = true;
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'I','T','E','X'>::value:
mIcon = esm.getHString();
break;
case ESM::FourCC<'E','N','A','M'>::value:
mEnchant = esm.getHString();
break;
case ESM::FourCC<'I','N','D','X'>::value:
mParts.add(esm);
break;
default:
esm.fail("Unknown subrecord");
}
}
if (!hasData)
esm.fail("Missing CTDT subrecord");
} }
void Clothing::save(ESMWriter &esm) const void Clothing::save(ESMWriter &esm) const

View file

@ -7,14 +7,19 @@
namespace ESM namespace ESM
{ {
void InventoryList::add(ESMReader &esm)
{
ContItem ci;
esm.getHT(ci, 36);
mList.push_back(ci);
}
void InventoryList::load(ESMReader &esm) void InventoryList::load(ESMReader &esm)
{ {
mList.clear(); mList.clear();
ContItem ci;
while (esm.isNextSub("NPCO")) while (esm.isNextSub("NPCO"))
{ {
esm.getHT(ci, 36); add(esm);
mList.push_back(ci);
} }
} }

View file

@ -26,6 +26,10 @@ struct InventoryList
{ {
std::vector<ContItem> mList; std::vector<ContItem> mList;
/// Load one item, assumes subrecord name is already read
void add(ESMReader &esm);
/// TODO: remove this method, the ESM format doesn't guarantee that all ContItems follow one another
void load(ESMReader &esm); void load(ESMReader &esm);
void save(ESMWriter &esm) const; void save(ESMWriter &esm) const;
}; };

View file

@ -10,11 +10,31 @@ namespace ESM
void Door::load(ESMReader &esm) void Door::load(ESMReader &esm)
{ {
mModel = esm.getHNString("MODL"); while (esm.hasMoreSubs())
mName = esm.getHNOString("FNAM"); {
mScript = esm.getHNOString("SCRI"); esm.getSubName();
mOpenSound = esm.getHNOString("SNAM"); uint32_t name = esm.retSubName().val;
mCloseSound = esm.getHNOString("ANAM"); switch (name)
{
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'S','N','A','M'>::value:
mOpenSound = esm.getHString();
break;
case ESM::FourCC<'A','N','A','M'>::value:
mCloseSound = esm.getHString();
break;
default:
esm.fail("Unknown subrecord");
}
}
} }
void Door::save(ESMWriter &esm) const void Door::save(ESMWriter &esm) const

View file

@ -204,20 +204,51 @@ void MagicEffect::load(ESMReader &esm)
mData.mFlags |= HardcodedFlags[mIndex]; mData.mFlags |= HardcodedFlags[mIndex];
} }
mIcon = esm.getHNOString("ITEX"); // vanilla MW accepts the _SND subrecords before or after DESC... I hope
mParticle = esm.getHNOString("PTEX"); // this isn't true for other records, or we have to do a mass-refactor
while (esm.hasMoreSubs())
mBoltSound = esm.getHNOString("BSND"); {
mCastSound = esm.getHNOString("CSND"); esm.getSubName();
mHitSound = esm.getHNOString("HSND"); uint32_t name = esm.retSubName().val;
mAreaSound = esm.getHNOString("ASND"); switch (name)
{
mCasting = esm.getHNOString("CVFX"); case ESM::FourCC<'I','T','E','X'>::value:
mBolt = esm.getHNOString("BVFX"); mIcon = esm.getHString();
mHit = esm.getHNOString("HVFX"); break;
mArea = esm.getHNOString("AVFX"); case ESM::FourCC<'P','T','E','X'>::value:
mParticle = esm.getHString();
mDescription = esm.getHNOString("DESC"); break;
case ESM::FourCC<'B','S','N','D'>::value:
mBoltSound = esm.getHString();
break;
case ESM::FourCC<'C','S','N','D'>::value:
mCastSound = esm.getHString();
break;
case ESM::FourCC<'H','S','N','D'>::value:
mHitSound = esm.getHString();
break;
case ESM::FourCC<'A','S','N','D'>::value:
mAreaSound = esm.getHString();
break;
case ESM::FourCC<'C','V','F','X'>::value:
mCasting = esm.getHString();
break;
case ESM::FourCC<'B','V','F','X'>::value:
mBolt = esm.getHString();
break;
case ESM::FourCC<'H','V','F','X'>::value:
mHit = esm.getHString();
break;
case ESM::FourCC<'A','V','F','X'>::value:
mArea = esm.getHString();
break;
case ESM::FourCC<'D','E','S','C'>::value:
mDescription = esm.getHString();
break;
default:
esm.fail("Unknown subrecord " + esm.retSubName().toString());
}
}
} }
void MagicEffect::save(ESMWriter &esm) const void MagicEffect::save(ESMWriter &esm) const
{ {

View file

@ -10,12 +10,35 @@ namespace ESM
void Miscellaneous::load(ESMReader &esm) void Miscellaneous::load(ESMReader &esm)
{ {
mModel = esm.getHNString("MODL"); bool hasData = false;
mName = esm.getHNOString("FNAM"); while (esm.hasMoreSubs())
esm.getHNT(mData, "MCDT", 12); {
mScript = esm.getHNOString("SCRI"); esm.getSubName();
mIcon = esm.getHNOString("ITEX"); uint32_t name = esm.retSubName().val;
switch (name)
{
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'M','C','D','T'>::value:
esm.getHT(mData, 12);
hasData = true;
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'I','T','E','X'>::value:
mIcon = esm.getHString();
break;
} }
}
if (!hasData)
esm.fail("Missing MCDT subrecord");
}
void Miscellaneous::save(ESMWriter &esm) const void Miscellaneous::save(ESMWriter &esm) const
{ {
esm.writeHNCString("MODL", mModel); esm.writeHNCString("MODL", mModel);

View file

@ -12,18 +12,46 @@ void NPC::load(ESMReader &esm)
{ {
mPersistent = esm.getRecordFlags() & 0x0400; mPersistent = esm.getRecordFlags() & 0x0400;
mModel = esm.getHNOString("MODL"); mSpells.mList.clear();
mName = esm.getHNOString("FNAM"); mInventory.mList.clear();
mTransport.clear();
mAiPackage.mList.clear();
mRace = esm.getHNString("RNAM"); bool hasNpdt = false;
mClass = esm.getHNString("CNAM"); bool hasFlags = false;
mFaction = esm.getHNString("ANAM"); mHasAI = false;
mHead = esm.getHNString("BNAM"); while (esm.hasMoreSubs())
mHair = esm.getHNString("KNAM"); {
esm.getSubName();
mScript = esm.getHNOString("SCRI"); uint32_t name = esm.retSubName().val;
switch (name)
esm.getSubNameIs("NPDT"); {
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'R','N','A','M'>::value:
mRace = esm.getHString();
break;
case ESM::FourCC<'C','N','A','M'>::value:
mClass = esm.getHString();
break;
case ESM::FourCC<'A','N','A','M'>::value:
mFaction = esm.getHString();
break;
case ESM::FourCC<'B','N','A','M'>::value:
mHead = esm.getHString();
break;
case ESM::FourCC<'K','N','A','M'>::value:
mHair = esm.getHString();
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'N','P','D','T'>::value:
hasNpdt = true;
esm.getSubHeader(); esm.getSubHeader();
if (esm.getSubSize() == 52) if (esm.getSubSize() == 52)
{ {
@ -37,31 +65,47 @@ void NPC::load(ESMReader &esm)
} }
else else
esm.fail("NPC_NPDT must be 12 or 52 bytes long"); esm.fail("NPC_NPDT must be 12 or 52 bytes long");
break;
esm.getHNT(mFlags, "FLAG"); case ESM::FourCC<'F','L','A','G'>::value:
hasFlags = true;
mInventory.load(esm); esm.getHT(mFlags);
mSpells.load(esm); break;
case ESM::FourCC<'N','P','C','S'>::value:
if (esm.isNextSub("AIDT")) mSpells.add(esm);
{ break;
case ESM::FourCC<'N','P','C','O'>::value:
mInventory.add(esm);
break;
case ESM::FourCC<'A','I','D','T'>::value:
esm.getHExact(&mAiData, sizeof(mAiData)); esm.getHExact(&mAiData, sizeof(mAiData));
mHasAI= true; mHasAI= true;
} break;
else case ESM::FourCC<'D','O','D','T'>::value:
mHasAI = false; {
mTransport.clear();
while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) {
if (esm.retSubName() == 0x54444f44) { // DODT struct
Dest dodt; Dest dodt;
esm.getHExact(&dodt.mPos, 24); esm.getHExact(&dodt.mPos, 24);
mTransport.push_back(dodt); mTransport.push_back(dodt);
} else if (esm.retSubName() == 0x4d414e44) { // DNAM struct break;
}
case ESM::FourCC<'D','N','A','M'>::value:
mTransport.back().mCellName = esm.getHString(); mTransport.back().mCellName = esm.getHString();
break;
case AI_Wander:
case AI_Activate:
case AI_Escort:
case AI_Follow:
case AI_Travel:
case AI_CNDT:
mAiPackage.add(esm);
break;
default:
esm.fail("Unknown subrecord " + esm.retSubName().toString());
} }
} }
mAiPackage.load(esm); if (!hasNpdt)
esm.fail("Missing NPDT subrecord");
if (!hasFlags)
esm.fail("Missing FLAG subrecord");
} }
void NPC::save(ESMWriter &esm) const void NPC::save(ESMWriter &esm) const
{ {

View file

@ -20,10 +20,34 @@ namespace ESM
void Race::load(ESMReader &esm) void Race::load(ESMReader &esm)
{ {
mName = esm.getHNOString("FNAM"); mPowers.mList.clear();
esm.getHNT(mData, "RADT", 140);
mPowers.load(esm); bool hasData = false;
mDescription = esm.getHNOString("DESC"); while (esm.hasMoreSubs())
{
esm.getSubName();
uint32_t name = esm.retSubName().val;
switch (name)
{
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'R','A','D','T'>::value:
esm.getHT(mData, 140);
hasData = true;
break;
case ESM::FourCC<'D','E','S','C'>::value:
mDescription = esm.getHString();
break;
case ESM::FourCC<'N','P','C','S'>::value:
mPowers.add(esm);
break;
default:
esm.fail("Unknown subrecord " + esm.retSubName().toString());
}
}
if (!hasData)
esm.fail("Missing RADT subrecord");
} }
void Race::save(ESMWriter &esm) const void Race::save(ESMWriter &esm) const
{ {

View file

@ -10,9 +10,30 @@ namespace ESM
void Spell::load(ESMReader &esm) void Spell::load(ESMReader &esm)
{ {
mName = esm.getHNOString("FNAM"); bool hasData = false;
esm.getHNT(mData, "SPDT", 12); while (esm.hasMoreSubs())
mEffects.load(esm); {
esm.getSubName();
uint32_t val = esm.retSubName().val;
switch (val)
{
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'S','P','D','T'>::value:
esm.getHT(mData, 12);
hasData = true;
break;
case ESM::FourCC<'E','N','A','M'>::value:
ENAMstruct s;
esm.getHT(s, 24);
mEffects.mList.push_back(s);
break;
}
}
if (!hasData)
esm.fail("Missing SPDT subrecord");
} }
void Spell::save(ESMWriter &esm) const void Spell::save(ESMWriter &esm) const

View file

@ -10,12 +10,38 @@ namespace ESM
void Weapon::load(ESMReader &esm) void Weapon::load(ESMReader &esm)
{ {
mModel = esm.getHNString("MODL"); bool hasData = false;
mName = esm.getHNOString("FNAM"); while (esm.hasMoreSubs())
esm.getHNT(mData, "WPDT", 32); {
mScript = esm.getHNOString("SCRI"); esm.getSubName();
mIcon = esm.getHNOString("ITEX"); uint32_t name = esm.retSubName().val;
mEnchant = esm.getHNOString("ENAM"); switch (name)
{
case ESM::FourCC<'M','O','D','L'>::value:
mModel = esm.getHString();
break;
case ESM::FourCC<'F','N','A','M'>::value:
mName = esm.getHString();
break;
case ESM::FourCC<'W','P','D','T'>::value:
esm.getHT(mData, 32);
hasData = true;
break;
case ESM::FourCC<'S','C','R','I'>::value:
mScript = esm.getHString();
break;
case ESM::FourCC<'I','T','E','X'>::value:
mIcon = esm.getHString();
break;
case ESM::FourCC<'E','N','A','M'>::value:
mEnchant = esm.getHString();
break;
default:
esm.fail("Unknown subrecord");
}
}
if (!hasData)
esm.fail("Missing WPDT subrecord");
} }
void Weapon::save(ESMWriter &esm) const void Weapon::save(ESMWriter &esm) const
{ {

View file

@ -9,10 +9,15 @@ void SpellList::load(ESMReader &esm)
{ {
mList.clear(); mList.clear();
while (esm.isNextSub("NPCS")) { while (esm.isNextSub("NPCS")) {
mList.push_back(esm.getHString()); add(esm);
} }
} }
void SpellList::add(ESMReader &esm)
{
mList.push_back(esm.getHString());
}
void SpellList::save(ESMWriter &esm) const void SpellList::save(ESMWriter &esm) const
{ {
for (std::vector<std::string>::const_iterator it = mList.begin(); it != mList.end(); ++it) { for (std::vector<std::string>::const_iterator it = mList.begin(); it != mList.end(); ++it) {

View file

@ -19,6 +19,11 @@ namespace ESM
/// Is this spell ID in mList? /// Is this spell ID in mList?
bool exists(const std::string& spell) const; bool exists(const std::string& spell) const;
/// Load one spell, assumes the subrecord name was already read
void add(ESMReader &esm);
/// Load all spells
/// TODO: remove this method, the ESM format doesn't guarantee that all spell subrecords follow one another
void load(ESMReader &esm); void load(ESMReader &esm);
void save(ESMWriter &esm) const; void save(ESMWriter &esm) const;
}; };

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "buffercache.hpp" #include "buffercache.hpp"
#include <OgreHardwareBufferManager.h> #include <OgreHardwareBufferManager.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_BUFFERCACHE_H #ifndef COMPONENTS_TERRAIN_BUFFERCACHE_H
#define COMPONENTS_TERRAIN_BUFFERCACHE_H #define COMPONENTS_TERRAIN_BUFFERCACHE_H

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "chunk.hpp" #include "chunk.hpp"
#include <OgreSceneNode.h> #include <OgreSceneNode.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_TERRAINBATCH_H #ifndef COMPONENTS_TERRAIN_TERRAINBATCH_H
#define COMPONENTS_TERRAIN_TERRAINBATCH_H #define COMPONENTS_TERRAIN_TERRAINBATCH_H

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "defaultworld.hpp" #include "defaultworld.hpp"
#include <OgreAxisAlignedBox.h> #include <OgreAxisAlignedBox.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_H #ifndef COMPONENTS_TERRAIN_H
#define COMPONENTS_TERRAIN_H #define COMPONENTS_TERRAIN_H

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_DEFS_HPP #ifndef COMPONENTS_TERRAIN_DEFS_HPP
#define COMPONENTS_TERRAIN_DEFS_HPP #define COMPONENTS_TERRAIN_DEFS_HPP

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "material.hpp" #include "material.hpp"
#include <OgreMaterialManager.h> #include <OgreMaterialManager.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_MATERIAL_H #ifndef COMPONENTS_TERRAIN_MATERIAL_H
#define COMPONENTS_TERRAIN_MATERIAL_H #define COMPONENTS_TERRAIN_MATERIAL_H

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "quadtreenode.hpp" #include "quadtreenode.hpp"
#include <OgreSceneManager.h> #include <OgreSceneManager.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_QUADTREENODE_H #ifndef COMPONENTS_TERRAIN_QUADTREENODE_H
#define COMPONENTS_TERRAIN_QUADTREENODE_H #define COMPONENTS_TERRAIN_QUADTREENODE_H

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_STORAGE_H #ifndef COMPONENTS_TERRAIN_STORAGE_H
#define COMPONENTS_TERRAIN_STORAGE_H #define COMPONENTS_TERRAIN_STORAGE_H

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "terraingrid.hpp" #include "terraingrid.hpp"
#include <OgreSceneManager.h> #include <OgreSceneManager.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_TERRAINGRID_H #ifndef COMPONENTS_TERRAIN_TERRAINGRID_H
#define COMPONENTS_TERRAIN_TERRAINGRID_H #define COMPONENTS_TERRAIN_TERRAINGRID_H

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "world.hpp" #include "world.hpp"
#include <OgreAxisAlignedBox.h> #include <OgreAxisAlignedBox.h>

View file

@ -1,3 +1,24 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef COMPONENTS_TERRAIN_WORLD_H #ifndef COMPONENTS_TERRAIN_WORLD_H
#define COMPONENTS_TERRAIN_WORLD_H #define COMPONENTS_TERRAIN_WORLD_H

View file

@ -1,3 +1,25 @@
/*
* Copyright (c) 2015 scrawl <scrawl@baseoftrash.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "core.h" #include "core.h"
#define IS_FIRST_PASS (@shPropertyString(pass_index) == 0) #define IS_FIRST_PASS (@shPropertyString(pass_index) == 0)