mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-23 06:53:54 +00:00
Merge branch 'master' of https://github.com/OpenMW/openmw
This commit is contained in:
commit
ec471365f5
45 changed files with 204 additions and 77 deletions
|
@ -1,7 +1,7 @@
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
# - osx
|
- osx
|
||||||
osx_image: xcode7.2
|
osx_image: xcode7.3
|
||||||
language: cpp
|
language: cpp
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
|
@ -15,6 +15,7 @@ env:
|
||||||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
||||||
# via the "travis encrypt" command using the project repo's public key
|
# via the "travis encrypt" command using the project repo's public key
|
||||||
- secure: "jybGzAdUbqt9vWR/GEnRd96BgAi/7Zd1+2HK68j/i/8+/1YH2XxLOy4Jv/DUBhBlJIkxs/Xv8dRcUlFOclZDHX1d/9Qnsqd3oUVkD7k1y7cTOWy9TBQaE/v/kZo3LpzA3xPwwthrb0BvqIbOfIELi5fS5s8ba85WFRg3AX70wWE="
|
- secure: "jybGzAdUbqt9vWR/GEnRd96BgAi/7Zd1+2HK68j/i/8+/1YH2XxLOy4Jv/DUBhBlJIkxs/Xv8dRcUlFOclZDHX1d/9Qnsqd3oUVkD7k1y7cTOWy9TBQaE/v/kZo3LpzA3xPwwthrb0BvqIbOfIELi5fS5s8ba85WFRg3AX70wWE="
|
||||||
|
- macos_qt_formula=qt@5.5
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
|
@ -62,9 +63,9 @@ script:
|
||||||
- if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi
|
- if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi
|
||||||
- if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi
|
- if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi
|
||||||
notifications:
|
notifications:
|
||||||
|
email:
|
||||||
recipients:
|
recipients:
|
||||||
- corrmage+travis-ci@gmail.com
|
- corrmage+travis-ci@gmail.com
|
||||||
email:
|
|
||||||
on_success: change
|
on_success: change
|
||||||
on_failure: always
|
on_failure: always
|
||||||
irc:
|
irc:
|
||||||
|
|
|
@ -78,6 +78,7 @@ Programmers
|
||||||
Kurnevsky Evgeny (kurnevsky)
|
Kurnevsky Evgeny (kurnevsky)
|
||||||
Lars Söderberg (Lazaroth)
|
Lars Söderberg (Lazaroth)
|
||||||
lazydev
|
lazydev
|
||||||
|
Leon Krieg (lkrieg)
|
||||||
Leon Saunders (emoose)
|
Leon Saunders (emoose)
|
||||||
lohikaarme
|
lohikaarme
|
||||||
Lukasz Gromanowski (lgro)
|
Lukasz Gromanowski (lgro)
|
||||||
|
|
|
@ -5,7 +5,7 @@ brew update
|
||||||
brew rm cmake || true
|
brew rm cmake || true
|
||||||
brew rm pkgconfig || true
|
brew rm pkgconfig || true
|
||||||
brew rm qt5 || true
|
brew rm qt5 || true
|
||||||
brew install cmake pkgconfig qt55
|
brew install cmake pkgconfig $macos_qt_formula
|
||||||
|
|
||||||
curl http://downloads.openmw.org/osx/dependencies/openmw-deps-263d4a8.zip -o ~/openmw-deps.zip
|
curl http://downloads.openmw.org/osx/dependencies/openmw-deps-263d4a8.zip -o ~/openmw-deps.zip
|
||||||
unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null
|
unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null
|
||||||
|
|
|
@ -4,7 +4,7 @@ export CXX=clang++
|
||||||
export CC=clang
|
export CC=clang
|
||||||
|
|
||||||
DEPENDENCIES_ROOT="/private/tmp/openmw-deps/openmw-deps"
|
DEPENDENCIES_ROOT="/private/tmp/openmw-deps/openmw-deps"
|
||||||
QT_PATH="/usr/local/opt/qt55"
|
QT_PATH=`brew --prefix $macos_qt_formula`
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
|
|
@ -47,6 +47,34 @@ namespace ESSImport
|
||||||
controls.mVanityModeDisabled = pcdt.mPNAM.mPlayerFlags & PCDT::PlayerFlags_VanityModeDisabled;
|
controls.mVanityModeDisabled = pcdt.mPNAM.mPlayerFlags & PCDT::PlayerFlags_VanityModeDisabled;
|
||||||
controls.mWeaponDrawingDisabled = pcdt.mPNAM.mPlayerFlags & PCDT::PlayerFlags_WeaponDrawingDisabled;
|
controls.mWeaponDrawingDisabled = pcdt.mPNAM.mPlayerFlags & PCDT::PlayerFlags_WeaponDrawingDisabled;
|
||||||
controls.mSpellDrawingDisabled = pcdt.mPNAM.mPlayerFlags & PCDT::PlayerFlags_SpellDrawingDisabled;
|
controls.mSpellDrawingDisabled = pcdt.mPNAM.mPlayerFlags & PCDT::PlayerFlags_SpellDrawingDisabled;
|
||||||
|
|
||||||
|
if (pcdt.mHasMark)
|
||||||
|
{
|
||||||
|
out.mHasMark = 1;
|
||||||
|
|
||||||
|
const PCDT::PNAM::MarkLocation& mark = pcdt.mPNAM.mMarkLocation;
|
||||||
|
|
||||||
|
ESM::CellId cell;
|
||||||
|
cell.mWorldspace = ESM::CellId::sDefaultWorldspace;
|
||||||
|
cell.mPaged = true;
|
||||||
|
|
||||||
|
cell.mIndex.mX = mark.mCellX;
|
||||||
|
cell.mIndex.mY = mark.mCellY;
|
||||||
|
|
||||||
|
// TODO: Figure out a better way to detect interiors. (0, 0) is a valid exterior cell.
|
||||||
|
if (mark.mCellX == 0 && mark.mCellY == 0)
|
||||||
|
{
|
||||||
|
cell.mWorldspace = pcdt.mMNAM;
|
||||||
|
cell.mPaged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
out.mMarkedCell = cell;
|
||||||
|
out.mMarkedPosition.pos[0] = mark.mX;
|
||||||
|
out.mMarkedPosition.pos[1] = mark.mY;
|
||||||
|
out.mMarkedPosition.pos[2] = mark.mZ;
|
||||||
|
out.mMarkedPosition.rot[0] = out.mMarkedPosition.rot[1] = 0.0f;
|
||||||
|
out.mMarkedPosition.rot[2] = mark.mRotZ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace ESSImport
|
||||||
playerCellId.mIndex.mX = playerCellId.mIndex.mY = 0;
|
playerCellId.mIndex.mX = playerCellId.mIndex.mY = 0;
|
||||||
mPlayer.mCellId = playerCellId;
|
mPlayer.mCellId = playerCellId;
|
||||||
//mPlayer.mLastKnownExteriorPosition
|
//mPlayer.mLastKnownExteriorPosition
|
||||||
mPlayer.mHasMark = 0; // TODO
|
mPlayer.mHasMark = 0;
|
||||||
mPlayer.mCurrentCrimeId = 0; // TODO
|
mPlayer.mCurrentCrimeId = 0; // TODO
|
||||||
mPlayer.mObject.blank();
|
mPlayer.mObject.blank();
|
||||||
mPlayer.mObject.mRef.mRefID = "player"; // REFR.mRefID would be PlayerSaveGame
|
mPlayer.mObject.mRef.mRefID = "player"; // REFR.mRefID would be PlayerSaveGame
|
||||||
|
|
|
@ -23,9 +23,12 @@ namespace ESSImport
|
||||||
mKnownDialogueTopics.push_back(esm.getHString());
|
mKnownDialogueTopics.push_back(esm.getHString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mHasMark = false;
|
||||||
if (esm.isNextSub("MNAM"))
|
if (esm.isNextSub("MNAM"))
|
||||||
esm.skipHSub(); // If this field is here it seems to specify the interior cell the player is in,
|
{
|
||||||
// but it's not always here, so it's kinda useless
|
mHasMark = true;
|
||||||
|
mMNAM = esm.getHString();
|
||||||
|
}
|
||||||
|
|
||||||
esm.getHNT(mPNAM, "PNAM");
|
esm.getHNT(mPNAM, "PNAM");
|
||||||
|
|
||||||
|
@ -50,8 +53,12 @@ namespace ESSImport
|
||||||
if (esm.isNextSub("NAM3"))
|
if (esm.isNextSub("NAM3"))
|
||||||
esm.skipHSub();
|
esm.skipHSub();
|
||||||
|
|
||||||
|
mHasENAM = false;
|
||||||
if (esm.isNextSub("ENAM"))
|
if (esm.isNextSub("ENAM"))
|
||||||
esm.skipHSub();
|
{
|
||||||
|
mHasENAM = true;
|
||||||
|
esm.getHT(mENAM);
|
||||||
|
}
|
||||||
|
|
||||||
if (esm.isNextSub("LNAM"))
|
if (esm.isNextSub("LNAM"))
|
||||||
esm.skipHSub();
|
esm.skipHSub();
|
||||||
|
|
|
@ -42,8 +42,11 @@ struct PCDT
|
||||||
{
|
{
|
||||||
PlayerFlags_ViewSwitchDisabled = 0x1,
|
PlayerFlags_ViewSwitchDisabled = 0x1,
|
||||||
PlayerFlags_ControlsDisabled = 0x4,
|
PlayerFlags_ControlsDisabled = 0x4,
|
||||||
|
PlayerFlags_Sleeping = 0x10,
|
||||||
|
PlayerFlags_Waiting = 0x40,
|
||||||
PlayerFlags_WeaponDrawn = 0x80,
|
PlayerFlags_WeaponDrawn = 0x80,
|
||||||
PlayerFlags_SpellDrawn = 0x100,
|
PlayerFlags_SpellDrawn = 0x100,
|
||||||
|
PlayerFlags_InJail = 0x200,
|
||||||
PlayerFlags_JumpingDisabled = 0x1000,
|
PlayerFlags_JumpingDisabled = 0x1000,
|
||||||
PlayerFlags_LookingDisabled = 0x2000,
|
PlayerFlags_LookingDisabled = 0x2000,
|
||||||
PlayerFlags_VanityModeDisabled = 0x4000,
|
PlayerFlags_VanityModeDisabled = 0x4000,
|
||||||
|
@ -68,19 +71,44 @@ struct PCDT
|
||||||
|
|
||||||
struct PNAM
|
struct PNAM
|
||||||
{
|
{
|
||||||
|
struct MarkLocation
|
||||||
|
{
|
||||||
|
float mX, mY, mZ; // worldspace position
|
||||||
|
float mRotZ; // Z angle in radians
|
||||||
|
int mCellX, mCellY; // grid coordinates; for interior cells this is always (0, 0)
|
||||||
|
};
|
||||||
|
|
||||||
int mPlayerFlags; // controls, camera and draw state
|
int mPlayerFlags; // controls, camera and draw state
|
||||||
unsigned int mLevelProgress;
|
unsigned int mLevelProgress;
|
||||||
float mSkillProgress[27]; // skill progress, non-uniform scaled
|
float mSkillProgress[27]; // skill progress, non-uniform scaled
|
||||||
unsigned char mSkillIncreases[8]; // number of skill increases for each attribute
|
unsigned char mSkillIncreases[8]; // number of skill increases for each attribute
|
||||||
unsigned char mUnknown3[84];
|
int mTelekinesisRangeBonus; // in units; seems redundant
|
||||||
|
float mVisionBonus; // range: <0.0, 1.0>; affected by light spells and Get/Mod/SetPCVisionBonus
|
||||||
|
int mDetectKeyMagnitude; // seems redundant
|
||||||
|
int mDetectEnchantmentMagnitude; // seems redundant
|
||||||
|
int mDetectAnimalMagnitude; // seems redundant
|
||||||
|
MarkLocation mMarkLocation;
|
||||||
|
unsigned char mUnknown3[40];
|
||||||
unsigned char mSpecIncreases[3]; // number of skill increases for each specialization
|
unsigned char mSpecIncreases[3]; // number of skill increases for each specialization
|
||||||
unsigned char mUnknown4;
|
unsigned char mUnknown4;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ENAM
|
||||||
|
{
|
||||||
|
int mCellX;
|
||||||
|
int mCellY;
|
||||||
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
std::vector<FNAM> mFactions;
|
std::vector<FNAM> mFactions;
|
||||||
PNAM mPNAM;
|
PNAM mPNAM;
|
||||||
|
|
||||||
|
bool mHasMark;
|
||||||
|
std::string mMNAM; // mark cell name; can also be sDefaultCellname or region name
|
||||||
|
|
||||||
|
bool mHasENAM;
|
||||||
|
ENAM mENAM; // last exterior cell
|
||||||
|
|
||||||
void load(ESM::ESMReader& esm);
|
void load(ESM::ESMReader& esm);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -425,7 +425,7 @@ void CSMTools::ReferenceableCheckStage::creatureCheck (
|
||||||
|
|
||||||
//stats checks
|
//stats checks
|
||||||
if (creature.mData.mLevel < 1)
|
if (creature.mData.mLevel < 1)
|
||||||
messages.push_back (std::make_pair (id, creature.mId + " has non-postive level"));
|
messages.push_back (std::make_pair (id, creature.mId + " has non-positive level"));
|
||||||
|
|
||||||
if (creature.mData.mStrength < 0)
|
if (creature.mData.mStrength < 0)
|
||||||
messages.push_back (std::make_pair (id, creature.mId + " has negative strength"));
|
messages.push_back (std::make_pair (id, creature.mId + " has negative strength"));
|
||||||
|
|
|
@ -330,6 +330,8 @@ namespace CSMWorld
|
||||||
{ ColumnId_WeatherName, "Type" },
|
{ ColumnId_WeatherName, "Type" },
|
||||||
{ ColumnId_WeatherChance, "Percent Chance" },
|
{ ColumnId_WeatherChance, "Percent Chance" },
|
||||||
|
|
||||||
|
{ ColumnId_Text, "Text" },
|
||||||
|
|
||||||
{ ColumnId_UseValue1, "Use value 1" },
|
{ ColumnId_UseValue1, "Use value 1" },
|
||||||
{ ColumnId_UseValue2, "Use value 2" },
|
{ ColumnId_UseValue2, "Use value 2" },
|
||||||
{ ColumnId_UseValue3, "Use value 3" },
|
{ ColumnId_UseValue3, "Use value 3" },
|
||||||
|
|
|
@ -329,6 +329,8 @@ namespace CSMWorld
|
||||||
ColumnId_WeatherName = 295,
|
ColumnId_WeatherName = 295,
|
||||||
ColumnId_WeatherChance = 296,
|
ColumnId_WeatherChance = 296,
|
||||||
|
|
||||||
|
ColumnId_Text = 297,
|
||||||
|
|
||||||
// Allocated to a separate value range, so we don't get a collision should we ever need
|
// Allocated to a separate value range, so we don't get a collision should we ever need
|
||||||
// to extend the number of use values.
|
// to extend the number of use values.
|
||||||
ColumnId_UseValue1 = 0x10000,
|
ColumnId_UseValue1 = 0x10000,
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace CSMWorld
|
||||||
|
|
||||||
void setRecord (const std::string& id, const RecordBase& record,
|
void setRecord (const std::string& id, const RecordBase& record,
|
||||||
UniversalId::Type type = UniversalId::Type_None);
|
UniversalId::Type type = UniversalId::Type_None);
|
||||||
///< Add record or overwrite existing recrod.
|
///< Add record or overwrite existing record.
|
||||||
|
|
||||||
const RecordBase& getRecord (const std::string& id) const;
|
const RecordBase& getRecord (const std::string& id) const;
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
/*! \brief
|
/*! \brief
|
||||||
* Class for holding the model. Uses typical qt table abstraction/interface for granting access
|
* Class for holding the model. Uses typical qt table abstraction/interface for granting access
|
||||||
* to the individiual fields of the records, Some records are holding nested data (for instance
|
* to the individiual fields of the records, Some records are holding nested data (for instance
|
||||||
* inventory list of the npc). In casses like this, table model offers interface to access
|
* inventory list of the npc). In cases like this, table model offers interface to access
|
||||||
* nested data in the qt way - that is specify parent. Since some of those nested data require
|
* nested data in the qt way - that is specify parent. Since some of those nested data require
|
||||||
* multiple columns to represent informations, single int (default way to index model in the
|
* multiple columns to represent information, single int (default way to index model in the
|
||||||
* qmodelindex) is not sufficiant. Therefore tablemodelindex class can hold two ints for the
|
* qmodelindex) is not sufficiant. Therefore tablemodelindex class can hold two ints for the
|
||||||
* sake of indexing two dimensions of the table. This model does not support multiple levels of
|
* sake of indexing two dimensions of the table. This model does not support multiple levels of
|
||||||
* the nested data. Vast majority of methods makes sense only for the top level data.
|
* the nested data. Vast majority of methods makes sense only for the top level data.
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Adapters acts as indirection layer, abstracting details of the record types (in the wrappers) from the higher levels of model.
|
* Adapters acts as indirection layer, abstracting details of the record types (in the wrappers) from the higher levels of model.
|
||||||
* Please notice that nested adaptor uses helper classes for actually performing any actions. Different record types require different helpers (needs to be created in the subclass and then fetched via member function).
|
* Please notice that nested adaptor uses helper classes for actually performing any actions. Different record types require different helpers (needs to be created in the subclass and then fetched via member function).
|
||||||
*
|
*
|
||||||
* Important point: don't forget to make sure that getData on the nestedColumn returns true (otherwise code will not treat the index pointing to the column as having childs!
|
* Important point: don't forget to make sure that getData on the nestedColumn returns true (otherwise code will not treat the index pointing to the column as having children!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class QVariant;
|
class QVariant;
|
||||||
|
|
|
@ -301,9 +301,9 @@ void CSMWorld::ArmorRefIdAdapter::setData (const RefIdColumn *column, RefIdData&
|
||||||
}
|
}
|
||||||
|
|
||||||
CSMWorld::BookRefIdAdapter::BookRefIdAdapter (const EnchantableColumns& columns,
|
CSMWorld::BookRefIdAdapter::BookRefIdAdapter (const EnchantableColumns& columns,
|
||||||
const RefIdColumn *scroll, const RefIdColumn *skill)
|
const RefIdColumn *scroll, const RefIdColumn *skill, const RefIdColumn *text)
|
||||||
: EnchantableRefIdAdapter<ESM::Book> (UniversalId::Type_Book, columns),
|
: EnchantableRefIdAdapter<ESM::Book> (UniversalId::Type_Book, columns),
|
||||||
mScroll (scroll), mSkill (skill)
|
mScroll (scroll), mSkill (skill), mText (text)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QVariant CSMWorld::BookRefIdAdapter::getData (const RefIdColumn *column,
|
QVariant CSMWorld::BookRefIdAdapter::getData (const RefIdColumn *column,
|
||||||
|
@ -318,6 +318,9 @@ QVariant CSMWorld::BookRefIdAdapter::getData (const RefIdColumn *column,
|
||||||
if (column==mSkill)
|
if (column==mSkill)
|
||||||
return record.get().mData.mSkillID;
|
return record.get().mData.mSkillID;
|
||||||
|
|
||||||
|
if (column==mText)
|
||||||
|
return QString::fromUtf8 (record.get().mText.c_str());
|
||||||
|
|
||||||
return EnchantableRefIdAdapter<ESM::Book>::getData (column, data, index);
|
return EnchantableRefIdAdapter<ESM::Book>::getData (column, data, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,6 +336,8 @@ void CSMWorld::BookRefIdAdapter::setData (const RefIdColumn *column, RefIdData&
|
||||||
book.mData.mIsScroll = value.toInt();
|
book.mData.mIsScroll = value.toInt();
|
||||||
else if (column==mSkill)
|
else if (column==mSkill)
|
||||||
book.mData.mSkillID = value.toInt();
|
book.mData.mSkillID = value.toInt();
|
||||||
|
else if (column==mText)
|
||||||
|
book.mText = value.toString().toUtf8().data();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EnchantableRefIdAdapter<ESM::Book>::setData (column, data, index, value);
|
EnchantableRefIdAdapter<ESM::Book>::setData (column, data, index, value);
|
||||||
|
|
|
@ -696,11 +696,12 @@ namespace CSMWorld
|
||||||
{
|
{
|
||||||
const RefIdColumn *mScroll;
|
const RefIdColumn *mScroll;
|
||||||
const RefIdColumn *mSkill;
|
const RefIdColumn *mSkill;
|
||||||
|
const RefIdColumn *mText;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
BookRefIdAdapter (const EnchantableColumns& columns, const RefIdColumn *scroll,
|
BookRefIdAdapter (const EnchantableColumns& columns, const RefIdColumn *scroll,
|
||||||
const RefIdColumn *skill);
|
const RefIdColumn *skill, const RefIdColumn *text);
|
||||||
|
|
||||||
virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
|
virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
|
||||||
const;
|
const;
|
||||||
|
|
|
@ -297,6 +297,9 @@ CSMWorld::RefIdCollection::RefIdCollection()
|
||||||
mColumns.push_back (RefIdColumn (Columns::ColumnId_Attribute, ColumnBase::Display_Attribute));
|
mColumns.push_back (RefIdColumn (Columns::ColumnId_Attribute, ColumnBase::Display_Attribute));
|
||||||
const RefIdColumn *attribute = &mColumns.back();
|
const RefIdColumn *attribute = &mColumns.back();
|
||||||
|
|
||||||
|
mColumns.push_back (RefIdColumn (Columns::ColumnId_Text, ColumnBase::Display_LongString));
|
||||||
|
const RefIdColumn *text = &mColumns.back();
|
||||||
|
|
||||||
mColumns.push_back (RefIdColumn (Columns::ColumnId_ClothingType, ColumnBase::Display_ClothingType));
|
mColumns.push_back (RefIdColumn (Columns::ColumnId_ClothingType, ColumnBase::Display_ClothingType));
|
||||||
const RefIdColumn *clothingType = &mColumns.back();
|
const RefIdColumn *clothingType = &mColumns.back();
|
||||||
|
|
||||||
|
@ -656,7 +659,7 @@ CSMWorld::RefIdCollection::RefIdCollection()
|
||||||
mAdapters.insert (std::make_pair (UniversalId::Type_Armor,
|
mAdapters.insert (std::make_pair (UniversalId::Type_Armor,
|
||||||
new ArmorRefIdAdapter (enchantableColumns, armorType, health, armor, partRef)));
|
new ArmorRefIdAdapter (enchantableColumns, armorType, health, armor, partRef)));
|
||||||
mAdapters.insert (std::make_pair (UniversalId::Type_Book,
|
mAdapters.insert (std::make_pair (UniversalId::Type_Book,
|
||||||
new BookRefIdAdapter (enchantableColumns, scroll, attribute)));
|
new BookRefIdAdapter (enchantableColumns, scroll, attribute, text)));
|
||||||
mAdapters.insert (std::make_pair (UniversalId::Type_Clothing,
|
mAdapters.insert (std::make_pair (UniversalId::Type_Clothing,
|
||||||
new ClothingRefIdAdapter (enchantableColumns, clothingType, partRef)));
|
new ClothingRefIdAdapter (enchantableColumns, clothingType, partRef)));
|
||||||
mAdapters.insert (std::make_pair (UniversalId::Type_Container,
|
mAdapters.insert (std::make_pair (UniversalId::Type_Container,
|
||||||
|
|
|
@ -41,4 +41,4 @@
|
||||||
|
|
||||||
/// \namespace MWScript
|
/// \namespace MWScript
|
||||||
/// \ingroup openmw
|
/// \ingroup openmw
|
||||||
/// \brief MW-specific script extentions and integration of the script system into OpenMW
|
/// \brief MW-specific script extensions and integration of the script system into OpenMW
|
||||||
|
|
|
@ -231,7 +231,7 @@ namespace MWClass
|
||||||
if(lockLevel!=0)
|
if(lockLevel!=0)
|
||||||
ptr.getCellRef().setLockLevel(abs(lockLevel)); //Changes lock to locklevel, in positive
|
ptr.getCellRef().setLockLevel(abs(lockLevel)); //Changes lock to locklevel, in positive
|
||||||
else
|
else
|
||||||
ptr.getCellRef().setLockLevel(abs(ptr.getCellRef().getLockLevel())); //No locklevel given, just flip the origional one
|
ptr.getCellRef().setLockLevel(abs(ptr.getCellRef().getLockLevel())); //No locklevel given, just flip the original one
|
||||||
}
|
}
|
||||||
|
|
||||||
void Door::unlock (const MWWorld::Ptr& ptr) const
|
void Door::unlock (const MWWorld::Ptr& ptr) const
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace MWClass
|
||||||
|
|
||||||
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->mBase->mEffects);
|
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->mBase->mEffects);
|
||||||
|
|
||||||
// hide effects the player doesnt know about
|
// hide effects the player doesn't know about
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
for (unsigned int i=0; i<info.effects.size(); ++i)
|
for (unsigned int i=0; i<info.effects.size(); ++i)
|
||||||
info.effects[i].mKnown = MWMechanics::Alchemy::knownEffect(i, player);
|
info.effects[i].mKnown = MWMechanics::Alchemy::knownEffect(i, player);
|
||||||
|
|
|
@ -36,7 +36,6 @@ void DragAndDrop::startDrag (int index, SortFilterItemModel* sortModel, ItemMode
|
||||||
mSourceModel = sourceModel;
|
mSourceModel = sourceModel;
|
||||||
mSourceView = sourceView;
|
mSourceView = sourceView;
|
||||||
mSourceSortModel = sortModel;
|
mSourceSortModel = sortModel;
|
||||||
mIsOnDragAndDrop = true;
|
|
||||||
|
|
||||||
// If picking up an item that isn't from the player's inventory, the item gets added to player inventory backend
|
// If picking up an item that isn't from the player's inventory, the item gets added to player inventory backend
|
||||||
// immediately, even though it's still floating beneath the mouse cursor. A bit counterintuitive,
|
// immediately, even though it's still floating beneath the mouse cursor. A bit counterintuitive,
|
||||||
|
@ -88,6 +87,8 @@ void DragAndDrop::startDrag (int index, SortFilterItemModel* sortModel, ItemMode
|
||||||
sourceView->update();
|
sourceView->update();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->setDragDrop(true);
|
MWBase::Environment::get().getWindowManager()->setDragDrop(true);
|
||||||
|
|
||||||
|
mIsOnDragAndDrop = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DragAndDrop::drop(ItemModel *targetModel, ItemView *targetView)
|
void DragAndDrop::drop(ItemModel *targetModel, ItemView *targetView)
|
||||||
|
|
|
@ -1271,8 +1271,6 @@ namespace MWMechanics
|
||||||
stats.getActiveSpells().clear();
|
stats.getActiveSpells().clear();
|
||||||
calculateCreatureStatModifiers(iter->first, 0);
|
calculateCreatureStatModifiers(iter->first, 0);
|
||||||
|
|
||||||
MWBase::Environment::get().getWorld()->enableActorCollision(iter->first, false);
|
|
||||||
|
|
||||||
if (cls.isEssential(iter->first))
|
if (cls.isEssential(iter->first))
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sKilledEssential}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sKilledEssential}");
|
||||||
}
|
}
|
||||||
|
@ -1290,6 +1288,11 @@ namespace MWMechanics
|
||||||
//player's death animation is over
|
//player's death animation is over
|
||||||
MWBase::Environment::get().getStateManager()->askLoadRecent();
|
MWBase::Environment::get().getStateManager()->askLoadRecent();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// NPC death animation is over, disable actor collision
|
||||||
|
MWBase::Environment::get().getWorld()->enableActorCollision(iter->first, false);
|
||||||
|
}
|
||||||
|
|
||||||
// Play Death Music if it was the player dying
|
// Play Death Music if it was the player dying
|
||||||
if(iter->first == getPlayer())
|
if(iter->first == getPlayer())
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace MWMechanics
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
*
|
*
|
||||||
* Use the Observer Pattern to co-ordinate attacks, provide intelligence on
|
* Use the observer pattern to coordinate attacks, provide intelligence on
|
||||||
* whether the target was hit, etc.
|
* whether the target was hit, etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace MWMechanics
|
||||||
class AiPackage
|
class AiPackage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///Enumerates the various AITypes availible.
|
///Enumerates the various AITypes available
|
||||||
enum TypeId {
|
enum TypeId {
|
||||||
TypeIdNone = -1,
|
TypeIdNone = -1,
|
||||||
TypeIdWander = 0,
|
TypeIdWander = 0,
|
||||||
|
|
|
@ -336,7 +336,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
ESM::Pathgrid::Point dest(PathFinder::MakePathgridPoint(mReturnPosition));
|
ESM::Pathgrid::Point dest(PathFinder::MakePathgridPoint(mReturnPosition));
|
||||||
|
|
||||||
// actor position is already in world co-ordinates
|
// actor position is already in world coordinates
|
||||||
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
|
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
|
||||||
|
|
||||||
// don't take shortcuts for wandering
|
// don't take shortcuts for wandering
|
||||||
|
@ -473,8 +473,8 @@ namespace MWMechanics
|
||||||
void AiWander::onWalkingStatePerFrameActions(const MWWorld::Ptr& actor,
|
void AiWander::onWalkingStatePerFrameActions(const MWWorld::Ptr& actor,
|
||||||
float duration, AiWanderStorage& storage, ESM::Position& pos)
|
float duration, AiWanderStorage& storage, ESM::Position& pos)
|
||||||
{
|
{
|
||||||
// Are we there yet?
|
// Is there no destination or are we there yet?
|
||||||
if (pathTo(actor, mPathFinder.getPath().back(), duration, DESTINATION_TOLERANCE))
|
if ((!mPathFinder.isPathConstructed()) || pathTo(actor, mPathFinder.getPath().back(), duration, DESTINATION_TOLERANCE))
|
||||||
{
|
{
|
||||||
stopWalking(actor, storage);
|
stopWalking(actor, storage);
|
||||||
storage.setState(Wander_ChooseAction);
|
storage.setState(Wander_ChooseAction);
|
||||||
|
@ -649,7 +649,7 @@ namespace MWMechanics
|
||||||
ESM::Pathgrid::Point dest(storage.mAllowedNodes[randNode]);
|
ESM::Pathgrid::Point dest(storage.mAllowedNodes[randNode]);
|
||||||
ToWorldCoordinates(dest, storage.mCell->getCell());
|
ToWorldCoordinates(dest, storage.mCell->getCell());
|
||||||
|
|
||||||
// actor position is already in world co-ordinates
|
// actor position is already in world coordinates
|
||||||
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(actorPos));
|
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(actorPos));
|
||||||
|
|
||||||
// don't take shortcuts for wandering
|
// don't take shortcuts for wandering
|
||||||
|
@ -693,8 +693,8 @@ namespace MWMechanics
|
||||||
ESM::Pathgrid::Point pt = paths.back();
|
ESM::Pathgrid::Point pt = paths.back();
|
||||||
for(unsigned int j = 0; j < nodes.size(); j++)
|
for(unsigned int j = 0; j < nodes.size(); j++)
|
||||||
{
|
{
|
||||||
// FIXME: doesn't hadle a door with the same X/Y
|
// FIXME: doesn't handle a door with the same X/Y
|
||||||
// co-ordinates but with a different Z
|
// coordinates but with a different Z
|
||||||
if(nodes[j].mX == pt.mX && nodes[j].mY == pt.mY)
|
if(nodes[j].mX == pt.mX && nodes[j].mY == pt.mY)
|
||||||
{
|
{
|
||||||
nodes.erase(nodes.begin() + j);
|
nodes.erase(nodes.begin() + j);
|
||||||
|
@ -828,7 +828,7 @@ namespace MWMechanics
|
||||||
// ... pathgrids don't usually include water, so swimmers ignore them
|
// ... pathgrids don't usually include water, so swimmers ignore them
|
||||||
if (mDistance && storage.mCanWanderAlongPathGrid && !actor.getClass().isPureWaterCreature(actor))
|
if (mDistance && storage.mCanWanderAlongPathGrid && !actor.getClass().isPureWaterCreature(actor))
|
||||||
{
|
{
|
||||||
// get NPC's position in local (i.e. cell) co-ordinates
|
// get NPC's position in local (i.e. cell) coordinates
|
||||||
osg::Vec3f npcPos(mInitialActorPosition);
|
osg::Vec3f npcPos(mInitialActorPosition);
|
||||||
CoordinateConverter(cell).toLocal(npcPos);
|
CoordinateConverter(cell).toLocal(npcPos);
|
||||||
|
|
||||||
|
@ -837,7 +837,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
// mAllowedNodes for this actor with pathgrid point indexes based on mDistance
|
// mAllowedNodes for this actor with pathgrid point indexes based on mDistance
|
||||||
// and if the point is connected to the closest current point
|
// and if the point is connected to the closest current point
|
||||||
// NOTE: mPoints and mAllowedNodes are in local co-ordinates
|
// NOTE: mPoints and mAllowedNodes are in local coordinates
|
||||||
int pointIndex = 0;
|
int pointIndex = 0;
|
||||||
for(unsigned int counter = 0; counter < pathgrid->mPoints.size(); counter++)
|
for(unsigned int counter = 0; counter < pathgrid->mPoints.size(); counter++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace MWMechanics
|
||||||
GroupIndex_MaxIdle = 9
|
GroupIndex_MaxIdle = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
/// convert point from local (i.e. cell) to world co-ordinates
|
/// convert point from local (i.e. cell) to world coordinates
|
||||||
void ToWorldCoordinates(ESM::Pathgrid::Point& point, const ESM::Cell * cell);
|
void ToWorldCoordinates(ESM::Pathgrid::Point& point, const ESM::Cell * cell);
|
||||||
|
|
||||||
void SetCurrentNodeToClosestAllowedNode(osg::Vec3f npcPos, AiWanderStorage& storage);
|
void SetCurrentNodeToClosestAllowedNode(osg::Vec3f npcPos, AiWanderStorage& storage);
|
||||||
|
|
|
@ -139,7 +139,7 @@ namespace MWMechanics
|
||||||
* NOTE: It may be desirable to simply go directly to the endPoint if for
|
* NOTE: It may be desirable to simply go directly to the endPoint if for
|
||||||
* example there are no pathgrids in this cell.
|
* example there are no pathgrids in this cell.
|
||||||
*
|
*
|
||||||
* NOTE: startPoint & endPoint are in world co-ordinates
|
* NOTE: startPoint & endPoint are in world coordinates
|
||||||
*
|
*
|
||||||
* Updates mPath using aStarSearch() or ray test (if shortcut allowed).
|
* Updates mPath using aStarSearch() or ray test (if shortcut allowed).
|
||||||
* mPath consists of pathgrid points, except the last element which is
|
* mPath consists of pathgrid points, except the last element which is
|
||||||
|
@ -148,7 +148,7 @@ namespace MWMechanics
|
||||||
* pathgrid point (e.g. wander) then it may be worth while to call
|
* pathgrid point (e.g. wander) then it may be worth while to call
|
||||||
* pop_back() to remove the redundant entry.
|
* pop_back() to remove the redundant entry.
|
||||||
*
|
*
|
||||||
* NOTE: co-ordinates must be converted prior to calling GetClosestPoint()
|
* NOTE: coordinates must be converted prior to calling GetClosestPoint()
|
||||||
*
|
*
|
||||||
* |
|
* |
|
||||||
* | cell
|
* | cell
|
||||||
|
@ -164,8 +164,8 @@ namespace MWMechanics
|
||||||
* +-----------------------------
|
* +-----------------------------
|
||||||
*
|
*
|
||||||
* i = x value of cell itself (multiply by ESM::Land::REAL_SIZE to convert)
|
* i = x value of cell itself (multiply by ESM::Land::REAL_SIZE to convert)
|
||||||
* j = @.x in local co-ordinates (i.e. within the cell)
|
* j = @.x in local coordinates (i.e. within the cell)
|
||||||
* k = @.x in world co-ordinates
|
* k = @.x in world coordinates
|
||||||
*/
|
*/
|
||||||
void PathFinder::buildPath(const ESM::Pathgrid::Point &startPoint,
|
void PathFinder::buildPath(const ESM::Pathgrid::Point &startPoint,
|
||||||
const ESM::Pathgrid::Point &endPoint,
|
const ESM::Pathgrid::Point &endPoint,
|
||||||
|
@ -188,7 +188,7 @@ namespace MWMechanics
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: GetClosestPoint expects local co-ordinates
|
// NOTE: GetClosestPoint expects local coordinates
|
||||||
CoordinateConverter converter(mCell->getCell());
|
CoordinateConverter converter(mCell->getCell());
|
||||||
|
|
||||||
// NOTE: It is possible that GetClosestPoint returns a pathgrind point index
|
// NOTE: It is possible that GetClosestPoint returns a pathgrind point index
|
||||||
|
@ -230,7 +230,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
mPath = mCell->aStarSearch(startNode, endNode.first);
|
mPath = mCell->aStarSearch(startNode, endNode.first);
|
||||||
|
|
||||||
// convert supplied path to world co-ordinates
|
// convert supplied path to world coordinates
|
||||||
for (std::list<ESM::Pathgrid::Point>::iterator iter(mPath.begin()); iter != mPath.end(); ++iter)
|
for (std::list<ESM::Pathgrid::Point>::iterator iter(mPath.begin()); iter != mPath.end(); ++iter)
|
||||||
{
|
{
|
||||||
converter.toWorld(*iter);
|
converter.toWorld(*iter);
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace MWMechanics
|
||||||
/** Synchronize new path with old one to avoid visiting 1 waypoint 2 times
|
/** Synchronize new path with old one to avoid visiting 1 waypoint 2 times
|
||||||
@note
|
@note
|
||||||
BuildPath() takes closest PathGrid point to NPC as first point of path.
|
BuildPath() takes closest PathGrid point to NPC as first point of path.
|
||||||
This is undesireable if NPC has just passed a Pathgrid point, as this
|
This is undesirable if NPC has just passed a Pathgrid point, as this
|
||||||
makes the 2nd point of the new path == the 1st point of old path.
|
makes the 2nd point of the new path == the 1st point of old path.
|
||||||
Which results in NPC "running in a circle" back to the just passed waypoint.
|
Which results in NPC "running in a circle" back to the just passed waypoint.
|
||||||
*/
|
*/
|
||||||
|
@ -122,11 +122,11 @@ namespace MWMechanics
|
||||||
return (MWMechanics::PathFinder::MakeOsgVec3(point) - pos).length2();
|
return (MWMechanics::PathFinder::MakeOsgVec3(point) - pos).length2();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the closest pathgrid point index from the specified position co
|
// Return the closest pathgrid point index from the specified position
|
||||||
// -ordinates. NOTE: Does not check if there is a sensible way to get there
|
// coordinates. NOTE: Does not check if there is a sensible way to get there
|
||||||
// (e.g. a cliff in front).
|
// (e.g. a cliff in front).
|
||||||
//
|
//
|
||||||
// NOTE: pos is expected to be in local co-ordinates, as is grid->mPoints
|
// NOTE: pos is expected to be in local coordinates, as is grid->mPoints
|
||||||
//
|
//
|
||||||
static int GetClosestPoint(const ESM::Pathgrid* grid, const osg::Vec3f& pos)
|
static int GetClosestPoint(const ESM::Pathgrid* grid, const osg::Vec3f& pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,7 +225,7 @@ namespace MWMechanics
|
||||||
* Should be possible to make this MT safe.
|
* Should be possible to make this MT safe.
|
||||||
*
|
*
|
||||||
* Returns path which may be empty. path contains pathgrid points in local
|
* Returns path which may be empty. path contains pathgrid points in local
|
||||||
* cell co-ordinates (indoors) or world co-ordinates (external).
|
* cell coordinates (indoors) or world coordinates (external).
|
||||||
*
|
*
|
||||||
* Input params:
|
* Input params:
|
||||||
* start, goal - pathgrid point indexes (for this cell)
|
* start, goal - pathgrid point indexes (for this cell)
|
||||||
|
@ -239,7 +239,7 @@ namespace MWMechanics
|
||||||
* TODO: An intersting exercise might be to cache the paths created for a
|
* TODO: An intersting exercise might be to cache the paths created for a
|
||||||
* start/goal pair. To cache the results the paths need to be in
|
* start/goal pair. To cache the results the paths need to be in
|
||||||
* pathgrid points form (currently they are converted to world
|
* pathgrid points form (currently they are converted to world
|
||||||
* co-ordinates). Essentially trading speed w/ memory.
|
* coordinates). Essentially trading speed w/ memory.
|
||||||
*/
|
*/
|
||||||
std::list<ESM::Pathgrid::Point> PathgridGraph::aStarSearch(const int start,
|
std::list<ESM::Pathgrid::Point> PathgridGraph::aStarSearch(const int start,
|
||||||
const int goal) const
|
const int goal) const
|
||||||
|
@ -312,7 +312,7 @@ namespace MWMechanics
|
||||||
if(current != goal)
|
if(current != goal)
|
||||||
return path; // for some reason couldn't build a path
|
return path; // for some reason couldn't build a path
|
||||||
|
|
||||||
// reconstruct path to return, using local co-ordinates
|
// reconstruct path to return, using local coordinates
|
||||||
while(graphParent[current] != -1)
|
while(graphParent[current] != -1)
|
||||||
{
|
{
|
||||||
path.push_front(mPathgrid->mPoints[current]);
|
path.push_front(mPathgrid->mPoints[current]);
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
// the input parameters are pathgrid point indexes
|
// the input parameters are pathgrid point indexes
|
||||||
// the output list is in local (internal cells) or world (external
|
// the output list is in local (internal cells) or world (external
|
||||||
// cells) co-ordinates
|
// cells) coordinates
|
||||||
//
|
//
|
||||||
// NOTE: if start equals end an empty path is returned
|
// NOTE: if start equals end an empty path is returned
|
||||||
std::list<ESM::Pathgrid::Point> aStarSearch(const int start,
|
std::list<ESM::Pathgrid::Point> aStarSearch(const int start,
|
||||||
|
|
|
@ -47,7 +47,7 @@ Actor::Actor(const MWWorld::Ptr& ptr, osg::ref_ptr<const Resource::BulletShape>
|
||||||
updateScale();
|
updateScale();
|
||||||
updatePosition();
|
updatePosition();
|
||||||
|
|
||||||
updateCollisionMask();
|
addCollisionMask(getCollisionMask());
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor::~Actor()
|
Actor::~Actor()
|
||||||
|
@ -70,15 +70,26 @@ void Actor::enableCollisionBody(bool collision)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Actor::addCollisionMask(int collisionMask)
|
||||||
|
{
|
||||||
|
mCollisionWorld->addCollisionObject(mCollisionObject.get(), CollisionType_Actor, collisionMask);
|
||||||
|
}
|
||||||
|
|
||||||
void Actor::updateCollisionMask()
|
void Actor::updateCollisionMask()
|
||||||
{
|
{
|
||||||
mCollisionWorld->removeCollisionObject(mCollisionObject.get());
|
mCollisionWorld->removeCollisionObject(mCollisionObject.get());
|
||||||
|
addCollisionMask(getCollisionMask());
|
||||||
|
}
|
||||||
|
|
||||||
|
int Actor::getCollisionMask()
|
||||||
|
{
|
||||||
int collisionMask = CollisionType_World | CollisionType_HeightMap;
|
int collisionMask = CollisionType_World | CollisionType_HeightMap;
|
||||||
if (mExternalCollisionMode)
|
if (mExternalCollisionMode)
|
||||||
collisionMask |= CollisionType_Actor | CollisionType_Projectile | CollisionType_Door;
|
collisionMask |= CollisionType_Actor | CollisionType_Projectile | CollisionType_Door;
|
||||||
if (mCanWaterWalk)
|
if (mCanWaterWalk)
|
||||||
collisionMask |= CollisionType_Water;
|
collisionMask |= CollisionType_Water;
|
||||||
mCollisionWorld->addCollisionObject(mCollisionObject.get(), CollisionType_Actor, collisionMask);
|
return collisionMask;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::updatePosition()
|
void Actor::updatePosition()
|
||||||
|
|
|
@ -139,6 +139,8 @@ namespace MWPhysics
|
||||||
private:
|
private:
|
||||||
/// Removes then re-adds the collision object to the dynamics world
|
/// Removes then re-adds the collision object to the dynamics world
|
||||||
void updateCollisionMask();
|
void updateCollisionMask();
|
||||||
|
void addCollisionMask(int collisionMask);
|
||||||
|
int getCollisionMask();
|
||||||
|
|
||||||
bool mCanWaterWalk;
|
bool mCanWaterWalk;
|
||||||
bool mWalkingOnWater;
|
bool mWalkingOnWater;
|
||||||
|
|
|
@ -1350,6 +1350,7 @@ namespace MWPhysics
|
||||||
{
|
{
|
||||||
const osg::Vec3f actorPosition = physicActor->getPosition();
|
const osg::Vec3f actorPosition = physicActor->getPosition();
|
||||||
physicActor->setPosition(osg::Vec3f(actorPosition.x(), actorPosition.y(), waterlevel));
|
physicActor->setPosition(osg::Vec3f(actorPosition.x(), actorPosition.y(), waterlevel));
|
||||||
|
waterCollision = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
physicActor->setCanWaterWalk(waterCollision);
|
physicActor->setCanWaterWalk(waterCollision);
|
||||||
|
@ -1467,7 +1468,10 @@ namespace MWPhysics
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mWaterEnabled)
|
if (!mWaterEnabled)
|
||||||
|
{
|
||||||
|
mWaterCollisionObject.reset();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mWaterCollisionObject.reset(new btCollisionObject());
|
mWaterCollisionObject.reset(new btCollisionObject());
|
||||||
mWaterCollisionShape.reset(new btStaticPlaneShape(btVector3(0,0,1), mWaterHeight));
|
mWaterCollisionShape.reset(new btStaticPlaneShape(btVector3(0,0,1), mWaterHeight));
|
||||||
|
|
|
@ -200,7 +200,7 @@ namespace MWPhysics
|
||||||
typedef std::map<MWWorld::Ptr, MWWorld::Ptr> CollisionMap;
|
typedef std::map<MWWorld::Ptr, MWWorld::Ptr> CollisionMap;
|
||||||
CollisionMap mStandingCollisions;
|
CollisionMap mStandingCollisions;
|
||||||
|
|
||||||
// replaces all occurences of 'old' in the map by 'updated', no matter if its a key or value
|
// replaces all occurrences of 'old' in the map by 'updated', no matter if it's a key or value
|
||||||
void updateCollisionMapPtr(CollisionMap& map, const MWWorld::Ptr &old, const MWWorld::Ptr &updated);
|
void updateCollisionMapPtr(CollisionMap& map, const MWWorld::Ptr &old, const MWWorld::Ptr &updated);
|
||||||
|
|
||||||
PtrVelocityList mMovementQueue;
|
PtrVelocityList mMovementQueue;
|
||||||
|
|
|
@ -110,8 +110,6 @@ void CreatureWeaponAnimation::updatePart(PartHolderPtr& scene, int slot)
|
||||||
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->getInstance(item.getClass().getModel(item));
|
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->getInstance(item.getClass().getModel(item));
|
||||||
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(node, mObjectRoot, bonename, bonename);
|
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(node, mObjectRoot, bonename, bonename);
|
||||||
mResourceSystem->getSceneManager()->notifyAttached(attached);
|
mResourceSystem->getSceneManager()->notifyAttached(attached);
|
||||||
if (mSkeleton)
|
|
||||||
mSkeleton->markDirty();
|
|
||||||
|
|
||||||
scene.reset(new PartHolder(attached));
|
scene.reset(new PartHolder(attached));
|
||||||
|
|
||||||
|
|
|
@ -671,8 +671,6 @@ PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, const st
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Node> instance = mResourceSystem->getSceneManager()->getInstance(model);
|
osg::ref_ptr<osg::Node> instance = mResourceSystem->getSceneManager()->getInstance(model);
|
||||||
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, bonename);
|
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, bonename);
|
||||||
if (mSkeleton)
|
|
||||||
mSkeleton->markDirty();
|
|
||||||
mResourceSystem->getSceneManager()->notifyAttached(attached);
|
mResourceSystem->getSceneManager()->notifyAttached(attached);
|
||||||
if (enchantedGlow)
|
if (enchantedGlow)
|
||||||
addGlow(attached, *glowColor);
|
addGlow(attached, *glowColor);
|
||||||
|
|
|
@ -211,7 +211,7 @@ namespace MWRender
|
||||||
|
|
||||||
osg::Vec3f mStormDirection;
|
osg::Vec3f mStormDirection;
|
||||||
|
|
||||||
// remember some settings so we don't have to apply them again if they didnt change
|
// remember some settings so we don't have to apply them again if they didn't change
|
||||||
std::string mClouds;
|
std::string mClouds;
|
||||||
std::string mNextClouds;
|
std::string mNextClouds;
|
||||||
float mCloudBlendFactor;
|
float mCloudBlendFactor;
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace MWScript
|
||||||
|
|
||||||
enum Type
|
enum Type
|
||||||
{
|
{
|
||||||
Type_Full, // global, local, targetted
|
Type_Full, // global, local, targeted
|
||||||
Type_Dialogue,
|
Type_Dialogue,
|
||||||
Type_Console
|
Type_Console
|
||||||
};
|
};
|
||||||
|
|
|
@ -1159,10 +1159,11 @@ namespace NifOsg
|
||||||
morphGeom->setUpdateCallback(NULL);
|
morphGeom->setUpdateCallback(NULL);
|
||||||
morphGeom->setCullCallback(new UpdateMorphGeometry);
|
morphGeom->setCullCallback(new UpdateMorphGeometry);
|
||||||
morphGeom->setUseVertexBufferObjects(true);
|
morphGeom->setUseVertexBufferObjects(true);
|
||||||
morphGeom->getOrCreateVertexBufferObject()->setUsage(GL_DYNAMIC_DRAW_ARB);
|
|
||||||
|
|
||||||
triShapeToGeometry(triShape, morphGeom, parentNode, composite, boundTextures, animflags);
|
triShapeToGeometry(triShape, morphGeom, parentNode, composite, boundTextures, animflags);
|
||||||
|
|
||||||
|
morphGeom->getOrCreateVertexBufferObject()->setUsage(GL_DYNAMIC_DRAW_ARB);
|
||||||
|
|
||||||
const std::vector<Nif::NiMorphData::MorphData>& morphs = morpher->data.getPtr()->mMorphs;
|
const std::vector<Nif::NiMorphData::MorphData>& morphs = morpher->data.getPtr()->mMorphs;
|
||||||
if (morphs.empty())
|
if (morphs.empty())
|
||||||
return morphGeom;
|
return morphGeom;
|
||||||
|
|
|
@ -120,12 +120,16 @@ void RigGeometry::setSourceGeometry(osg::ref_ptr<osg::Geometry> sourceGeometry)
|
||||||
setVertexArray(vertexArray);
|
setVertexArray(vertexArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::ref_ptr<osg::Array> normalArray = osg::clone(from.getNormalArray(), osg::CopyOp::DEEP_COPY_ALL);
|
if (osg::Array* normals = from.getNormalArray())
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Array> normalArray = osg::clone(normals, osg::CopyOp::DEEP_COPY_ALL);
|
||||||
if (normalArray)
|
if (normalArray)
|
||||||
{
|
{
|
||||||
normalArray->setVertexBufferObject(vbo);
|
normalArray->setVertexBufferObject(vbo);
|
||||||
setNormalArray(normalArray, osg::Array::BIND_PER_VERTEX);
|
setNormalArray(normalArray, osg::Array::BIND_PER_VERTEX);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (osg::Vec4Array* tangents = dynamic_cast<osg::Vec4Array*>(from.getTexCoordArray(7)))
|
if (osg::Vec4Array* tangents = dynamic_cast<osg::Vec4Array*>(from.getTexCoordArray(7)))
|
||||||
{
|
{
|
||||||
|
@ -273,6 +277,7 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
||||||
{
|
{
|
||||||
unsigned short vertex = *vertexIt;
|
unsigned short vertex = *vertexIt;
|
||||||
(*positionDst)[vertex] = resultMat.preMult((*positionSrc)[vertex]);
|
(*positionDst)[vertex] = resultMat.preMult((*positionSrc)[vertex]);
|
||||||
|
if (normalDst)
|
||||||
(*normalDst)[vertex] = osg::Matrix::transform3x3((*normalSrc)[vertex], resultMat);
|
(*normalDst)[vertex] = osg::Matrix::transform3x3((*normalSrc)[vertex], resultMat);
|
||||||
if (tangentDst)
|
if (tangentDst)
|
||||||
{
|
{
|
||||||
|
@ -284,6 +289,7 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
||||||
}
|
}
|
||||||
|
|
||||||
positionDst->dirty();
|
positionDst->dirty();
|
||||||
|
if (normalDst)
|
||||||
normalDst->dirty();
|
normalDst->dirty();
|
||||||
if (tangentDst)
|
if (tangentDst)
|
||||||
tangentDst->dirty();
|
tangentDst->dirty();
|
||||||
|
@ -314,12 +320,15 @@ void RigGeometry::updateBounds(osg::NodeVisitor *nv)
|
||||||
box.expandBy(bs);
|
box.expandBy(bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (box != _boundingBox)
|
||||||
|
{
|
||||||
_boundingBox = box;
|
_boundingBox = box;
|
||||||
_boundingSphere = osg::BoundingSphere(_boundingBox);
|
_boundingSphere = osg::BoundingSphere(_boundingBox);
|
||||||
_boundingSphereComputed = true;
|
_boundingSphereComputed = true;
|
||||||
for (unsigned int i=0; i<getNumParents(); ++i)
|
for (unsigned int i=0; i<getNumParents(); ++i)
|
||||||
getParent(i)->dirtyBound();
|
getParent(i)->dirtyBound();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RigGeometry::updateGeomToSkelMatrix(const osg::NodePath& nodePath)
|
void RigGeometry::updateGeomToSkelMatrix(const osg::NodePath& nodePath)
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,6 +148,8 @@ void Skeleton::markDirty()
|
||||||
{
|
{
|
||||||
mTraversedEvenFrame = false;
|
mTraversedEvenFrame = false;
|
||||||
mTraversedOddFrame = false;
|
mTraversedOddFrame = false;
|
||||||
|
mBoneCache.clear();
|
||||||
|
mBoneCacheInit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skeleton::traverse(osg::NodeVisitor& nv)
|
void Skeleton::traverse(osg::NodeVisitor& nv)
|
||||||
|
@ -160,6 +162,16 @@ void Skeleton::traverse(osg::NodeVisitor& nv)
|
||||||
osg::Group::traverse(nv);
|
osg::Group::traverse(nv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Skeleton::childInserted(unsigned int)
|
||||||
|
{
|
||||||
|
markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Skeleton::childRemoved(unsigned int, unsigned int)
|
||||||
|
{
|
||||||
|
markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
Bone::Bone()
|
Bone::Bone()
|
||||||
: mNode(NULL)
|
: mNode(NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,10 +53,12 @@ namespace SceneUtil
|
||||||
|
|
||||||
bool getActive() const;
|
bool getActive() const;
|
||||||
|
|
||||||
/// If a new RigGeometry is added after the Skeleton has already been rendered, you must call markDirty().
|
void traverse(osg::NodeVisitor& nv);
|
||||||
|
|
||||||
void markDirty();
|
void markDirty();
|
||||||
|
|
||||||
void traverse(osg::NodeVisitor& nv);
|
virtual void childInserted(unsigned int);
|
||||||
|
virtual void childRemoved(unsigned int, unsigned int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The root bone is not a "real" bone, it has no corresponding node in the scene graph.
|
// The root bone is not a "real" bone, it has no corresponding node in the scene graph.
|
||||||
|
|
|
@ -102,10 +102,17 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
|
||||||
if (evt.key.keysym.sym == SDLK_F3)
|
if (evt.key.keysym.sym == SDLK_F3)
|
||||||
mViewer->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_F3);
|
mViewer->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_F3);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case SDL_TEXTEDITING:
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
mKeyboardListener->textInput(evt.text);
|
mKeyboardListener->textInput(evt.text);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 4)
|
||||||
|
case SDL_KEYMAPCHANGED:
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case SDL_JOYHATMOTION: //As we manage everything with GameController, don't even bother with these.
|
case SDL_JOYHATMOTION: //As we manage everything with GameController, don't even bother with these.
|
||||||
case SDL_JOYAXISMOTION:
|
case SDL_JOYAXISMOTION:
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
#include <SDL_events.h>
|
#include <SDL_events.h>
|
||||||
|
#include <SDL_version.h>
|
||||||
|
|
||||||
#include "OISCompat.hpp"
|
#include "OISCompat.hpp"
|
||||||
#include "events.hpp"
|
#include "events.hpp"
|
||||||
|
|
|
@ -188,13 +188,13 @@ clamp lighting = true
|
||||||
|
|
||||||
# If this option is enabled, normal maps are automatically recognized and used if they are named appropriately
|
# If this option is enabled, normal maps are automatically recognized and used if they are named appropriately
|
||||||
# (see 'normal map pattern', e.g. for a base texture foo.dds, the normal map texture would have to be named foo_n.dds).
|
# (see 'normal map pattern', e.g. for a base texture foo.dds, the normal map texture would have to be named foo_n.dds).
|
||||||
# If this option is disabled, normal maps are only used if they are explicitely listed within the mesh file (.nif or .osg file).
|
# If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.nif or .osg file).
|
||||||
# Affects objects.
|
# Affects objects.
|
||||||
auto use object normal maps = false
|
auto use object normal maps = false
|
||||||
|
|
||||||
# If this option is enabled, specular maps are automatically recognized and used if they are named appropriately
|
# If this option is enabled, specular maps are automatically recognized and used if they are named appropriately
|
||||||
# (see 'specular map pattern', e.g. for a base texture foo.dds, the specular map texture would have to be named foo_spec.dds).
|
# (see 'specular map pattern', e.g. for a base texture foo.dds, the specular map texture would have to be named foo_spec.dds).
|
||||||
# If this option is disabled, normal maps are only used if they are explicitely listed within the mesh file (.osg file, not supported in .nif files).
|
# If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.osg file, not supported in .nif files).
|
||||||
# Affects objects.
|
# Affects objects.
|
||||||
auto use object specular maps = false
|
auto use object specular maps = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue