2021-01-02 04:24:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-06-02 22:48:52 +00:00
|
|
|
#include "ZCollisionPoly.h"
|
2021-01-02 04:24:29 +00:00
|
|
|
#include "ZFile.h"
|
2021-03-20 16:02:12 +00:00
|
|
|
#include "ZResource.h"
|
2021-01-02 04:24:29 +00:00
|
|
|
#include "ZRoom/ZRoom.h"
|
2021-10-17 11:32:09 +00:00
|
|
|
#include "ZVector.h"
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2022-06-02 22:48:52 +00:00
|
|
|
#if 0
|
2021-01-02 04:24:29 +00:00
|
|
|
class PolygonEntry
|
|
|
|
{
|
|
|
|
public:
|
2021-04-30 21:23:22 +00:00
|
|
|
uint16_t type;
|
|
|
|
uint16_t vtxA, vtxB, vtxC;
|
|
|
|
uint16_t a, b, c, d;
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
PolygonEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
|
2021-01-02 04:24:29 +00:00
|
|
|
};
|
2022-06-02 22:48:52 +00:00
|
|
|
#endif
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-10-17 11:32:09 +00:00
|
|
|
class WaterBoxHeader
|
2021-01-02 04:24:29 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-10-17 11:32:09 +00:00
|
|
|
WaterBoxHeader(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-10-17 11:32:09 +00:00
|
|
|
std::string GetBodySourceCode() const;
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-10-17 11:32:09 +00:00
|
|
|
protected:
|
2021-01-02 04:24:29 +00:00
|
|
|
int16_t xMin;
|
|
|
|
int16_t ySurface;
|
|
|
|
int16_t zMin;
|
|
|
|
int16_t xLength;
|
|
|
|
int16_t zLength;
|
|
|
|
int16_t pad;
|
|
|
|
int32_t properties;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CameraPositionData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int16_t x, y, z;
|
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
CameraPositionData(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
|
2021-01-02 04:24:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CameraDataEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int16_t cameraSType;
|
|
|
|
int16_t numData;
|
|
|
|
int32_t cameraPosDataSeg;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CameraDataList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::vector<CameraDataEntry*> entries;
|
|
|
|
std::vector<CameraPositionData*> cameraPositionData;
|
|
|
|
|
2021-03-20 16:02:12 +00:00
|
|
|
CameraDataList(ZFile* parent, const std::string& prefix, const std::vector<uint8_t>& rawData,
|
2022-01-17 00:43:07 +00:00
|
|
|
offset_t rawDataIndex, offset_t upperCameraBoundary);
|
2021-10-17 11:32:09 +00:00
|
|
|
~CameraDataList();
|
2021-01-02 04:24:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ZCollisionHeader : public ZResource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int16_t absMinX, absMinY, absMinZ;
|
|
|
|
int16_t absMaxX, absMaxY, absMaxZ;
|
2021-03-20 16:02:12 +00:00
|
|
|
uint16_t numVerts;
|
2021-03-14 15:40:25 +00:00
|
|
|
segptr_t vtxAddress;
|
2021-03-20 16:02:12 +00:00
|
|
|
uint16_t numPolygons;
|
2021-03-14 15:40:25 +00:00
|
|
|
segptr_t polyAddress;
|
|
|
|
segptr_t polyTypeDefAddress;
|
|
|
|
segptr_t camDataAddress;
|
2021-01-02 04:24:29 +00:00
|
|
|
|
|
|
|
int32_t numWaterBoxes;
|
2021-03-14 15:40:25 +00:00
|
|
|
segptr_t waterBoxAddress;
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
uint32_t vtxSegmentOffset, polySegmentOffset, polyTypeDefSegmentOffset, camDataSegmentOffset,
|
|
|
|
waterBoxSegmentOffset;
|
|
|
|
|
2021-10-17 11:32:09 +00:00
|
|
|
std::vector<ZVector> vertices;
|
2022-06-02 22:48:52 +00:00
|
|
|
std::vector<ZCollisionPoly> polygons;
|
2021-01-02 04:24:29 +00:00
|
|
|
std::vector<uint64_t> polygonTypes;
|
2021-10-17 11:32:09 +00:00
|
|
|
std::vector<WaterBoxHeader> waterBoxes;
|
2021-10-22 18:02:34 +00:00
|
|
|
CameraDataList* camData = nullptr;
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
ZCollisionHeader(ZFile* nParent);
|
2021-01-09 00:38:28 +00:00
|
|
|
~ZCollisionHeader();
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
void ParseRawData() override;
|
2021-10-17 11:32:09 +00:00
|
|
|
void DeclareReferences(const std::string& prefix) override;
|
|
|
|
|
|
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
2021-05-30 15:09:59 +00:00
|
|
|
|
2021-10-17 11:32:09 +00:00
|
|
|
std::string GetSourceTypeName() const override;
|
2021-05-30 15:09:59 +00:00
|
|
|
ZResourceType GetResourceType() const override;
|
|
|
|
|
|
|
|
size_t GetRawDataSize() const override;
|
2021-01-09 00:38:28 +00:00
|
|
|
};
|