-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
+ For a list of contributors, see the accompanying CONTRIBUTORS file.
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ GtkRadiant is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GtkRadiant is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with GtkRadiant; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float
#pragma warning(disable : 4018) // signed/unsigned mismatch
#endif
#endif
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float
#pragma warning(disable : 4018) // signed/unsigned mismatch
#endif
#endif
- char manufacturer;
- char version;
- char encoding;
- char bits_per_pixel;
- unsigned short xmin,ymin,xmax,ymax;
- unsigned short hres,vres;
- unsigned char palette[48];
- char reserved;
- char color_planes;
- unsigned short bytes_per_line;
- unsigned short palette_type;
- char filler[58];
- unsigned char data; // unbounded
+ char manufacturer;
+ char version;
+ char encoding;
+ char bits_per_pixel;
+ unsigned short xmin,ymin,xmax,ymax;
+ unsigned short hres,vres;
+ unsigned char palette[48];
+ char reserved;
+ char color_planes;
+ unsigned short bytes_per_line;
+ unsigned short palette_type;
+ char filler[58];
+ unsigned char data; // unbounded
- float scale[3]; // multiply byte verts by this
- float translate[3]; // then add this
- char name[16]; // frame name from grabbing
- dtrivertx_t verts[1]; // variable sized
+ float scale[3]; // multiply byte verts by this
+ float translate[3]; // then add this
+ char name[16]; // frame name from grabbing
+ dtrivertx_t verts[1]; // variable sized
- int ident;
- int version;
-
- int skinwidth;
- int skinheight;
- int framesize; // byte size of each frame
-
- int num_skins;
- int num_xyz;
- int num_st; // greater than num_xyz for seams
- int num_tris;
- int num_glcmds; // dwords in strip/fan command list
- int num_frames;
-
- int ofs_skins; // each skin is a MAX_SKINNAME string
- int ofs_st; // byte offset from start for stverts
- int ofs_tris; // offset for dtriangles
- int ofs_frames; // offset for first frame
- int ofs_glcmds;
- int ofs_end; // end of file
+ int ident;
+ int version;
+
+ int skinwidth;
+ int skinheight;
+ int framesize; // byte size of each frame
+
+ int num_skins;
+ int num_xyz;
+ int num_st; // greater than num_xyz for seams
+ int num_tris;
+ int num_glcmds; // dwords in strip/fan command list
+ int num_frames;
+
+ int ofs_skins; // each skin is a MAX_SKINNAME string
+ int ofs_st; // byte offset from start for stverts
+ int ofs_tris; // offset for dtriangles
+ int ofs_frames; // offset for first frame
+ int ofs_glcmds;
+ int ofs_end; // end of file
-#define IDSPRITEHEADER (('2'<<24)+('S'<<16)+('D'<<8)+'I')
- // little-endian "IDS2"
-#define SPRITE_VERSION 2
+#define IDSPRITEHEADER ( ( '2' << 24 ) + ( 'S' << 16 ) + ( 'D' << 8 ) + 'I' )
+// little-endian "IDS2"
+#define SPRITE_VERSION 2
- int width, height;
- int origin_x, origin_y; // raster coordinates inside pic
- char name[MAX_SKINNAME]; // name of pcx file
+ int width, height;
+ int origin_x, origin_y; // raster coordinates inside pic
+ char name[MAX_SKINNAME]; // name of pcx file
- char name[32];
- unsigned width, height;
- unsigned offsets[MIPLEVELS]; // four mip maps stored
- char animname[32]; // next frame in animation chain
- int flags;
- int contents;
- int value;
+ char name[32];
+ unsigned width, height;
+ unsigned offsets[MIPLEVELS]; // four mip maps stored
+ char animname[32]; // next frame in animation chain
+ int flags;
+ int contents;
+ int value;
- /*
- ==============================================================================
-
-- .WAL texture file format
-+ .M8 texture file format
-
- ==============================================================================
+/*
+ ==============================================================================
+
+ - .WAL texture file format
+ + .M8 texture file format
+
+ ==============================================================================
-#define MIP_VERSION 2
-#define PAL_SIZE 256
-#define H2_MIPLEVELS 16
-
- typedef struct miptex_m8_s
- {
- int version;
- char name[32];
- unsigned width[H2_MIPLEVELS], height[H2_MIPLEVELS];
- unsigned offsets[H2_MIPLEVELS]; // four mip maps stored
- char animname[32]; // next frame in animation chain
- palette_t palette[PAL_SIZE];
- int flags;
- int contents;
- int value;
- } miptex_m8_t;
-
-
-#define MIP32_VERSION 4
-
-#define MIP32_NOMIP_FLAG2 0x00000001
-#define MIP32_DETAILER_FLAG2 0x00000002
+#define MIP_VERSION 2
+#define PAL_SIZE 256
+#define H2_MIPLEVELS 16
+
+typedef struct miptex_m8_s
+{
+ int version;
+ char name[32];
+ unsigned width[H2_MIPLEVELS], height[H2_MIPLEVELS];
+ unsigned offsets[H2_MIPLEVELS]; // four mip maps stored
+ char animname[32]; // next frame in animation chain
+ palette_t palette[PAL_SIZE];
+ int flags;
+ int contents;
+ int value;
+} miptex_m8_t;
+
+
+#define MIP32_VERSION 4
+
+#define MIP32_NOMIP_FLAG2 0x00000001
+#define MIP32_DETAILER_FLAG2 0x00000002
- int version;
- char name[128];
- char altname[128]; // texture substitution
- char animname[128]; // next frame in animation chain
- char damagename[128]; // image that should be shown when damaged
- unsigned width[H2_MIPLEVELS], height[H2_MIPLEVELS];
- unsigned offsets[H2_MIPLEVELS];
- int flags;
- int contents;
- int value;
- float scale_x, scale_y;
- int mip_scale;
+ int version;
+ char name[128];
+ char altname[128]; // texture substitution
+ char animname[128]; // next frame in animation chain
+ char damagename[128]; // image that should be shown when damaged
+ unsigned width[H2_MIPLEVELS], height[H2_MIPLEVELS];
+ unsigned offsets[H2_MIPLEVELS];
+ int flags;
+ int contents;
+ int value;
+ float scale_x, scale_y;
+ int mip_scale;
- char dt_name[128]; // detailed texture name
- float dt_scale_x, dt_scale_y;
- float dt_u, dt_v;
- float dt_alpha;
- int dt_src_blend_mode, dt_dst_blend_mode;
-
- int flags2;
- int unused[19]; // future expansion to maintain compatibility with h2
+ char dt_name[128]; // detailed texture name
+ float dt_scale_x, dt_scale_y;
+ float dt_u, dt_v;
+ float dt_alpha;
+ int dt_src_blend_mode, dt_dst_blend_mode;
+
+ int flags2;
+ int unused[19]; // future expansion to maintain compatibility with h2
// upper design bounds
// leaffaces, leafbrushes, planes, and verts are still bounded by
// 16 bit short limits
// upper design bounds
// leaffaces, leafbrushes, planes, and verts are still bounded by
// 16 bit short limits
-#define MAX_MAP_MODELS 1024
-#define MAX_MAP_BRUSHES 8192
-#define MAX_MAP_ENTITIES 2048
-#define MAX_MAP_ENTSTRING 0x40000
-#define MAX_MAP_TEXINFO 8192
-
-#define MAX_MAP_AREAS 256
-#define MAX_MAP_AREAPORTALS 1024
-#define MAX_MAP_PLANES 65536
-#define MAX_MAP_NODES 65536
-#define MAX_MAP_BRUSHSIDES 65536
-#define MAX_MAP_LEAFS 65536
-#define MAX_MAP_VERTS 65536
-#define MAX_MAP_FACES 65536
-#define MAX_MAP_LEAFFACES 65536
-#define MAX_MAP_LEAFBRUSHES 65536
-#define MAX_MAP_PORTALS 65536
-#define MAX_MAP_EDGES 128000
-#define MAX_MAP_SURFEDGES 256000
-#define MAX_MAP_LIGHTING 0x200000
-#define MAX_MAP_VISIBILITY 0x100000
+#define MAX_MAP_MODELS 1024
+#define MAX_MAP_BRUSHES 8192
+#define MAX_MAP_ENTITIES 2048
+#define MAX_MAP_ENTSTRING 0x40000
+#define MAX_MAP_TEXINFO 8192
+
+#define MAX_MAP_AREAS 256
+#define MAX_MAP_AREAPORTALS 1024
+#define MAX_MAP_PLANES 65536
+#define MAX_MAP_NODES 65536
+#define MAX_MAP_BRUSHSIDES 65536
+#define MAX_MAP_LEAFS 65536
+#define MAX_MAP_VERTS 65536
+#define MAX_MAP_FACES 65536
+#define MAX_MAP_LEAFFACES 65536
+#define MAX_MAP_LEAFBRUSHES 65536
+#define MAX_MAP_PORTALS 65536
+#define MAX_MAP_EDGES 128000
+#define MAX_MAP_SURFEDGES 256000
+#define MAX_MAP_LIGHTING 0x200000
+#define MAX_MAP_VISIBILITY 0x100000
-#define LUMP_ENTITIES 0
-#define LUMP_PLANES 1
-#define LUMP_VERTEXES 2
-#define LUMP_VISIBILITY 3
-#define LUMP_NODES 4
-#define LUMP_TEXINFO 5
-#define LUMP_FACES 6
-#define LUMP_LIGHTING 7
-#define LUMP_LEAFS 8
-#define LUMP_LEAFFACES 9
-#define LUMP_LEAFBRUSHES 10
-#define LUMP_EDGES 11
-#define LUMP_SURFEDGES 12
-#define LUMP_MODELS 13
-#define LUMP_BRUSHES 14
-#define LUMP_BRUSHSIDES 15
-#define LUMP_POP 16
-#define LUMP_AREAS 17
-#define LUMP_AREAPORTALS 18
-#define HEADER_LUMPS 19
+#define LUMP_ENTITIES 0
+#define LUMP_PLANES 1
+#define LUMP_VERTEXES 2
+#define LUMP_VISIBILITY 3
+#define LUMP_NODES 4
+#define LUMP_TEXINFO 5
+#define LUMP_FACES 6
+#define LUMP_LIGHTING 7
+#define LUMP_LEAFS 8
+#define LUMP_LEAFFACES 9
+#define LUMP_LEAFBRUSHES 10
+#define LUMP_EDGES 11
+#define LUMP_SURFEDGES 12
+#define LUMP_MODELS 13
+#define LUMP_BRUSHES 14
+#define LUMP_BRUSHSIDES 15
+#define LUMP_POP 16
+#define LUMP_AREAS 17
+#define LUMP_AREAPORTALS 18
+#define HEADER_LUMPS 19
- float mins[3], maxs[3];
- float origin[3]; // for sounds or lights
- int headnode;
- int firstface, numfaces; // submodels just draw faces
- // without walking the bsp tree
+ float mins[3], maxs[3];
+ float origin[3]; // for sounds or lights
+ int headnode;
+ int firstface, numfaces; // submodels just draw faces
+ // without walking the bsp tree
// these definitions also need to be in q_shared.h!
// lower bits are stronger, and will eat weaker brushes completely
// these definitions also need to be in q_shared.h!
// lower bits are stronger, and will eat weaker brushes completely
-#define CONTENTS_SOLID 1 // an eye is never valid in a solid
-#define CONTENTS_WINDOW 2 // translucent, but not watery
-#define CONTENTS_AUX 4
-#define CONTENTS_LAVA 8
-#define CONTENTS_SLIME 16
-#define CONTENTS_WATER 32
-#define CONTENTS_MIST 64
-#define LAST_VISIBLE_CONTENTS 64
+#define CONTENTS_SOLID 1 // an eye is never valid in a solid
+#define CONTENTS_WINDOW 2 // translucent, but not watery
+#define CONTENTS_AUX 4
+#define CONTENTS_LAVA 8
+#define CONTENTS_SLIME 16
+#define CONTENTS_WATER 32
+#define CONTENTS_MIST 64
+#define LAST_VISIBLE_CONTENTS 64
-#define CONTENTS_CURRENT_0 0x40000
-#define CONTENTS_CURRENT_90 0x80000
-#define CONTENTS_CURRENT_180 0x100000
-#define CONTENTS_CURRENT_270 0x200000
-#define CONTENTS_CURRENT_UP 0x400000
-#define CONTENTS_CURRENT_DOWN 0x800000
+#define CONTENTS_CURRENT_0 0x40000
+#define CONTENTS_CURRENT_90 0x80000
+#define CONTENTS_CURRENT_180 0x100000
+#define CONTENTS_CURRENT_270 0x200000
+#define CONTENTS_CURRENT_UP 0x400000
+#define CONTENTS_CURRENT_DOWN 0x800000
-#define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game
-#define CONTENTS_DEADMONSTER 0x4000000
-#define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs
-#define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans
-#define CONTENTS_LADDER 0x20000000
+#define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game
+#define CONTENTS_DEADMONSTER 0x4000000
+#define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs
+#define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans
+#define CONTENTS_LADDER 0x20000000
-#define SURF_SKY 0x4 // don't draw, but add to skybox
-#define SURF_WARP 0x8 // turbulent water warp
-#define SURF_TRANS33 0x10
-#define SURF_TRANS66 0x20
-#define SURF_FLOWING 0x40 // scroll towards angle
-#define SURF_NODRAW 0x80 // don't bother referencing the texture
+#define SURF_SKY 0x4 // don't draw, but add to skybox
+#define SURF_WARP 0x8 // turbulent water warp
+#define SURF_TRANS33 0x10
+#define SURF_TRANS66 0x20
+#define SURF_FLOWING 0x40 // scroll towards angle
+#define SURF_NODRAW 0x80 // don't bother referencing the texture
-#define SURF_HINT 0x100 // make a primary bsp splitter
-#define SURF_SKIP 0x200 // completely ignore, allowing non-closed brushes
+#define SURF_HINT 0x100 // make a primary bsp splitter
+#define SURF_SKIP 0x200 // completely ignore, allowing non-closed brushes
- int planenum;
- int children[2]; // negative numbers are -(leafs+1), not nodes
- short mins[3]; // for frustom culling
- short maxs[3];
- unsigned short firstface;
- unsigned short numfaces; // counting both sides
+ int planenum;
+ int children[2]; // negative numbers are -(leafs+1), not nodes
+ short mins[3]; // for frustom culling
+ short maxs[3];
+ unsigned short firstface;
+ unsigned short numfaces; // counting both sides
- float vecs[2][4]; // [s/t][xyz offset]
- int flags; // miptex flags + overrides
- int value; // light emission, etc
- char texture[32]; // texture name (textures/*.wal)
- int nexttexinfo; // for animations, -1 = end of chain
+ float vecs[2][4]; // [s/t][xyz offset]
+ int flags; // miptex flags + overrides
+ int value; // light emission, etc
+ char texture[32]; // texture name (textures/*.wal)
+ int nexttexinfo; // for animations, -1 = end of chain
// the visibility lump consists of a header with a count, then
// byte offsets for the PVS and PHS of each cluster, then the raw
// compressed bit vectors
// the visibility lump consists of a header with a count, then
// byte offsets for the PVS and PHS of each cluster, then the raw
// compressed bit vectors