1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 13:53:53 +00:00
openmw/components/esm3/loadpgrd.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.9 KiB
C++
Raw Normal View History

2012-09-23 18:11:08 +00:00
#ifndef OPENMW_ESM_PGRD_H
#define OPENMW_ESM_PGRD_H
2010-02-25 13:03:03 +00:00
2012-09-17 07:37:50 +00:00
#include <string>
#include <vector>
2022-06-04 14:07:59 +00:00
#include "components/esm/defs.hpp"
namespace ESM
{
2010-02-25 13:03:03 +00:00
2012-09-30 20:51:54 +00:00
class ESMReader;
class ESMWriter;
2010-02-25 13:03:03 +00:00
/*
* Path grid.
*/
struct Pathgrid
2010-02-25 13:03:03 +00:00
{
2022-06-04 14:34:23 +00:00
constexpr static RecNameInts sRecordId = REC_PGRD;
2022-06-04 14:07:59 +00:00
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Pathgrid"; }
struct DATAstruct
{
2012-09-17 07:37:50 +00:00
int mX, mY; // Grid location, matches cell for exterior cells
short mS1; // ?? Usually but not always a power of 2. Doesn't seem
// to have any relation to the size of PGRC.
2012-09-17 07:37:50 +00:00
short mS2; // Number of path points.
}; // 12 bytes
2010-02-25 13:03:03 +00:00
struct Point // path grid point
{
2012-09-17 07:37:50 +00:00
int mX, mY, mZ; // Location of point
unsigned char mAutogenerated; // autogenerated vs. user coloring flag?
unsigned char mConnectionNum; // number of connections for this point
short mUnknown;
Point& operator=(const float[3]);
Point(const float[3]);
Point();
Point(int x, int y, int z)
: mX(x)
, mY(y)
, mZ(z)
, mAutogenerated(0)
, mConnectionNum(0)
, mUnknown(0)
{
}
}; // 16 bytes
struct Edge // path grid edge
{
2012-09-17 07:37:50 +00:00
int mV0, mV1; // index of points connected with this edge
}; // 8 bytes
2012-09-17 07:37:50 +00:00
std::string mCell; // Cell name
DATAstruct mData;
typedef std::vector<Point> PointList;
2012-09-17 07:37:50 +00:00
PointList mPoints;
typedef std::vector<Edge> EdgeList;
2012-09-17 07:37:50 +00:00
EdgeList mEdges;
void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const;
2014-10-02 10:30:15 +00:00
void blank();
2010-02-25 13:03:03 +00:00
};
}
#endif