Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

l_bsp_hl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  hl_dclipnode_t
struct  hl_dedge_t
struct  hl_dface_t
struct  hl_dheader_t
struct  hl_dleaf_t
struct  hl_dmiptexlump_t
struct  hl_dmodel_t
struct  hl_dnode_t
struct  hl_dplane_t
struct  hl_dvertex_t
struct  hl_lump_t
struct  hl_miptex_s
struct  hl_texinfo_s

Defines

#define AMBIENT_LAVA   3
#define AMBIENT_SKY   1
#define AMBIENT_SLIME   2
#define AMBIENT_WATER   0
#define ANGLE_DOWN   -2
#define ANGLE_UP   -1
#define HL_BSPVERSION   30
#define HL_CONTENTS_CLIP   -8
#define HL_CONTENTS_CURRENT_0   -9
#define HL_CONTENTS_CURRENT_180   -11
#define HL_CONTENTS_CURRENT_270   -12
#define HL_CONTENTS_CURRENT_90   -10
#define HL_CONTENTS_CURRENT_DOWN   -14
#define HL_CONTENTS_CURRENT_UP   -13
#define HL_CONTENTS_EMPTY   -1
#define HL_CONTENTS_LAVA   -5
#define HL_CONTENTS_ORIGIN   -7
#define HL_CONTENTS_SKY   -6
#define HL_CONTENTS_SLIME   -4
#define HL_CONTENTS_SOLID   -2
#define HL_CONTENTS_TRANSLUCENT   -15
#define HL_CONTENTS_WATER   -3
#define HL_HEADER_LUMPS   15
#define HL_LUMP_CLIPNODES   9
#define HL_LUMP_EDGES   12
#define HL_LUMP_ENTITIES   0
#define HL_LUMP_FACES   7
#define HL_LUMP_LEAFS   10
#define HL_LUMP_LIGHTING   8
#define HL_LUMP_MARKSURFACES   11
#define HL_LUMP_MODELS   14
#define HL_LUMP_NODES   5
#define HL_LUMP_PLANES   1
#define HL_LUMP_SURFEDGES   13
#define HL_LUMP_TEXINFO   6
#define HL_LUMP_TEXTURES   2
#define HL_LUMP_VERTEXES   3
#define HL_LUMP_VISIBILITY   4
#define HL_MAX_MAP_BRUSHES   4096
#define HL_MAX_MAP_CLIPNODES   32767
#define HL_MAX_MAP_EDGES   256000
#define HL_MAX_MAP_ENTITIES   1024
#define HL_MAX_MAP_ENTSTRING   (128*1024)
#define HL_MAX_MAP_FACES   65535
#define HL_MAX_MAP_HULLS   4
#define HL_MAX_MAP_LEAFS   8192
#define HL_MAX_MAP_LIGHTING   0x200000
#define HL_MAX_MAP_MARKSURFACES   65535
#define HL_MAX_MAP_MIPTEX   0x200000
#define HL_MAX_MAP_MODELS   400
#define HL_MAX_MAP_NODES   32767
#define HL_MAX_MAP_PLANES   32767
#define HL_MAX_MAP_PORTALS   65536
#define HL_MAX_MAP_SURFEDGES   512000
#define HL_MAX_MAP_TEXINFO   8192
#define HL_MAX_MAP_TEXTURES   512
#define HL_MAX_MAP_VERTS   65535
#define HL_MAX_MAP_VISIBILITY   0x200000
#define HL_TOOLVERSION   2
#define MAX_KEY   32
#define MAX_VALUE   1024
#define MAXLIGHTMAPS   4
#define MIPLEVELS   4
#define NUM_AMBIENTS   4
#define PLANE_ANYX   3
#define PLANE_ANYY   4
#define PLANE_ANYZ   5
#define PLANE_X   0
#define PLANE_Y   1
#define PLANE_Z   2
#define TEX_SPECIAL   1

Typedefs

typedef hl_miptex_s hl_miptex_t
typedef hl_texinfo_s hl_texinfo_t

Functions

