|
|
|
#ifndef _ESM_PGRD_H
|
|
|
|
#define _ESM_PGRD_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "record.hpp"
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Path grid.
|
|
|
|
*/
|
|
|
|
struct Pathgrid : public Record
|
|
|
|
{
|
|
|
|
struct DATAstruct
|
|
|
|
{
|
|
|
|
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.
|
|
|
|
short mS2; // Number of path points.
|
|
|
|
}; // 12 bytes
|
|
|
|
|
|
|
|
struct Point // path grid point
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}; // 16 bytes
|
|
|
|
|
|
|
|
struct Edge // path grid edge
|
|
|
|
{
|
|
|
|
int mV0, mV1; // index of points connected with this edge
|
|
|
|
}; // 8 bytes
|
|
|
|
|
|
|
|
std::string mCell; // Cell name
|
|
|
|
DATAstruct mData;
|
|
|
|
|
|
|
|
typedef std::vector<Point> PointList;
|
|
|
|
PointList mPoints;
|
|
|
|
|
|
|
|
typedef std::vector<Edge> EdgeList;
|
|
|
|
EdgeList mEdges;
|
|
|
|
|
|
|
|
void load(ESMReader &esm);
|
|
|
|
void save(ESMWriter &esm);
|
|
|
|
|
|
|
|
int getName() { return REC_PGRD; }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|