diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index 4e608dbbd..33a71e97a 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -1757,6 +1757,41 @@ namespace CSMWorld return true; } }; + + template + struct GenderNpcColumn : public Column + { + GenderNpcColumn() + : Column(Columns::ColumnId_GenderNpc, ColumnBase::Display_GenderNpc) + {} + + virtual QVariant get(const Record& record) const + { + // Implemented this way to allow additional gender types in the future. + if ((record.get().mData.mFlags & ESM::BodyPart::BPF_Female) == ESM::BodyPart::BPF_Female) + return 1; + + return 0; + } + + virtual void set(Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + // Implemented this way to allow additional gender types in the future. + if (data.toInt() == 1) + record2.mData.mFlags = (record2.mData.mFlags & ~ESM::BodyPart::BPF_Female) | ESM::BodyPart::BPF_Female; + else + record2.mData.mFlags = record2.mData.mFlags & ~ESM::BodyPart::BPF_Female; + + record.setModified(record2); + } + + virtual bool isEditable() const + { + return true; + } + }; template struct EnchantmentTypeColumn : public Column diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index da4942eec..5a59f19f7 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -363,7 +363,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mBodyParts.addColumn (new FixedRecordTypeColumn (UniversalId::Type_BodyPart)); mBodyParts.addColumn (new BodyPartTypeColumn); mBodyParts.addColumn (new VampireColumn); - mBodyParts.addColumn (new FlagColumn (Columns::ColumnId_Female, ESM::BodyPart::BPF_Female)); + mBodyParts.addColumn(new GenderNpcColumn); mBodyParts.addColumn (new FlagColumn (Columns::ColumnId_Playable, ESM::BodyPart::BPF_NotPlayable, ColumnBase::Flag_Table | ColumnBase::Flag_Dialogue, true)); diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 1704577eb..0ab4d25f7 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -646,6 +646,8 @@ void OMW::Engine::go() if(!mwmp::Main::init(mContentFiles)) return; + std::cout << "OSG version: " << osgGetVersion() << std::endl; + mViewer = new osgViewer::Viewer; mViewer->setReleaseContextAtEndOfFrameHint(false); diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 2e32debfa..34b6fcf69 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -297,9 +297,15 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor) { if (old.getTypeName() == typeid(ESM::Armor).name()) { - if (old.getClass().getEffectiveArmorRating(old, actor) >= test.getClass().getEffectiveArmorRating(test, actor)) - // old armor had better armor rating + if (old.get()->mBase->mData.mType < test.get()->mBase->mData.mType) continue; + + if (old.get()->mBase->mData.mType == test.get()->mBase->mData.mType) + { + if (old.getClass().getEffectiveArmorRating(old, actor) >= test.getClass().getEffectiveArmorRating(test, actor)) + // old armor had better armor rating + continue; + } } // suitable armor should replace already equipped clothing } diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index ad03083de..411fb3694 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -81,6 +82,8 @@ namespace osg::ref_ptr decompress (osg::ref_ptr source, float rotDegrees) { + // TODO: use software decompression once S3TC patent expires + int width = source->s(); int height = source->t(); @@ -130,9 +133,13 @@ namespace osg::ref_ptr geom; #if defined(__APPLE__) - // Extra flip needed on Intel graphics OS X systems due to a driver bug + // Extra flip needed on OS X systems due to a driver bug + const char* envval = getenv("OPENMW_CURSOR_WORKAROUND"); + bool workaround = !envval || envval == std::string("1"); std::string vendorString = (const char*)glGetString(GL_VENDOR); - if (vendorString.find("Intel") != std::string::npos) + if (!envval) + workaround = vendorString.find("Intel") != std::string::npos || vendorString.find("ATI") != std::string::npos || vendorString.find("AMD") != std::string::npos; + if (workaround) geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,1,0), osg::Vec3(2,0,0), osg::Vec3(0,-2,0)); else #endif