int FastChecksum (void *buffer, int bytes)
void HL_AllocMaxBSP (void)
int HL_CompressVis (byte *vis, byte *dest)
void HL_DecompressVis (byte *in, byte *decompressed)
void HL_FreeMaxBSP (void)
void HL_LoadBSPFile (char *filename, int offset, int length)
void HL_ParseEntities (void)
void HL_PrintBSPFileSizes (void)
void HL_UnparseEntities (void)
void HL_WriteBSPFile (char *filename)

Variables

hl_dclipnode_thl_dclipnodes
int hl_dclipnodes_checksum
hl_dedge_thl_dedges
int hl_dedges_checksum
char * hl_dentdata
int hl_dentdata_checksum
hl_dface_thl_dfaces
int hl_dfaces_checksum
hl_dleaf_thl_dleafs
int hl_dleafs_checksum
bytehl_dlightdata
int hl_dlightdata_checksum
unsigned short * hl_dmarksurfaces
int hl_dmarksurfaces_checksum
hl_dmodel_thl_dmodels
int hl_dmodels_checksum
hl_dnode_thl_dnodes
int hl_dnodes_checksum
hl_dplane_thl_dplanes
int hl_dplanes_checksum
int * hl_dsurfedges
int hl_dsurfedges_checksum
bytehl_dtexdata
int hl_dtexdata_checksum
hl_dvertex_thl_dvertexes
int hl_dvertexes_checksum
bytehl_dvisdata
int hl_dvisdata_checksum
int hl_entdatasize
int hl_lightdatasize
int hl_numclipnodes
int hl_numedges
int hl_numfaces
int hl_numleafs
int hl_nummarksurfaces
int hl_nummodels
int hl_numnodes
int hl_numplanes
int hl_numsurfedges
int hl_numtexinfo
int hl_numvertexes
int hl_texdatasize
hl_texinfo_thl_texinfo
int hl_texinfo_checksum
int hl_visdatasize


Define Documentation

#define AMBIENT_LAVA   3
 

Definition at line 208 of file l_bsp_hl.h.

#define AMBIENT_SKY   1
 

Definition at line 206 of file l_bsp_hl.h.

#define AMBIENT_SLIME   2
 

Definition at line 207 of file l_bsp_hl.h.

#define AMBIENT_WATER   0
 

Definition at line 205 of file l_bsp_hl.h.

#define ANGLE_DOWN   -2
 

Definition at line 234 of file l_bsp_hl.h.

#define ANGLE_UP   -1
 

Definition at line 233 of file l_bsp_hl.h.

#define HL_BSPVERSION   30
 

Definition at line 56 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_CONTENTS_CLIP   -8
 

Definition at line 145 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_CURRENT_0   -9
 

Definition at line 147 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_CURRENT_180   -11
 

Definition at line 149 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_CURRENT_270   -12
 

Definition at line 150 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_CURRENT_90   -10
 

Definition at line 148 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_CURRENT_DOWN   -14
 

Definition at line 152 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_CURRENT_UP   -13
 

Definition at line 151 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_EMPTY   -1
 

Definition at line 138 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_LAVA   -5
 

Definition at line 142 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_ORIGIN   -7
 

Definition at line 144 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_SKY   -6
 

Definition at line 143 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_SLIME   -4
 

Definition at line 141 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_SOLID   -2
 

Definition at line 139 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_TRANSLUCENT   -15
 

Definition at line 154 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_CONTENTS_WATER   -3
 

Definition at line 140 of file l_bsp_hl.h.

Referenced by HL_CreateBrushes_r(), and HL_SolidTree_r().

#define HL_HEADER_LUMPS   15
 

Definition at line 81 of file l_bsp_hl.h.

#define HL_LUMP_CLIPNODES   9
 

Definition at line 74 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_EDGES   12
 

Definition at line 77 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_ENTITIES   0
 

Definition at line 65 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_FACES   7
 

Definition at line 72 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_LEAFS   10
 

Definition at line 75 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_LIGHTING   8
 

Definition at line 73 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_MARKSURFACES   11
 

Definition at line 76 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_MODELS   14
 

Definition at line 79 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_NODES   5
 

Definition at line 70 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_PLANES   1
 

Definition at line 66 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_SURFEDGES   13
 

Definition at line 78 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_TEXINFO   6
 

Definition at line 71 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_TEXTURES   2
 

