1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 09:09:43 +00:00

Apply clang-format

This commit is contained in:
Petr Mikheev 2022-11-06 21:06:32 +01:00
parent 313df72be0
commit aa230698a8
9 changed files with 31 additions and 14 deletions

View file

@ -43,7 +43,7 @@ namespace MWBase
static Environment* sThis;
World* mWorld = nullptr;
MWWorld::Cells* mWorldModel = nullptr; // TODO: rename Cells -> WorldModel
MWWorld::Cells* mWorldModel = nullptr; // TODO: rename Cells -> WorldModel
MWWorld::Scene* mWorldScene = nullptr;
SoundManager* mSoundManager = nullptr;
ScriptManager* mScriptManager = nullptr;

View file

@ -587,7 +587,8 @@ namespace MWGui
if (!entry.mMapTexture)
{
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);
if (texture)

View file

@ -341,8 +341,12 @@ bool MWMechanics::AiPackage::shortcutPath(const osg::Vec3f& startPoint, const os
if (!mShortcutProhibited || (mShortcutFailPos - startPoint).length() >= PATHFIND_SHORTCUT_RETRY_DIST)
{
// check if target is clearly visible
isPathClear = !MWBase::Environment::get().getWorld()->getRayCasting()->castRay(
startPoint, endPoint, MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door).mHit;
isPathClear
= !MWBase::Environment::get()
.getWorld()
->getRayCasting()
->castRay(startPoint, endPoint, MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door)
.mHit;
if (destInLOS != nullptr)
*destInLOS = isPathClear;

View file

@ -81,7 +81,11 @@ namespace MWMechanics
+ direction * std::max(halfExtents.x(), std::max(halfExtents.y(), halfExtents.z()));
const int mask = MWPhysics::CollisionType_World | MWPhysics::CollisionType_HeightMap
| 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)

View file

@ -252,9 +252,12 @@ namespace MWMechanics
// Add Z offset since path node can overlap with other objects.
// Also ignore doors in raytesting.
const int mask = MWPhysics::CollisionType_World;
bool isPathClear = !MWBase::Environment::get().getWorld()->getRayCasting()->castRay(
osg::Vec3f(startPoint.x(), startPoint.y(), startPoint.z() + 16),
osg::Vec3f(temp.mX, temp.mY, temp.mZ + 16), mask).mHit;
bool isPathClear = !MWBase::Environment::get()
.getWorld()
->getRayCasting()
->castRay(osg::Vec3f(startPoint.x(), startPoint.y(), startPoint.z() + 16),
osg::Vec3f(temp.mX, temp.mY, temp.mZ + 16), mask)
.mHit;
if (isPathClear)
path.pop_front();
}

View file

@ -474,7 +474,8 @@ namespace MWScript
MWWorld::Ptr base = ptr;
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));
}
else

View file

@ -12,8 +12,8 @@
#include <components/esm3/player.hpp>
#include <components/fallback/fallback.hpp>
#include "../mwworld/esmstore.hpp"
#include "../mwworld/cells.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/magiceffects.hpp"

View file

@ -543,7 +543,8 @@ namespace MWWorld
}
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());
mCurrentGridCenter = osg::Vec2i(playerCellX, playerCellY);
@ -1183,7 +1184,8 @@ namespace MWWorld
{
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())
break;
}

View file

@ -1479,8 +1479,10 @@ namespace MWWorld
// 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
if (!mPhysics->castRay(spawnPoint, osg::Vec3f(pos.x(), pos.y(), pos.z() + 20),
MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door).mHit)
if (!mPhysics
->castRay(spawnPoint, osg::Vec3f(pos.x(), pos.y(), pos.z() + 20),
MWPhysics::CollisionType_World | MWPhysics::CollisionType_Door)
.mHit)
{
// safe
break;