Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/openmw-35' into HEAD
Browse files Browse the repository at this point in the history
Conflicts:
	apps/openmw/mwmechanics/npcstats.cpp
  • Loading branch information
scrawl committed Feb 8, 2015
2 parents c8a9241 + 9dbd9af commit e81d2a9
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 59 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters
if (NOT WIN32 AND NOT APPLE)
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.desktop
"${OpenMW_BINARY_DIR}/openmw.desktop")
configure_file(${OpenMW_SOURCE_DIR}/files/openmw-mimeinfo.xml
"${OpenMW_BINARY_DIR}/openmw-mimeinfo.xml")
configure_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.desktop
"${OpenMW_BINARY_DIR}/openmw-cs.desktop")
endif()
Expand Down Expand Up @@ -441,7 +439,6 @@ IF(NOT WIN32 AND NOT APPLE)

# 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-mimeinfo.xml" DESTINATION "${DATAROOTDIR}/mime/packages" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 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")
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")
Expand Down Expand Up @@ -761,7 +758,7 @@ if (APPLE)

set(OPENMW_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")

set(OPENCS_BUNDLE_NAME "OpenCS.app")
set(OPENCS_BUNDLE_NAME "OpenMW-CS.app")
set(OPENCS_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${OPENCS_BUNDLE_NAME}")

set(ABSOLUTE_PLUGINS "")
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ target_link_libraries(openmw-cs
)

if(APPLE)
INSTALL(TARGETS openmw-cs BUNDLE DESTINATION OpenMW-CS COMPONENT BUNDLE)
INSTALL(TARGETS openmw-cs BUNDLE DESTINATION OpenMW COMPONENT BUNDLE)
endif()
32 changes: 16 additions & 16 deletions apps/openmw/mwmechanics/npcstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ bool MWMechanics::NpcStats::isInFaction (const std::string& faction) const
return (mFactionRank.find(Misc::StringUtils::lowerCase(faction)) != mFactionRank.end());
}

int MWMechanics::NpcStats::getFactionReputation (const std::string& faction) const
{
std::map<std::string, int>::const_iterator iter = mFactionReputation.find (Misc::StringUtils::lowerCase(faction));

if (iter==mFactionReputation.end())
return 0;

return iter->second;
}

void MWMechanics::NpcStats::setFactionReputation (const std::string& faction, int value)
{
mFactionReputation[Misc::StringUtils::lowerCase(faction)] = value;
}

float MWMechanics::NpcStats::getSkillProgressRequirement (int skillIndex, const ESM::Class& class_) const
{
float progressRequirement = 1 + getSkill (skillIndex).getBase();
Expand Down Expand Up @@ -327,21 +342,6 @@ void MWMechanics::NpcStats::setBounty (int bounty)
mBounty = bounty;
}

int MWMechanics::NpcStats::getFactionReputation (const std::string& faction) const
{
std::map<std::string, int>::const_iterator iter = mFactionReputation.find (faction);

if (iter==mFactionReputation.end())
return 0;

return iter->second;
}

void MWMechanics::NpcStats::setFactionReputation (const std::string& faction, int value)
{
mFactionReputation[faction] = value;
}

int MWMechanics::NpcStats::getReputation() const
{
return mReputation;
Expand Down Expand Up @@ -513,7 +513,7 @@ void MWMechanics::NpcStats::readState (const ESM::NpcStats& state)
mFactionRank[iter->first] = iter->second.mRank;

if (iter->second.mReputation)
mFactionReputation[iter->first] = iter->second.mReputation;
mFactionReputation[Misc::StringUtils::lowerCase(iter->first)] = iter->second.mReputation;
}

mDisposition = state.mDisposition;
Expand Down
2 changes: 2 additions & 0 deletions apps/openmw/mwrender/renderingmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ void RenderingManager::rotateObject(const MWWorld::Ptr &ptr)
void
RenderingManager::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur)
{
if (!old.getRefData().getBaseNode())
return;
Ogre::SceneNode *child =
mRendering.getScene()->getSceneNode(old.getRefData().getHandle());

Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwsound/soundmanagerimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,9 @@ namespace MWSound

MWWorld::Ptr player =
MWBase::Environment::get().getWorld()->getPlayerPtr();
const ESM::Cell *cell = player.getCell()->getCell();
const MWWorld::CellStore *cell = player.getCell();

mListenerUnderwater = ((cell->mData.mFlags&cell->HasWater) && mListenerPos.z < cell->mWater);
mListenerUnderwater = ((cell->getCell()->mData.mFlags&ESM::Cell::HasWater) && mListenerPos.z < cell->getWaterLevel());
}

