mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-22 06:34:26 +00:00
feat: add eSceneType enum, filter scene graph to general scenes, zone parsing improvements
- Add eSceneType enum (General, Audio) replacing raw uint32_t in SceneRef - Filter BuildSceneGraph to only include General scenes - Skip transitions referencing non-general scenes in adjacency graph - Rename SceneRef unknown fields to scenePosition/sceneRadius - Zone parsing and Level improvements Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,67 @@
|
||||
#include <iostream>
|
||||
#include "Zone.h"
|
||||
|
||||
struct LvlDrawDistances {
|
||||
float fogNear{};
|
||||
float fogFar{};
|
||||
float postFogSolid{};
|
||||
float postFogFade{};
|
||||
float staticObjDistance{};
|
||||
float dynamicObjDistance{};
|
||||
};
|
||||
|
||||
struct LvlCullVal {
|
||||
uint32_t groupID{};
|
||||
float min{};
|
||||
float max{};
|
||||
};
|
||||
|
||||
struct LvlLightingInfo {
|
||||
float blendTime{};
|
||||
float ambient[3]{};
|
||||
float specular[3]{};
|
||||
float upperHemi[3]{};
|
||||
NiPoint3 position;
|
||||
bool hasDrawDistances{};
|
||||
LvlDrawDistances minDraw;
|
||||
LvlDrawDistances maxDraw;
|
||||
std::vector<LvlCullVal> cullVals;
|
||||
float fogNear{};
|
||||
float fogFar{};
|
||||
float fogColor[3]{};
|
||||
float dirLight[3]{};
|
||||
NiPoint3 startPosition;
|
||||
NiQuaternion startRotation = QuatUtils::IDENTITY;
|
||||
bool hasSpawn{};
|
||||
};
|
||||
|
||||
struct LvlSkydomeInfo {
|
||||
std::string filename;
|
||||
std::string skyLayerFilename;
|
||||
std::string ringLayer[4];
|
||||
};
|
||||
|
||||
struct LvlEditorColor { float r{}, g{}, b{}; };
|
||||
|
||||
struct LvlEditorSettings {
|
||||
std::vector<LvlEditorColor> savedColors;
|
||||
};
|
||||
|
||||
struct LvlEnvironmentData {
|
||||
LvlLightingInfo lighting;
|
||||
LvlSkydomeInfo skydome;
|
||||
LvlEditorSettings editor;
|
||||
bool hasEditor{};
|
||||
};
|
||||
|
||||
struct LvlParticle {
|
||||
uint16_t priority{};
|
||||
NiPoint3 position;
|
||||
NiQuaternion rotation = QuatUtils::IDENTITY;
|
||||
std::string effectNames;
|
||||
LwoNameValue config;
|
||||
};
|
||||
|
||||
class Level {
|
||||
public:
|
||||
enum ChunkTypeID : uint16_t {
|
||||
@@ -39,15 +100,23 @@ public:
|
||||
|
||||
public:
|
||||
Level(Zone* parentZone, const std::string& filepath);
|
||||
|
||||
|
||||
static void MakeSpawner(const SceneObject& obj);
|
||||
|
||||
std::map<uint32_t, Header> m_ChunkHeaders;
|
||||
LvlEnvironmentData m_Environment;
|
||||
bool m_HasEnvironment{};
|
||||
std::vector<LvlParticle> m_Particles;
|
||||
private:
|
||||
Zone* m_ParentZone;
|
||||
|
||||
//private functions:
|
||||
void ReadChunks(std::istream& file);
|
||||
void ReadFileInfoChunk(std::istream& file, Header& header);
|
||||
void ReadEnvironmentChunk(std::istream& file, Header& header);
|
||||
void ReadLighting(std::istream& file, uint32_t version);
|
||||
void ReadSkydome(std::istream& file, uint32_t version);
|
||||
void ReadEditor(std::istream& file);
|
||||
void ReadSceneObjectDataChunk(std::istream& file, Header& header);
|
||||
void ReadParticleChunk(std::istream& file, Header& header);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user