Fix GCC warnings

macos_ci_fix
Andrei Kortunov 1 year ago
parent aeb46f5fba
commit ba71eefbae

@ -189,9 +189,9 @@ void CSMTools::FixLandsAndLandTexturesMergeStage::perform(int stage, CSMDoc::Mes
CSMWorld::IdTable& ltexTable = dynamic_cast<CSMWorld::IdTable&>(
*mState.mTarget->getData().getTableModel(CSMWorld::UniversalId::Type_LandTextures));
const std::string& id = mState.mTarget->getData().getLand().getId(stage).getRefIdString();
const auto& id = mState.mTarget->getData().getLand().getId(stage);
CSMWorld::TouchLandCommand cmd(landTable, ltexTable, id);
CSMWorld::TouchLandCommand cmd(landTable, ltexTable, id.getRefIdString());
cmd.redo();
// Get rid of base data

@ -128,10 +128,11 @@ namespace MWRender
{
size_t frameId = nv.getFrameStamp()->getFrameNumber() % 2;
const ESM::Position& player = MWMechanics::getPlayer().getRefData().getPosition();
const auto& player = MWMechanics::getPlayer();
const ESM::Position& playerPos = player.getRefData().getPosition();
mCurrentPlayerPos = osg::Vec2f(
std::floor(player.pos[0] / mWorldScaleFactor), std::floor(player.pos[1] / mWorldScaleFactor));
std::floor(playerPos.pos[0] / mWorldScaleFactor), std::floor(playerPos.pos[1] / mWorldScaleFactor));
osg::Vec2f offset = mCurrentPlayerPos - mLastPlayerPos;
mLastPlayerPos = mCurrentPlayerPos;
mState[frameId].mPaused = mPaused;

@ -1737,13 +1737,14 @@ namespace MWWorld
void World::updateSoundListener()
{
osg::Vec3f cameraPosition = mRendering->getCamera()->getPosition();
const ESM::Position& refpos = getPlayerPtr().getRefData().getPosition();
const auto& player = getPlayerPtr();
const ESM::Position& refpos = player.getRefData().getPosition();
osg::Vec3f listenerPos;
if (isFirstPerson())
listenerPos = cameraPosition;
else
listenerPos = refpos.asVec3() + osg::Vec3f(0, 0, 1.85f * mPhysics->getHalfExtents(getPlayerPtr()).z());
listenerPos = refpos.asVec3() + osg::Vec3f(0, 0, 1.85f * mPhysics->getHalfExtents(player).z());
osg::Quat listenerOrient = osg::Quat(refpos.rot[1], osg::Vec3f(0, -1, 0))
* osg::Quat(refpos.rot[0], osg::Vec3f(-1, 0, 0)) * osg::Quat(refpos.rot[2], osg::Vec3f(0, 0, -1));
@ -1751,7 +1752,7 @@ namespace MWWorld
osg::Vec3f forward = listenerOrient * osg::Vec3f(0, 1, 0);
osg::Vec3f up = listenerOrient * osg::Vec3f(0, 0, 1);
bool underwater = isUnderwater(getPlayerPtr().getCell(), cameraPosition);
bool underwater = isUnderwater(player.getCell(), cameraPosition);
MWBase::Environment::get().getSoundManager()->setListenerPosDir(listenerPos, forward, up, underwater);
}

Loading…
Cancel
Save