DarkflameServer/dZoneManager/Level.h

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

66 lines
1.2 KiB
C
Raw Permalink Normal View History

#pragma once
#include "dZMCommon.h"
#include <map>
#include <iostream>
#include "Zone.h"
class Level {
public:
enum ChunkTypeID : uint16_t {
FileInfo = 1000,
SceneEnviroment = 2000,
SceneObjectData,
SceneParticleData
};
enum ChunkTypes {
Enviroment,
Objects,
Particles
};
struct FileInfoChunk {
uint32_t version;
uint32_t revision;
uint32_t enviromentChunkStart;
uint32_t objectChunkStart;
uint32_t particleChunkStart;
};
struct SceneObjectDataChunk {
std::map<LWOOBJID, SceneObject> objects;
2022-07-28 13:39:57 +00:00
void PrintAllObjects() const;
uint32_t GetObjectCount() { return objects.size(); }
};
struct Header {
uint32_t id;
uint16_t chunkVersion;
ChunkTypeID chunkType;
uint32_t size;
uint32_t startPosition;
FileInfoChunk* fileInfo;
SceneObjectDataChunk* sceneObjects;
LWOSCENEID lwoSceneID;
};
public:
Level(Zone* parentZone, const std::string& filepath);
~Level();
2023-11-10 03:28:52 +00:00
static void MakeSpawner(SceneObject obj);
const void PrintAllObjects();
std::map<uint32_t, Header> m_ChunkHeaders;
private:
Zone* m_ParentZone;
//private functions:
void ReadChunks(std::istream& file);
void ReadFileInfoChunk(std::istream& file, Header& header);
void ReadSceneObjectDataChunk(std::istream& file, Header& header);
};