Files
Bret Curtis b3da1c7387 Decode legacy fog of war in the consumer, not in the ESM layer
components/esm3 linked osgDB and the tga and png plugins only to transcode
pre-format-7 fog textures into PNG while loading. Record the format on
FogTexture and let localmap pick the decoder, saving a decode and re-encode.
2026-09-12 21:13:52 +02:00

47 lines
1.1 KiB
C++

#ifndef OPENMW_ESM_FOGSTATE_H
#define OPENMW_ESM_FOGSTATE_H
#include <cstdint>
#include <vector>
namespace ESM
{
class ESMReader;
class ESMWriter;
struct FogTexture
{
int32_t mX, mY; // Only used for interior cells
std::vector<char> mImageData;
// Saves at or below MaxOldFogOfWarFormatVersion stored these as TGA, newer ones
// as PNG. Set while loading so the consumer can pick a decoder; never written to
// a save, since saving always produces PNG.
bool mLegacyTgaImageData = false;
};
// format 0, saved games only
// Fog of war state
struct FogState
{
// Only used for interior cells
float mNorthMarkerAngle;
struct Bounds
{
float mMinX;
float mMinY;
float mMaxX;
float mMaxY;
} mBounds;
float mCenterX;
float mCenterY;
std::vector<FogTexture> mFogTextures;
void load(ESMReader& esm);
void save(ESMWriter& esm, bool interiorCell) const;
};
}
#endif