Definition at line 67 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_VERTEXES   3
 

Definition at line 68 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_LUMP_VISIBILITY   4
 

Definition at line 69 of file l_bsp_hl.h.

Referenced by HL_LoadBSPFile(), and HL_WriteBSPFile().

#define HL_MAX_MAP_BRUSHES   4096
 

Definition at line 27 of file l_bsp_hl.h.

#define HL_MAX_MAP_CLIPNODES   32767
 

Definition at line 33 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_EDGES   256000
 

Definition at line 39 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_ENTITIES   1024
 

Definition at line 28 of file l_bsp_hl.h.

#define HL_MAX_MAP_ENTSTRING   (128*1024)
 

Definition at line 29 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_FACES   65535
 

Definition at line 36 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_HULLS   4
 

Definition at line 24 of file l_bsp_hl.h.

#define HL_MAX_MAP_LEAFS   8192
 

Definition at line 34 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_LIGHTING   0x200000
 

Definition at line 43 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_MARKSURFACES   65535
 

Definition at line 37 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_MIPTEX   0x200000
 

Definition at line 42 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_MODELS   400
 

Definition at line 26 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_NODES   32767
 

Definition at line 32 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_PLANES   32767
 

Definition at line 31 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_PORTALS   65536
 

Definition at line 46 of file l_bsp_hl.h.

#define HL_MAX_MAP_SURFEDGES   512000
 

Definition at line 40 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_TEXINFO   8192
 

Definition at line 38 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_TEXTURES   512
 

Definition at line 41 of file l_bsp_hl.h.

#define HL_MAX_MAP_VERTS   65535
 

Definition at line 35 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_MAX_MAP_VISIBILITY   0x200000
 

Definition at line 44 of file l_bsp_hl.h.

Referenced by HL_AllocMaxBSP(), and HL_LoadBSPFile().

#define HL_TOOLVERSION   2
 

Definition at line 57 of file l_bsp_hl.h.

#define MAX_KEY   32
 

Definition at line 50 of file l_bsp_hl.h.

#define MAX_VALUE   1024
 

Definition at line 51 of file l_bsp_hl.h.

#define MAXLIGHTMAPS   4
 

Definition at line 189 of file l_bsp_hl.h.

#define MIPLEVELS   4
 

Definition at line 104 of file l_bsp_hl.h.

#define NUM_AMBIENTS   4
 

Definition at line 210 of file l_bsp_hl.h.

#define PLANE_ANYX   3
 

Definition at line 125 of file l_bsp_hl.h.

#define PLANE_ANYY   4
 

Definition at line 126 of file l_bsp_hl.h.

#define PLANE_ANYZ   5
 

Definition at line 127 of file l_bsp_hl.h.

#define PLANE_X   0
 

Definition at line 120 of file l_bsp_hl.h.

Referenced by PointInSolid_r(), and TraceLine_r().

#define PLANE_Y   1
 

Definition at line 121 of file l_bsp_hl.h.

Referenced by PointInSolid_r(), and TraceLine_r().

#define PLANE_Z   2
 

Definition at line 122 of file l_bsp_hl.h.

Referenced by PointInSolid_r(), and TraceLine_r().

#define TEX_SPECIAL   1
 

Definition at line 180 of file l_bsp_hl.h.


Typedef Documentation

typedef struct hl_miptex_s hl_miptex_t
 

Referenced by HL_TextureBrushes().

typedef struct hl_texinfo_s hl_texinfo_t
 

Referenced by HL_AllocMaxBSP(), HL_LoadBSPFile(), and HL_WriteBSPFile().


Function Documentation

int FastChecksum void *  buffer,
int  bytes
 

Definition at line 245 of file l_bsp_hl.c.

Referenced by HL_LoadBSPFile().

00246 {
00247     int checksum = 0;
00248 
00249     while( bytes-- )  
00250         checksum = (checksum << 4) ^ *((char *)buffer)++;
00251 
00252     return checksum;
00253 }

void HL_AllocMaxBSP void   ) 
 

Definition at line 101 of file l_bsp_hl.c.

References byte, GetMemory(), hl_allocatedbspmem, hl_dclipnodes, hl_dedges, hl_dentdata, hl_dfaces, hl_dleafs, hl_dlightdata, hl_dmarksurfaces, hl_dmodels, hl_dnodes, hl_dplanes, hl_dsurfedges, hl_dtexdata, hl_dvertexes, hl_dvisdata, hl_entdatasize, hl_lightdatasize, HL_MAX_MAP_CLIPNODES, HL_MAX_MAP_EDGES, HL_MAX_MAP_ENTSTRING, HL_MAX_MAP_FACES, HL_MAX_MAP_LEAFS, HL_MAX_MAP_LIGHTING, HL_MAX_MAP_MARKSURFACES, HL_MAX_MAP_MIPTEX, HL_MAX_MAP_MODELS, HL_MAX_MAP_NODES, HL_MAX_MAP_PLANES, HL_MAX_MAP_SURFEDGES, HL_MAX_MAP_TEXINFO, HL_MAX_MAP_VERTS, HL_MAX_MAP_VISIBILITY, hl_numclipnodes, hl_numedges, hl_numfaces, hl_numleafs, hl_nummarksurfaces, hl_nummodels, hl_numnodes, hl_numplanes, hl_numsurfedges, hl_numtexinfo, hl_numvertexes, hl_texdatasize, hl_texinfo, hl_texinfo_t, hl_visdatasize, Log_Print(), and PrintMemorySize().

Referenced by LoadMapFromBSP().

00102 {
00103     //models
00104     hl_nummodels = 0;
00105     hl_dmodels = (hl_dmodel_t *) GetMemory(HL_MAX_MAP_MODELS * sizeof(hl_dmodel_t));
00106     hl_allocatedbspmem = HL_MAX_MAP_MODELS * sizeof(hl_dmodel_t);
00107     //visibility
00108     hl_visdatasize = 0;
00109     hl_dvisdata = (byte *) GetMemory(HL_MAX_MAP_VISIBILITY * sizeof(byte));
00110     hl_allocatedbspmem += HL_MAX_MAP_VISIBILITY * sizeof(byte);
00111     //light data
00112     hl_lightdatasize = 0;
00113     hl_dlightdata = (byte *) GetMemory(HL_MAX_MAP_LIGHTING * sizeof(byte));
00114     hl_allocatedbspmem += HL_MAX_MAP_LIGHTING * sizeof(byte);
00115     //texture data
00116     hl_texdatasize = 0;
00117     hl_dtexdata = (byte *) GetMemory(HL_MAX_MAP_MIPTEX * sizeof(byte)); // (dmiptexlump_t)
00118     hl_allocatedbspmem += HL_MAX_MAP_MIPTEX * sizeof(byte);
00119     //entities
00120     hl_entdatasize = 0;
00121     hl_dentdata = (char *) GetMemory(HL_MAX_MAP_ENTSTRING * sizeof(char));
00122     hl_allocatedbspmem += HL_MAX_MAP_ENTSTRING * sizeof(char);
00123     //leaves
00124     hl_numleafs = 0;
00125     hl_dleafs = (hl_dleaf_t *) GetMemory(HL_MAX_MAP_LEAFS * sizeof(hl_dleaf_t));
00126     hl_allocatedbspmem += HL_MAX_MAP_LEAFS * sizeof(hl_dleaf_t);
00127     //planes
00128     hl_numplanes = 0;
00129     hl_dplanes = (hl_dplane_t *) GetMemory(HL_MAX_MAP_PLANES * sizeof(hl_dplane_t));
00130     hl_allocatedbspmem += HL_MAX_MAP_PLANES * sizeof(hl_dplane_t);
00131     //vertexes
00132     hl_numvertexes = 0;
00133     hl_dvertexes = (hl_dvertex_t *) GetMemory(HL_MAX_MAP_VERTS * sizeof(hl_dvertex_t));
00134     hl_allocatedbspmem += HL_MAX_MAP_VERTS * sizeof(hl_dvertex_t);
00135     //nodes
00136     hl_numnodes = 0;
00137     hl_dnodes = (hl_dnode_t *) GetMemory(HL_MAX_MAP_NODES * sizeof(hl_dnode_t));
00138     hl_allocatedbspmem += HL_MAX_MAP_NODES * sizeof(hl_dnode_t);
00139     //texture info
00140     hl_numtexinfo = 0;
00141     hl_texinfo = (hl_texinfo_t *) GetMemory(HL_MAX_MAP_TEXINFO * sizeof(hl_texinfo_t));
00142     hl_allocatedbspmem += HL_MAX_MAP_TEXINFO * sizeof(hl_texinfo_t);
00143     //faces
00144     hl_numfaces = 0;
00145     hl_dfaces = (hl_dface_t *) GetMemory(HL_MAX_MAP_FACES * sizeof(hl_dface_t));
00146     hl_allocatedbspmem += HL_MAX_MAP_FACES * sizeof(hl_dface_t);
00147     //clip nodes
00148     hl_numclipnodes = 0;
00149     hl_dclipnodes = (hl_dclipnode_t *) GetMemory(HL_MAX_MAP_CLIPNODES * sizeof(hl_dclipnode_t));
00150     hl_allocatedbspmem += HL_MAX_MAP_CLIPNODES * sizeof(hl_dclipnode_t);
00151     //edges
00152     hl_numedges = 0;
00153     hl_dedges = (hl_dedge_t *) GetMemory(HL_MAX_MAP_EDGES * sizeof(hl_dedge_t));
00154     hl_allocatedbspmem += HL_MAX_MAP_EDGES, sizeof(hl_dedge_t);
00155     //mark surfaces
00156     hl_nummarksurfaces = 0;
00157     hl_dmarksurfaces = (unsigned short *) GetMemory(HL_MAX_MAP_MARKSURFACES * sizeof(unsigned short));
00158     hl_allocatedbspmem += HL_MAX_MAP_MARKSURFACES * sizeof(unsigned short);
00159     //surface edges
00160     hl_numsurfedges = 0;
00161     hl_dsurfedges = (int *) GetMemory(HL_MAX_MAP_SURFEDGES * sizeof(int));
00162     hl_allocatedbspmem += HL_MAX_MAP_SURFEDGES * sizeof(int);
00163     //print allocated memory
00164     Log_Print("allocated ");
00165     PrintMemorySize(hl_allocatedbspmem);
00166     Log_Print(" of BSP memory\n");
00167 } //end of the function HL_AllocMaxBSP

