mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
Add missing files from last sync.
This commit is contained in:
87
public/materialsystem/hardwaretexels.h
Normal file
87
public/materialsystem/hardwaretexels.h
Normal file
@ -0,0 +1,87 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Hardware Texels
|
||||
//
|
||||
// Contains texture data that was encoded with the map. The initial use case
|
||||
// is for per-texel lightmaps to allow static props to match the lighting
|
||||
// of the surrounding BSP geometry.
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef HARDWARETEXELS_H
|
||||
#define HARDWARETEXELS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "bitmap/imageformat.h"
|
||||
#include "datamap.h"
|
||||
|
||||
// valve hardware texels
|
||||
#define VHT_VERSION 0
|
||||
|
||||
namespace HardwareTexels
|
||||
{
|
||||
#pragma pack(1)
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
struct MeshHeader_t
|
||||
{
|
||||
DECLARE_BYTESWAP_DATADESC();
|
||||
|
||||
// this mesh is part of this lod
|
||||
unsigned int m_nLod;
|
||||
|
||||
// starting at this offset
|
||||
unsigned int m_nOffset;
|
||||
|
||||
// this mesh consumes this many bytes
|
||||
unsigned int m_nBytes;
|
||||
|
||||
// with this width and height
|
||||
unsigned int m_nWidth;
|
||||
unsigned int m_nHeight;
|
||||
|
||||
unsigned int m_nUnused[3];
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
struct FileHeader_t
|
||||
{
|
||||
DECLARE_BYTESWAP_DATADESC();
|
||||
|
||||
// file version as defined by VHV_VERSION
|
||||
int m_nVersion;
|
||||
|
||||
// must match checkSum in the .mdl header
|
||||
unsigned int m_nChecksum;
|
||||
|
||||
// all texels are encoded in the same format
|
||||
// This is a value from ImageFormat.
|
||||
unsigned int m_nTexelFormat;
|
||||
|
||||
// Number of meshes
|
||||
int m_nMeshes;
|
||||
|
||||
inline MeshHeader_t *pMesh( int nMesh ) const
|
||||
{
|
||||
Assert(nMesh < m_nMeshes);
|
||||
|
||||
return (MeshHeader_t *)(((byte *)this) + sizeof(FileHeader_t)) + nMesh;
|
||||
};
|
||||
|
||||
inline void *pTexelBase( int nMesh ) const
|
||||
{
|
||||
return (void *)((byte *)this + pMesh( nMesh )->m_nOffset);
|
||||
};
|
||||
|
||||
unsigned int m_nUnused[4];
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
}; // end namespace
|
||||
|
||||
#endif // HARDWARETEXELS_H
|
||||
|
Reference in New Issue
Block a user