mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 23:09:43 +00:00
Apply clang-format
This commit is contained in:
parent
313df72be0
commit
aa230698a8
9 changed files with 31 additions and 14 deletions
|
@ -587,7 +587,8 @@ namespace MWGui
|
||||||
if (!entry.mMapTexture)
|
if (!entry.mMapTexture)
|
||||||
{
|
{
|
||||||
if (!mInterior)
|
if (!mInterior)
|
||||||
requestMapRender(MWBase::Environment::get().getWorldModel()->getExterior(entry.mCellX, entry.mCellY));
|
requestMapRender(
|
||||||
|
MWBase::Environment::get().getWorldModel()->getExterior(entry.mCellX, entry.mCellY));
|
||||||
|
|
||||||
osg::ref_ptr<osg::Texture2D> texture = mLocalMapRender->getMapTexture(entry.mCellX, entry.mCellY);
|
osg::ref_ptr<osg::Texture2D> texture = mLocalMapRender->getMapTexture(entry.mCellX, entry.mCellY);
|
||||||
if (texture)
|
if (texture)
|
||||||
|
|
|
@ -341,8 +341,12 @@ bool MWMechanics::AiPackage::shortcutPath(const osg::Vec3f& startPoint, const os
|
||||||
if (!mShortcutProhibited || (mShortcutFailPos - startPoint).length() >= PATHFIND_SHORTCUT_RETRY_DIST)
|
if (!mShortcutProhibited || (mShortcutFailPos - startPoint).length() >= PATHFIND_SHORTCUT_RETRY_DIST)
|
||||||
{
|
{
|
||||||
// check if target is clearly visible
|
// check if target is clearly visible
|
||||||
isPathClear = !MWBase::Environment::get().getWorld()->getRayCasting()->castRay(
|
isPathClear
|
||||||
startPoint, endPoint, MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door).mHit;
|
= !MWBase::Environment::get()
|
||||||
|
.getWorld()
|
||||||
|
->getRayCasting()
|
||||||
|
->castRay(startPoint, endPoint, MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door)
|
||||||
|
.mHit;
|
||||||
|
|
||||||
if (destInLOS != nullptr)
|
if (destInLOS != nullptr)
|
||||||
*destInLOS = isPathClear;
|
*destInLOS = isPathClear;
|
||||||
|
|
|
@ -81,7 +81,11 @@ namespace MWMechanics
|
||||||
+ direction * std::max(halfExtents.x(), std::max(halfExtents.y(), halfExtents.z()));
|
+ direction * std::max(halfExtents.x(), std::max(halfExtents.y(), halfExtents.z()));
|
||||||
const int mask = MWPhysics::CollisionType_World | MWPhysics::CollisionType_HeightMap
|
const int mask = MWPhysics::CollisionType_World | MWPhysics::CollisionType_HeightMap
|
||||||
| MWPhysics::CollisionType_Door | MWPhysics::CollisionType_Actor;
|
| MWPhysics::CollisionType_Door | MWPhysics::CollisionType_Actor;
|
||||||
return MWBase::Environment::get().getWorld()->getRayCasting()->castRay(position, visibleDestination, actor, {}, mask).mHit;
|
return MWBase::Environment::get()
|
||||||
|
.getWorld()
|
||||||
|
->getRayCasting()
|
||||||
|
->castRay(position, visibleDestination, actor, {}, mask)
|
||||||
|
.mHit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopMovement(const MWWorld::Ptr& actor)
|
void stopMovement(const MWWorld::Ptr& actor)
|
||||||
|
|
|
@ -252,9 +252,12 @@ namespace MWMechanics
|
||||||
// Add Z offset since path node can overlap with other objects.
|
// Add Z offset since path node can overlap with other objects.
|
||||||
// Also ignore doors in raytesting.
|
// Also ignore doors in raytesting.
|
||||||
const int mask = MWPhysics::CollisionType_World;
|
const int mask = MWPhysics::CollisionType_World;
|
||||||
bool isPathClear = !MWBase::Environment::get().getWorld()->getRayCasting()->castRay(
|
bool isPathClear = !MWBase::Environment::get()
|
||||||
osg::Vec3f(startPoint.x(), startPoint.y(), startPoint.z() + 16),
|
.getWorld()
|
||||||
osg::Vec3f(temp.mX, temp.mY, temp.mZ + 16), mask).mHit;
|
->getRayCasting()
|
||||||
|
->castRay(osg::Vec3f(startPoint.x(), startPoint.y(), startPoint.z() + 16),
|
||||||
|
osg::Vec3f(temp.mX, temp.mY, temp.mZ + 16), mask)
|
||||||
|
.mHit;
|
||||||
if (isPathClear)
|
if (isPathClear)
|
||||||
path.pop_front();
|
path.pop_front();
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,7 +474,8 @@ namespace MWScript
|
||||||
MWWorld::Ptr base = ptr;
|
MWWorld::Ptr base = ptr;
|
||||||
if (isPlayer)
|
if (isPlayer)
|
||||||
{
|
{
|
||||||
MWWorld::CellStore* cell = MWBase::Environment::get().getWorldModel()->getExterior(cellIndex.x(), cellIndex.y());
|
MWWorld::CellStore* cell
|
||||||
|
= MWBase::Environment::get().getWorldModel()->getExterior(cellIndex.x(), cellIndex.y());
|
||||||
ptr = world->moveObject(ptr, cell, osg::Vec3(x, y, z));
|
ptr = world->moveObject(ptr, cell, osg::Vec3(x, y, z));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
#include <components/esm3/player.hpp>
|
#include <components/esm3/player.hpp>
|
||||||
#include <components/fallback/fallback.hpp>
|
#include <components/fallback/fallback.hpp>
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
|
||||||
#include "../mwworld/cells.hpp"
|
#include "../mwworld/cells.hpp"
|
||||||
|
#include "../mwworld/esmstore.hpp"
|
||||||
#include "../mwworld/inventorystore.hpp"
|
#include "../mwworld/inventorystore.hpp"
|
||||||
#include "../mwworld/magiceffects.hpp"
|
#include "../mwworld/magiceffects.hpp"
|
||||||
|
|
||||||
|
|
|
@ -543,7 +543,8 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
mNavigator.setWorldspace(
|
mNavigator.setWorldspace(
|
||||||
mWorld.getWorldModel().getExterior(playerCellX, playerCellY)->getCell()->mCellId.mWorldspace, navigatorUpdateGuard.get());
|
mWorld.getWorldModel().getExterior(playerCellX, playerCellY)->getCell()->mCellId.mWorldspace,
|
||||||
|
navigatorUpdateGuard.get());
|
||||||
mNavigator.updateBounds(pos, navigatorUpdateGuard.get());
|
mNavigator.updateBounds(pos, navigatorUpdateGuard.get());
|
||||||
|
|
||||||
mCurrentGridCenter = osg::Vec2i(playerCellX, playerCellY);
|
mCurrentGridCenter = osg::Vec2i(playerCellX, playerCellY);
|
||||||
|
@ -1183,7 +1184,8 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
for (int dy = -mHalfGridSize; dy <= mHalfGridSize; ++dy)
|
for (int dy = -mHalfGridSize; dy <= mHalfGridSize; ++dy)
|
||||||
{
|
{
|
||||||
mPreloader->preload(mWorld.getWorldModel().getExterior(x + dx, y + dy), mRendering.getReferenceTime());
|
mPreloader->preload(
|
||||||
|
mWorld.getWorldModel().getExterior(x + dx, y + dy), mRendering.getReferenceTime());
|
||||||
if (++numpreloaded >= mPreloader->getMaxCacheSize())
|
if (++numpreloaded >= mPreloader->getMaxCacheSize())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1479,8 +1479,10 @@ namespace MWWorld
|
||||||
// check if spawn point is safe, fall back to another direction if not
|
// check if spawn point is safe, fall back to another direction if not
|
||||||
spawnPoint.z() += 30; // move up a little to account for slopes, will snap down later
|
spawnPoint.z() += 30; // move up a little to account for slopes, will snap down later
|
||||||
|
|
||||||
if (!mPhysics->castRay(spawnPoint, osg::Vec3f(pos.x(), pos.y(), pos.z() + 20),
|
if (!mPhysics
|
||||||
MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door).mHit)
|
->castRay(spawnPoint, osg::Vec3f(pos.x(), pos.y(), pos.z() + 20),
|
||||||
|
MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door)
|
||||||
|
.mHit)
|
||||||
{
|
{
|
||||||
// safe
|
// safe
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue