Merge pull request #159 from OpenMW/master

Add OpenMW commits up to 19 Feb 2017
pull/163/head
David Cernat 8 years ago committed by GitHub
commit cdffbc05f7

@ -1758,6 +1758,41 @@ namespace CSMWorld
} }
}; };
template<typename ESXRecordT>
struct GenderNpcColumn : public Column<ESXRecordT>
{
GenderNpcColumn()
: Column<ESXRecordT>(Columns::ColumnId_GenderNpc, ColumnBase::Display_GenderNpc)
{}
virtual QVariant get(const Record<ESXRecordT>& 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<ESXRecordT>& 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<typename ESXRecordT> template<typename ESXRecordT>
struct EnchantmentTypeColumn : public Column<ESXRecordT> struct EnchantmentTypeColumn : public Column<ESXRecordT>
{ {

@ -363,7 +363,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
mBodyParts.addColumn (new FixedRecordTypeColumn<ESM::BodyPart> (UniversalId::Type_BodyPart)); mBodyParts.addColumn (new FixedRecordTypeColumn<ESM::BodyPart> (UniversalId::Type_BodyPart));
mBodyParts.addColumn (new BodyPartTypeColumn<ESM::BodyPart>); mBodyParts.addColumn (new BodyPartTypeColumn<ESM::BodyPart>);
mBodyParts.addColumn (new VampireColumn<ESM::BodyPart>); mBodyParts.addColumn (new VampireColumn<ESM::BodyPart>);
mBodyParts.addColumn (new FlagColumn<ESM::BodyPart> (Columns::ColumnId_Female, ESM::BodyPart::BPF_Female)); mBodyParts.addColumn(new GenderNpcColumn<ESM::BodyPart>);
mBodyParts.addColumn (new FlagColumn<ESM::BodyPart> (Columns::ColumnId_Playable, mBodyParts.addColumn (new FlagColumn<ESM::BodyPart> (Columns::ColumnId_Playable,
ESM::BodyPart::BPF_NotPlayable, ColumnBase::Flag_Table | ColumnBase::Flag_Dialogue, true)); ESM::BodyPart::BPF_NotPlayable, ColumnBase::Flag_Table | ColumnBase::Flag_Dialogue, true));

@ -646,6 +646,8 @@ void OMW::Engine::go()
if(!mwmp::Main::init(mContentFiles)) if(!mwmp::Main::init(mContentFiles))
return; return;
std::cout << "OSG version: " << osgGetVersion() << std::endl;
mViewer = new osgViewer::Viewer; mViewer = new osgViewer::Viewer;
mViewer->setReleaseContextAtEndOfFrameHint(false); mViewer->setReleaseContextAtEndOfFrameHint(false);

@ -297,9 +297,15 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
{ {
if (old.getTypeName() == typeid(ESM::Armor).name()) if (old.getTypeName() == typeid(ESM::Armor).name())
{ {
if (old.getClass().getEffectiveArmorRating(old, actor) >= test.getClass().getEffectiveArmorRating(test, actor)) if (old.get<ESM::Armor>()->mBase->mData.mType < test.get<ESM::Armor>()->mBase->mData.mType)
// old armor had better armor rating
continue; continue;
if (old.get<ESM::Armor>()->mBase->mData.mType == test.get<ESM::Armor>()->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 // suitable armor should replace already equipped clothing
} }

@ -3,6 +3,7 @@
#include <cassert> #include <cassert>
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
#include <cstdlib>
#include <SDL_mouse.h> #include <SDL_mouse.h>
#include <SDL_endian.h> #include <SDL_endian.h>
@ -81,6 +82,8 @@ namespace
osg::ref_ptr<osg::Image> decompress (osg::ref_ptr<osg::Image> source, float rotDegrees) osg::ref_ptr<osg::Image> decompress (osg::ref_ptr<osg::Image> source, float rotDegrees)
{ {
// TODO: use software decompression once S3TC patent expires
int width = source->s(); int width = source->s();
int height = source->t(); int height = source->t();
@ -130,9 +133,13 @@ namespace
osg::ref_ptr<osg::Geometry> geom; osg::ref_ptr<osg::Geometry> geom;
#if defined(__APPLE__) #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); 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)); geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,1,0), osg::Vec3(2,0,0), osg::Vec3(0,-2,0));
else else
#endif #endif

Loading…
Cancel
Save