This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

View File

@@ -0,0 +1,90 @@
//====== Copyright <20> 1996-2004, Valve Corporation, All rights reserved. =======
//
// A class representing a world node
//
//=============================================================================
#ifndef DMEWORLD_H
#define DMEWORLD_H
#ifdef COMPILER_MSVC
#pragma once
#endif
#include "dmeworldnode.h"
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Parameters used to construct the world
//-----------------------------------------------------------------------------
class CDmeWorldBuilderParams : public CDmElement
{
DEFINE_ELEMENT( CDmeWorldBuilderParams, CDmElement );
public:
CDmaVar< int32 > m_nSizeBytesPerVoxel; // target size per-voxel
CDmaVar< float > m_flMinDrawVolumeSize; // minimum size of any draw call
CDmaVar< float > m_flMinDistToCamera; // minimum distance to camera for near objects
CDmaVar< float > m_flMinAtlasDist; // minimum distance at which any atlased node can be visible
CDmaVar< float > m_flMinSimplifiedDist; // minimum distance at which any simplified node can be visible
CDmaVar< float > m_flHorzFOV; // horizontal fov used for texel to screenspace calcs
CDmaVar< float > m_flHalfScreenWidth; // half target screen res used for texel to screenspace calcs
CDmaVar< int32 > m_nAtlasTextureSizeX; // X res of atlas textures
CDmaVar< int32 > m_nAtlasTextureSizeY; // Y res of atlas textures
CDmaVar< int32 > m_nUniqueTextureSizeX; // X res of uniquely atlased textures
CDmaVar< int32 > m_nUniqueTextureSizeY; // Y res of uniquely atlased textures
CDmaVar< int32 > m_nCompressedAtlasSize; // approx size of a compressed atlas texture
CDmaVar< float > m_flGutterSize; // gutter size (in texels)
CDmaVar< float > m_flUVMapThreshold; // cos( angle ) threshold between faces when creating a unique uv parameterization
CDmaVar< Vector > m_vWorldUnitsPerTile; // world units per tile for tiled coordinates
CDmaVar< int32 > m_nMaxTexScaleSlots; // maximum number of gpu registers we can take up with texture scaling
CDmaVar< bool > m_bWrapInAtlas; // true == handle wrapping texcoords by tiling the texture in the atlas
};
//-----------------------------------------------------------------------------
// Bounds for a node
//-----------------------------------------------------------------------------
class CDmeNodeData : public CDmElement
{
DEFINE_ELEMENT( CDmeNodeData, CDmElement );
public:
CDmaVar< int32 > m_nID;
CDmaVar< int32 > m_Flags;
CDmaVar< int32 > m_nParent;
CDmaVar< Vector > m_vOrigin;
CDmaVar< Vector > m_vMinBounds;
CDmaVar< Vector > m_vMaxBounds;
CDmaVar< float > m_flMinimumDistance;
CDmaArray< int32 > m_ChildNodeIndices;
};
//-----------------------------------------------------------------------------
// World node reference
//-----------------------------------------------------------------------------
class CDmeWorldNodeReference : public CDmElement
{
DEFINE_ELEMENT( CDmeWorldNodeReference, CDmElement );
public:
CDmaString m_worldNodeFileName;
CDmaElement< CDmeNodeData > m_nodeData;
};
//-----------------------------------------------------------------------------
// The whole world in DME format
//-----------------------------------------------------------------------------
class CDmeWorld : public CDmElement
{
DEFINE_ELEMENT( CDmeWorld, CDmElement );
public:
CDmaElement< CDmeWorldBuilderParams > m_builderParams;
CDmaElementArray< CDmeWorldNodeReference > m_worldNodes;
CDmaString m_entityString; // All of the entity text
};
#endif // DMEWORLD_H

View File

@@ -0,0 +1,60 @@
//====== Copyright <20> 1996-2004, Valve Corporation, All rights reserved. =======
//
// A class representing a world node
//
//=============================================================================
#ifndef DMEWORLDLIGHTS_H
#define DMEWORLDLIGHTS_H
#ifdef COMPILER_MSVC
#pragma once
#endif
#include "datamodel/dmelement.h"
//-----------------------------------------------------------------------------
// Light types
//-----------------------------------------------------------------------------
class CDmeWorldPointLight : public CDmElement
{
DEFINE_ELEMENT( CDmeWorldPointLight, CDmElement );
public:
CDmaString m_lightName;
CDmaVar< Vector > m_vOrigin;
CDmaVar< Vector > m_vColor;
CDmaVar< float > m_flRadius;
CDmaVar< Vector > m_vAttenuation;
};
class CDmeWorldHemiLight : public CDmElement
{
DEFINE_ELEMENT( CDmeWorldHemiLight, CDmElement );
public:
CDmaString m_lightName;
CDmaVar< Vector4D > m_vTransform0; // Direction is z column
CDmaVar< Vector4D > m_vTransform1; // Direction is z column
CDmaVar< Vector4D > m_vTransform2; // Direction is z column
CDmaVar< Vector > m_vColor;
CDmaVar< float > m_flRadius;
CDmaVar< Vector > m_vAttenuation;
};
class CDmeWorldSpotLight : public CDmElement
{
DEFINE_ELEMENT( CDmeWorldSpotLight, CDmElement );
public:
CDmaString m_lightName;
CDmaVar< Vector4D > m_vTransform0; // Direction is z column
CDmaVar< Vector4D > m_vTransform1; // Direction is z column
CDmaVar< Vector4D > m_vTransform2; // Direction is z column
CDmaVar< Vector > m_vColor;
CDmaVar< float > m_flRadius;
CDmaVar< Vector > m_vAttenuation;
CDmaVar< float > m_flCosSpot;
};
#endif // DMEWORLDLIGHTS_H

View File

@@ -0,0 +1,59 @@
//====== Copyright <20> 1996-2004, Valve Corporation, All rights reserved. =======
//
// A class representing a world node
//
//=============================================================================
#ifndef DMEWORLDNODE_H
#define DMEWORLDNODE_H
#ifdef COMPILER_MSVC
#pragma once
#endif
#include "datamodel/dmelement.h"
#include "datamodel/dmattributevar.h"
#include "dmeworldlights.h"
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// A scene object in a world node
//-----------------------------------------------------------------------------
class CDmeSceneObject : public CDmElement
{
DEFINE_ELEMENT( CDmeSceneObject, CDmElement );
public:
CDmaVar< Vector4D > m_vTransform0;
CDmaVar< Vector4D > m_vTransform1;
CDmaVar< Vector4D > m_vTransform2;
CDmaString m_renderableFileName;
};
//-----------------------------------------------------------------------------
// A world node
//-----------------------------------------------------------------------------
class CDmeWorldNode : public CDmElement
{
DEFINE_ELEMENT( CDmeWorldNode, CDmElement );
public:
CDmaVar< int32 > m_nID;
CDmaVar< int32 > m_Flags;
CDmaVar< int32 > m_nParent;
CDmaVar< Vector > m_vOrigin;
CDmaVar< Vector > m_vMinBounds;
CDmaVar< Vector > m_vMaxBounds;
CDmaVar< float > m_flMinimumDistance;
CDmaArray< int32 > m_ChildNodeIndices;
CDmaElementArray< CDmeSceneObject > m_SceneObjects;
CDmaElementArray< CDmeWorldPointLight > m_PointLights;
CDmaElementArray< CDmeWorldHemiLight > m_HemiLights;
CDmaElementArray< CDmeWorldSpotLight > m_SpotLights;
};
#endif // DMEWORLDNODE_H