-
Notifications
You must be signed in to change notification settings - Fork 6
/
VisibleBsp.h
96 lines (80 loc) · 2.41 KB
/
VisibleBsp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// VisibleBsp.h: interface for the CVisibleBsp class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_VISIBLEBSP_H__465524FD_32DD_4AD0_A88B_80069D55A9EF__INCLUDED_)
#define AFX_VISIBLEBSP_H__465524FD_32DD_4AD0_A88B_80069D55A9EF__INCLUDED_
#include "HaloStructDefs.h"
#include "Util.h"
#include "CollBsp.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct STRUCT_BSP_XREF
{
char name[128];
UINT offset;
UINT count;
}BSP_XREF;
#define BSP_XREF_COUNT 42
class CVisibleBsp : public CUtil
{
public:
void LoadDetailObjects();
void LoadRuntimeDecals();
void LoadSounds(void);
void LoadPathfindingSurface(void);
void DrawClusterPortals(void);
BOOL LoadSection(CFile* pMapFile, REFLEXIVE* pReflexive, int reflexive_element_size, UINT magic);
void LoadTriIndices(void);
void LoadLightmapBsp();
void LoadShaders(void);
void LoadClusters(void);
CVisibleBsp();
virtual ~CVisibleBsp();
CString GetMeshInfo(int mesh_index);
void Cleanup(void);
void LoadVisibleBsp(UINT BspHdrOffset, UINT version);
void Initialize(CFile *pMapFile, UINT magic, UINT bsp_magic);
void GetMapCentroid(float *cx, float *cy, float *cz);
void DumpBoundingBoxInfo(int mesh_index);
void ExportPcMeshToObj(CString path);
void ExportXboxMeshToObj(CString path);
UINT m_SubMeshCount;
SUBMESH_INFO *m_pMesh;
BSP_WEATHER *m_pWeather;
CCollBsp m_CollBsp;
BSP_XREF m_BspXrefs[BSP_XREF_COUNT];
protected:
void LoadReflectionBlock();
void InitBspXrefs(void);
void LoadWeather(void);
void LoadXboxSubmeshes(void);
void LoadMaterialMeshHeaders(void);
void LoadPcSubmeshes(void);
void UpdateBoundingBox(int mesh_index, float *pCoord, UINT version);
void ResetBoundingBox(void);
CFile *m_pMapFile;
UINT m_BspMagic;
UINT m_Magic;
BSP_HEADER m_BspHeader;
BSP_LIGHTMAP *m_pLightmaps;
BOUNDING_BOX m_MapBox;
BSP_CLUSTER *m_pClusters;
BSP_SHADER *m_pShaders;
BSP_NODES *m_pNodes;
BSP_LEAF *m_pLeaves;
BSP_LEAF_SURFACE *m_pLeafSurfaces;
TRI_INDICES *m_pTriIndices;
BYTE *m_pClusterData;
BYTE *m_pPathfindingSurface;
BSP_BACKGROUND_SOUND *m_pBackgroundSounds;
BSP_SOUND_ENV* m_pSoundEnv;
BYTE *m_pPASData;
BSP_DETAIL_OBJECT* m_pDetailObjects;
BSP_RUNTIME_DECAL* m_pRuntimeDecals;
float m_Centroid[3];
UINT m_CentroidCount;
int m_ActiveBsp;
int m_TriTotal;
};
#endif // !defined(AFX_VISIBLEBSP_H__465524FD_32DD_4AD0_A88B_80069D55A9EF__INCLUDED_)