mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:29:55 +00:00
Merge branch 'help-i-cant-swim' into 'master'
Fix(editor): Don't save dirty water height values Closes #7841 See merge request OpenMW/openmw!3881
This commit is contained in:
commit
46f863a32e
5 changed files with 18 additions and 22 deletions
|
@ -152,6 +152,7 @@
|
||||||
Bug #7796: Absorbed enchantments don't restore magicka
|
Bug #7796: Absorbed enchantments don't restore magicka
|
||||||
Bug #7832: Ingredient tooltips show magnitude for Fortify Maximum Magicka effect
|
Bug #7832: Ingredient tooltips show magnitude for Fortify Maximum Magicka effect
|
||||||
Bug #7840: First run of the launcher doesn't save viewing distance as the default value
|
Bug #7840: First run of the launcher doesn't save viewing distance as the default value
|
||||||
|
Bug #7841: Editor: "Dirty" water heights are saved in modified CELLs
|
||||||
Feature #2566: Handle NAM9 records for manual cell references
|
Feature #2566: Handle NAM9 records for manual cell references
|
||||||
Feature #3537: Shader-based water ripples
|
Feature #3537: Shader-based water ripples
|
||||||
Feature #5173: Support for NiFogProperty
|
Feature #5173: Support for NiFogProperty
|
||||||
|
|
|
@ -612,7 +612,6 @@ namespace EsmTool
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cout << " Map Color: " << Misc::StringUtils::format("0x%08X", mData.mMapColor) << std::endl;
|
std::cout << " Map Color: " << Misc::StringUtils::format("0x%08X", mData.mMapColor) << std::endl;
|
||||||
std::cout << " Water Level Int: " << mData.mWaterInt << std::endl;
|
|
||||||
std::cout << " RefId counter: " << mData.mRefNumCounter << std::endl;
|
std::cout << " RefId counter: " << mData.mRefNumCounter << std::endl;
|
||||||
std::cout << " Deleted: " << mIsDeleted << std::endl;
|
std::cout << " Deleted: " << mIsDeleted << std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -996,7 +996,10 @@ namespace CSMWorld
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
if (isInterior && interiorWater)
|
if (isInterior && interiorWater)
|
||||||
|
{
|
||||||
cell.mWater = value.toFloat();
|
cell.mWater = value.toFloat();
|
||||||
|
cell.setHasWaterHeightSub(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return; // return without saving
|
return; // return without saving
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -118,6 +118,7 @@ namespace ESM
|
||||||
bool overriding = !mName.empty();
|
bool overriding = !mName.empty();
|
||||||
bool isLoaded = false;
|
bool isLoaded = false;
|
||||||
mHasAmbi = false;
|
mHasAmbi = false;
|
||||||
|
mHasWaterHeightSub = false;
|
||||||
while (!isLoaded && esm.hasMoreSubs())
|
while (!isLoaded && esm.hasMoreSubs())
|
||||||
{
|
{
|
||||||
esm.getSubName();
|
esm.getSubName();
|
||||||
|
@ -126,13 +127,13 @@ namespace ESM
|
||||||
case fourCC("INTV"):
|
case fourCC("INTV"):
|
||||||
int32_t waterl;
|
int32_t waterl;
|
||||||
esm.getHT(waterl);
|
esm.getHT(waterl);
|
||||||
|
mHasWaterHeightSub = true;
|
||||||
mWater = static_cast<float>(waterl);
|
mWater = static_cast<float>(waterl);
|
||||||
mWaterInt = true;
|
|
||||||
break;
|
break;
|
||||||
case fourCC("WHGT"):
|
case fourCC("WHGT"):
|
||||||
float waterLevel;
|
float waterLevel;
|
||||||
esm.getHT(waterLevel);
|
esm.getHT(waterLevel);
|
||||||
mWaterInt = false;
|
mHasWaterHeightSub = true;
|
||||||
if (!std::isfinite(waterLevel))
|
if (!std::isfinite(waterLevel))
|
||||||
{
|
{
|
||||||
if (!overriding)
|
if (!overriding)
|
||||||
|
@ -190,26 +191,16 @@ namespace ESM
|
||||||
|
|
||||||
if (mData.mFlags & Interior)
|
if (mData.mFlags & Interior)
|
||||||
{
|
{
|
||||||
if (mWaterInt)
|
// Try to avoid saving ambient information when it's unnecessary.
|
||||||
{
|
// This is to fix black lighting and flooded water
|
||||||
int32_t water = (mWater >= 0) ? static_cast<int32_t>(mWater + 0.5) : static_cast<int32_t>(mWater - 0.5);
|
// in resaved cell records that lack this information.
|
||||||
esm.writeHNT("INTV", water);
|
if (mHasWaterHeightSub)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
esm.writeHNT("WHGT", mWater);
|
esm.writeHNT("WHGT", mWater);
|
||||||
}
|
|
||||||
|
|
||||||
if (mData.mFlags & QuasiEx)
|
if (mData.mFlags & QuasiEx)
|
||||||
esm.writeHNOCRefId("RGNN", mRegion);
|
esm.writeHNOCRefId("RGNN", mRegion);
|
||||||
else
|
else if (mHasAmbi)
|
||||||
{
|
|
||||||
// Try to avoid saving ambient lighting information when it's unnecessary.
|
|
||||||
// This is to fix black lighting in resaved cell records that lack this information.
|
|
||||||
if (mHasAmbi)
|
|
||||||
esm.writeHNT("AMBI", mAmbi, 16);
|
esm.writeHNT("AMBI", mAmbi, 16);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
esm.writeHNOCRefId("RGNN", mRegion);
|
esm.writeHNOCRefId("RGNN", mRegion);
|
||||||
|
@ -324,7 +315,6 @@ namespace ESM
|
||||||
mName.clear();
|
mName.clear();
|
||||||
mRegion = ESM::RefId();
|
mRegion = ESM::RefId();
|
||||||
mWater = 0;
|
mWater = 0;
|
||||||
mWaterInt = false;
|
|
||||||
mMapColor = 0;
|
mMapColor = 0;
|
||||||
mRefNumCounter = 0;
|
mRefNumCounter = 0;
|
||||||
|
|
||||||
|
@ -333,6 +323,7 @@ namespace ESM
|
||||||
mData.mY = 0;
|
mData.mY = 0;
|
||||||
|
|
||||||
mHasAmbi = true;
|
mHasAmbi = true;
|
||||||
|
mHasWaterHeightSub = true;
|
||||||
mAmbi.mAmbient = 0;
|
mAmbi.mAmbient = 0;
|
||||||
mAmbi.mSunlight = 0;
|
mAmbi.mSunlight = 0;
|
||||||
mAmbi.mFog = 0;
|
mAmbi.mFog = 0;
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace ESM
|
||||||
, mRegion(ESM::RefId())
|
, mRegion(ESM::RefId())
|
||||||
, mHasAmbi(true)
|
, mHasAmbi(true)
|
||||||
, mWater(0)
|
, mWater(0)
|
||||||
, mWaterInt(false)
|
, mHasWaterHeightSub(false)
|
||||||
, mMapColor(0)
|
, mMapColor(0)
|
||||||
, mRefNumCounter(0)
|
, mRefNumCounter(0)
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ namespace ESM
|
||||||
bool mHasAmbi;
|
bool mHasAmbi;
|
||||||
|
|
||||||
float mWater; // Water level
|
float mWater; // Water level
|
||||||
bool mWaterInt;
|
bool mHasWaterHeightSub;
|
||||||
int32_t mMapColor;
|
int32_t mMapColor;
|
||||||
// Counter for RefNums. This is only used during content file editing and has no impact on gameplay.
|
// Counter for RefNums. This is only used during content file editing and has no impact on gameplay.
|
||||||
// It prevents overwriting previous refNums, even if they were deleted.
|
// It prevents overwriting previous refNums, even if they were deleted.
|
||||||
|
@ -163,6 +163,8 @@ namespace ESM
|
||||||
|
|
||||||
bool hasWater() const { return ((mData.mFlags & HasWater) != 0) || isExterior(); }
|
bool hasWater() const { return ((mData.mFlags & HasWater) != 0) || isExterior(); }
|
||||||
|
|
||||||
|
void setHasWaterHeightSub(bool hasWater) { mHasWaterHeightSub = hasWater; }
|
||||||
|
|
||||||
bool hasAmbient() const { return mHasAmbi; }
|
bool hasAmbient() const { return mHasAmbi; }
|
||||||
|
|
||||||
void setHasAmbient(bool hasAmbi) { mHasAmbi = hasAmbi; }
|
void setHasAmbient(bool hasAmbi) { mHasAmbi = hasAmbi; }
|
||||||
|
|
Loading…
Reference in a new issue