Here is the call graph for this function:

int HL_CompressVis byte vis,
byte dest
 

Definition at line 260 of file l_bsp_hl.c.

References byte, hl_numleafs, and j.

00261 {
00262     int     j;
00263     int     rep;
00264     int     visrow;
00265     byte    *dest_p;
00266     
00267     dest_p = dest;
00268     visrow = (hl_numleafs + 7)>>3;
00269     
00270     for (j=0 ; j<visrow ; j++)
00271     {
00272         *dest_p++ = vis[j];
00273         if (vis[j])
00274             continue;
00275 
00276         rep = 1;
00277         for ( j++; j<visrow ; j++)
00278             if (vis[j] || rep == 255)
00279                 break;
00280             else
00281                 rep++;
00282         *dest_p++ = rep;
00283         j--;
00284     }
00285     
00286     return dest_p - dest;
00287 }

void HL_DecompressVis byte in,
byte decompressed
 

Definition at line 295 of file l_bsp_hl.c.

References byte, c, hl_numleafs, and in.

00296 {
00297     int     c;
00298     byte    *out;
00299     int     row;
00300 
00301     row = (hl_numleafs+7)>>3;   
00302     out = decompressed;
00303 
00304     do
00305     {
00306         if (*in)
00307         {
00308             *out++ = *in++;
00309             continue;
00310         }
00311     
00312         c = in[1];
00313         in += 2;
00314         while (c)
00315         {
00316             *out++ = 0;
00317             c--;
00318         }
00319     } while (out - decompressed < row);
00320 }

void HL_FreeMaxBSP void   ) 
 

Definition at line 169 of file l_bsp_hl.c.

