1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 18:39:59 +00:00

Crashfix on launch

This commit is contained in:
florent.teppe 2023-01-23 21:44:49 +01:00
parent 0018bcf7de
commit c896a2ca48
10 changed files with 18 additions and 19 deletions

View File

@ -1,6 +1,6 @@
#include "luabindings.hpp"
#include <components/esm/cellcommon.hpp>
#include <components/esm/esm3esm4bridge.hpp>
#include <components/esm/records.hpp>
#include "../mwworld/cellstore.hpp"

View File

@ -2,7 +2,7 @@
#include <algorithm>
#include <components/esm/cellcommon.hpp>
#include <components/esm/esm3esm4bridge.hpp>
#include <components/esm3/loadcell.hpp>
#include <components/esm4/loadcell.hpp>
#include <components/fallback/fallback.hpp>
@ -42,9 +42,6 @@ namespace MWRender
void FogManager::configure(float viewDistance, const ESM::CellVariant& cell)
{
auto cell3 = cell.getEsm3();
auto cell4 = cell.getEsm4();
osg::Vec4f color
= SceneUtil::colourFromRGB(cell.isEsm4() ? cell.getEsm4().mLighting.fogColor : cell.getEsm3().mAmbi.mFog);

View File

@ -781,6 +781,9 @@ namespace MWSound
{
MWBase::World* world = MWBase::Environment::get().getWorld();
const MWWorld::ConstPtr player = world->getPlayerPtr();
if (player.getCell()->getCellVariant().isEsm4())
return;
const ESM::Cell* curcell = &player.getCell()->getCellVariant().getEsm3();
const auto update = mWaterSoundUpdater.update(player, *world);

View File

@ -15,7 +15,7 @@
#include "cellreflist.hpp"
#include "livecellref.hpp"
#include <components/esm/cellcommon.hpp>
#include <components/esm/esm3esm4bridge.hpp>
#include <components/esm/refid.hpp>
#include <components/esm3/fogstate.hpp>
#include <components/misc/tuplemeta.hpp>

View File

@ -80,7 +80,7 @@ add_component_dir (to_utf8
to_utf8
)
add_component_dir(esm attr common defs esmcommon records util luascripts format refid cellcommon)
add_component_dir(esm attr common defs esmcommon records util luascripts format refid esm3esm4bridge)
add_component_dir(fx pass technique lexer widgets stateupdater)

View File

@ -1,4 +1,4 @@
#include <components/esm/cellcommon.hpp>
#include <components/esm/esm3esm4bridge.hpp>
#include <components/esm3/loadcell.hpp>
#include <components/esm4/loadcell.hpp>
@ -6,7 +6,6 @@ namespace ESM
{
const ESM::CellCommon* CellVariant::getCommon() const
{
auto cell3 = getEsm3();
if (isEsm4())
return &getEsm4();
else

View File

@ -7,8 +7,8 @@
#include "cellid.hpp"
#include "cellref.hpp"
#include "components/esm/cellcommon.hpp"
#include "components/esm/defs.hpp"
#include "components/esm/esm3esm4bridge.hpp"
#include "components/esm/esmcommon.hpp"
#include "components/esm/refid.hpp"

View File

@ -78,12 +78,6 @@ void ESM4::Cell::load(ESM4::Reader& reader)
std::uint32_t esmVer = reader.esmVersion();
bool isFONV = esmVer == ESM::VER_132 || esmVer == ESM::VER_133 || esmVer == ESM::VER_134;
mCellId.mWorldspace = Misc::StringUtils::lowerCase(mEditorId);
mCellId.mWorld = ESM::RefId::sEmpty;
mCellId.mIndex.mX = getGridX();
mCellId.mIndex.mX = getGridY();
mCellId.mPaged = isExterior();
while (reader.getSubRecordHeader())
{
const ESM4::SubRecordHeader& subHdr = reader.subRecordHeader();
@ -247,6 +241,12 @@ void ESM4::Cell::load(ESM4::Reader& reader)
throw std::runtime_error("ESM4::CELL::load - Unknown subrecord " + ESM::printName(subHdr.typeId));
}
}
mCellId.mWorldspace = Misc::StringUtils::lowerCase(mEditorId);
mCellId.mWorld = ESM::RefId::sEmpty;
mCellId.mIndex.mX = getGridX();
mCellId.mIndex.mX = getGridY();
mCellId.mPaged = isExterior();
}
// void ESM4::Cell::save(ESM4::Writer& writer) const

View File

@ -34,8 +34,8 @@
#include "formid.hpp"
#include "lighting.hpp"
#include <components/esm/cellcommon.hpp>
#include <components/esm/defs.hpp>
#include <components/esm/esm3esm4bridge.hpp>
#include <components/esm/refid.hpp>
#include <components/esm3/cellid.hpp>
@ -107,8 +107,8 @@ namespace ESM4
int getGridX() const override { return mX; }
int getGridY() const override { return mY; }
bool isExterior() const override { return !(mFlags & CELL_Interior); }
virtual bool isQuasiExterior() const override { return mFlags & CELL_QuasiExt; }
bool isExterior() const override { return !(mCellFlags & CELL_Interior); }
virtual bool isQuasiExterior() const override { return mCellFlags & CELL_QuasiExt; }
virtual bool hasWater() const override { return false; /*unimplemented for now*/ }
const ESM::CellId& getCellId() const override { return mCellId; }
const ESM::RefId& getRegion() const override { return ESM::RefId::sEmpty; }