void SoundManager::updatePtr(const MWWorld::Ptr &old, const MWWorld::Ptr &updated)
Expand Down
20 changes: 12 additions & 8 deletions apps/openmw/mwworld/cells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,26 +241,30 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)

void MWWorld::Cells::getExteriorPtrs(const std::string &name, std::vector<MWWorld::Ptr> &out)
{
for (std::map<std::pair<int, int>, CellStore>::iterator iter = mExteriors.begin();
iter!=mExteriors.end(); ++iter)
const MWWorld::Store<ESM::Cell> &cells = mStore.get<ESM::Cell>();
for (MWWorld::Store<ESM::Cell>::iterator iter = cells.extBegin(); iter != cells.extEnd(); ++iter)
{
Ptr ptr = getPtrAndCache (name, iter->second);
CellStore *cellStore = getCellStore (&(*iter));

Ptr ptr = getPtrAndCache (name, *cellStore);

if (!ptr.isEmpty())
out.push_back(ptr);
}

}

void MWWorld::Cells::getInteriorPtrs(const std::string &name, std::vector<MWWorld::Ptr> &out)
{
for (std::map<std::string, CellStore>::iterator iter = mInteriors.begin();
iter!=mInteriors.end(); ++iter)
const MWWorld::Store<ESM::Cell> &cells = mStore.get<ESM::Cell>();
for (MWWorld::Store<ESM::Cell>::iterator iter = cells.intBegin(); iter != cells.intEnd(); ++iter)
{
Ptr ptr = getPtrAndCache (name, iter->second);
CellStore *cellStore = getCellStore (&(*iter));

Ptr ptr = getPtrAndCache (name, *cellStore);

if (!ptr.isEmpty())
out.push_back(ptr);
}

}

int MWWorld::Cells::countSavedGameRecords() const
Expand Down
8 changes: 4 additions & 4 deletions apps/openmw/mwworld/physicssystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,17 +862,17 @@ namespace MWWorld
for(;iter != mMovementQueue.end();++iter)
{
float waterlevel = -std::numeric_limits<float>::max();
const ESM::Cell *cell = iter->first.getCell()->getCell();
if(cell->hasWater())
waterlevel = cell->mWater;
const MWWorld::CellStore *cell = iter->first.getCell();
if(cell->getCell()->hasWater())
waterlevel = cell->getWaterLevel();

float oldHeight = iter->first.getRefData().getPosition().pos[2];

const MWMechanics::MagicEffects& effects = iter->first.getClass().getCreatureStats(iter->first).getMagicEffects();

bool waterCollision = false;
if (effects.get(ESM::MagicEffect::WaterWalking).getMagnitude()
&& cell->hasWater()
&& cell->getCell()->hasWater()
&& !world->isUnderwater(iter->first.getCell(),
Ogre::Vector3(iter->first.getRefData().getPosition().pos)))
waterCollision = true;
Expand Down
11 changes: 0 additions & 11 deletions files/openmw-mimeinfo.xml

This file was deleted.

13 changes: 0 additions & 13 deletions files/openmw.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,3 @@ TryExec=openmw-launcher
Exec=openmw-launcher
Icon=openmw
Categories=Game;RolePlaying;

[Desktop Entry]
Type=Application
Name=OpenMW
GenericName=Role Playing Game
Comment=An engine replacement for The Elder Scrolls III: Morrowind
Keywords=Morrowind;Reimplementation Mods;esm;bsa;
Exec=openmw --load-savegame=%f
Icon=openmw
Categories=Game;RolePlaying;
Terminal=false
NoDisplay=true
MimeType=application/x-openmw-savegame;

0 comments on commit e81d2a9

Please sign in to comment.