References FreeMemory(), hl_allocatedbspmem, hl_dclipnodes, hl_dedges, hl_dentdata, hl_dfaces, hl_dleafs, hl_dlightdata, hl_dmarksurfaces, hl_dmodels, hl_dnodes, hl_dplanes, hl_dsurfedges, hl_dtexdata, hl_dvertexes, hl_dvisdata, hl_entdatasize, hl_lightdatasize, hl_numclipnodes, hl_numedges, hl_numfaces, hl_numleafs, hl_nummarksurfaces, hl_nummodels, hl_numnodes, hl_numplanes, hl_numsurfedges, hl_numtexinfo, hl_numvertexes, hl_texdatasize, hl_texinfo, hl_visdatasize, Log_Print(), and PrintMemorySize().

Referenced by LoadMapFromBSP().

00170 {
00171     //models
00172     hl_nummodels = 0;
00173     FreeMemory(hl_dmodels);
00174     hl_dmodels = NULL;
00175     //visibility
00176     hl_visdatasize = 0;
00177     FreeMemory(hl_dvisdata);
00178     hl_dvisdata = NULL;
00179     //light data
00180     hl_lightdatasize = 0;
00181     FreeMemory(hl_dlightdata);
00182     hl_dlightdata = NULL;
00183     //texture data
00184     hl_texdatasize = 0;
00185     FreeMemory(hl_dtexdata);
00186     hl_dtexdata = NULL;
00187     //entities
00188     hl_entdatasize = 0;
00189     FreeMemory(hl_dentdata);
00190     hl_dentdata = NULL;
00191     //leaves
00192     hl_numleafs = 0;
00193     FreeMemory(hl_dleafs);
00194     hl_dleafs = NULL;
00195     //planes
00196     hl_numplanes = 0;
00197     FreeMemory(hl_dplanes);
00198     hl_dplanes = NULL;
00199     //vertexes
00200     hl_numvertexes = 0;
00201     FreeMemory(hl_dvertexes);
00202     hl_dvertexes = NULL;
00203     //nodes
00204     hl_numnodes = 0;
00205     FreeMemory(hl_dnodes);
00206     hl_dnodes = NULL;
00207     //texture info
00208     hl_numtexinfo = 0;
00209     FreeMemory(hl_texinfo);
00210     hl_texinfo = NULL;
00211     //faces
00212     hl_numfaces = 0;
00213     FreeMemory(hl_dfaces);
00214     hl_dfaces = NULL;
00215     //clip nodes
00216     hl_numclipnodes = 0;
00217     FreeMemory(hl_dclipnodes);
00218     hl_dclipnodes = NULL;
00219     //edges
00220     hl_numedges = 0;
00221     FreeMemory(hl_dedges);
00222     hl_dedges = NULL;
00223     //mark surfaces
00224     hl_nummarksurfaces = 0;
00225     FreeMemory(hl_dmarksurfaces);
00226     hl_dmarksurfaces = NULL;
00227     //surface edges
00228     hl_numsurfedges = 0;
00229     FreeMemory(hl_dsurfedges);
00230     hl_dsurfedges = NULL;
00231     //
00232     Log_Print("freed ");
00233     PrintMemorySize(hl_allocatedbspmem);
00234     Log_Print(" of BSP memory\n");
00235     hl_allocatedbspmem = 0;
00236 } //end of the function HL_FreeMaxBSP

Here is the call graph for this function:

void HL_LoadBSPFile char *  filename,
int  offset,
int  length
 

Definition at line 520 of file l_bsp_hl.c.

References Error(), FastChecksum(), FreeMemory(), HL_BSPVERSION, HL_CopyLump(), hl_dclipnodes, hl_dclipnodes_checksum, hl_dedges, hl_dedges_checksum, hl_dentdata, hl_dentdata_checksum, hl_dfaces, hl_dfaces_checksum, hl_dleafs, hl_dleafs_checksum, hl_dlightdata, hl_dlightdata_checksum, hl_dmarksurfaces, hl_dmarksurfaces_checksum, hl_dmodels, hl_dmodels_checksum, hl_dnodes, hl_dnodes_checksum, hl_dplanes, hl_dplanes_checksum, hl_dsurfedges, hl_dsurfedges_checksum, hl_dtexdata, hl_dtexdata_checksum, hl_dvertexes, hl_dvertexes_checksum, hl_dvisdata, hl_dvisdata_checksum, hl_entdatasize, hl_fileLength, hl_header, hl_lightdatasize, HL_LUMP_CLIPNODES,