From c7ddc423f67236a99956960cf9fe89abf077839b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 5 Sep 2008 00:02:14 +0000 Subject: Reformat (beautify) Raven sources and add GPL headers. Subversion-branch: /branches/raven-branch Subversion-revision: 1197 --- src/hexen/xddefs.h | 245 ++++++++++++++++++++++++++++------------------------- 1 file changed, 129 insertions(+), 116 deletions(-) (limited to 'src/hexen/xddefs.h') diff --git a/src/hexen/xddefs.h b/src/hexen/xddefs.h index a16af27f..2370b02a 100644 --- a/src/hexen/xddefs.h +++ b/src/hexen/xddefs.h @@ -1,21 +1,34 @@ +// Emacs style mode select -*- C++ -*- +//----------------------------------------------------------------------------- +// +// Copyright(C) 1993-1996 Id Software, Inc. +// Copyright(C) 1993-2008 Raven Software +// +// This program 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. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. +// +//----------------------------------------------------------------------------- -//************************************************************************** -//** -//** xddefs.h : Heretic 2 : Raven Software, Corp. -//** -//** $RCSfile: xddefs.h,v $ -//** $Revision: 1.4 $ -//** $Date: 95/08/11 10:22:08 $ -//** $Author: bgokey $ -//** -//************************************************************************** #ifndef __XDDEFS__ #define __XDDEFS__ #ifndef __BYTEBOOL__ #define __BYTEBOOL__ -typedef enum {false, true} boolean; +typedef enum +{ false, true } boolean; typedef unsigned char byte; #endif @@ -28,48 +41,48 @@ typedef unsigned char byte; // lump order in a map wad enum { - ML_LABEL, - ML_THINGS, - ML_LINEDEFS, - ML_SIDEDEFS, - ML_VERTEXES, - ML_SEGS, - ML_SSECTORS, - ML_NODES, - ML_SECTORS, - ML_REJECT, - ML_BLOCKMAP, - ML_BEHAVIOR + ML_LABEL, + ML_THINGS, + ML_LINEDEFS, + ML_SIDEDEFS, + ML_VERTEXES, + ML_SEGS, + ML_SSECTORS, + ML_NODES, + ML_SECTORS, + ML_REJECT, + ML_BLOCKMAP, + ML_BEHAVIOR }; typedef struct { - short x; - short y; + short x; + short y; } mapvertex_t; typedef struct { - short textureoffset; - short rowoffset; - char toptexture[8]; - char bottomtexture[8]; - char midtexture[8]; - short sector; // on viewer's side + short textureoffset; + short rowoffset; + char toptexture[8]; + char bottomtexture[8]; + char midtexture[8]; + short sector; // on viewer's side } mapsidedef_t; typedef struct { - short v1; - short v2; - short flags; - byte special; - byte arg1; - byte arg2; - byte arg3; - byte arg4; - byte arg5; - short sidenum[2]; // sidenum[1] will be -1 if one sided + short v1; + short v2; + short flags; + byte special; + byte arg1; + byte arg2; + byte arg3; + byte arg4; + byte arg5; + short sidenum[2]; // sidenum[1] will be -1 if one sided } maplinedef_t; #define ML_BLOCKING 0x0001 @@ -77,81 +90,81 @@ typedef struct #define ML_TWOSIDED 0x0004 #define ML_DONTPEGTOP 0x0008 #define ML_DONTPEGBOTTOM 0x0010 -#define ML_SECRET 0x0020 // don't map as two sided: IT'S A SECRET! -#define ML_SOUNDBLOCK 0x0040 // don't let sound cross two of these -#define ML_DONTDRAW 0x0080 // don't draw on the automap -#define ML_MAPPED 0x0100 // set if already drawn in automap -#define ML_REPEAT_SPECIAL 0x0200 // special is repeatable +#define ML_SECRET 0x0020 // don't map as two sided: IT'S A SECRET! +#define ML_SOUNDBLOCK 0x0040 // don't let sound cross two of these +#define ML_DONTDRAW 0x0080 // don't draw on the automap +#define ML_MAPPED 0x0100 // set if already drawn in automap +#define ML_REPEAT_SPECIAL 0x0200 // special is repeatable #define ML_SPAC_SHIFT 10 #define ML_SPAC_MASK 0x1c00 #define GET_SPAC(flags) ((flags&ML_SPAC_MASK)>>ML_SPAC_SHIFT) // Special activation types -#define SPAC_CROSS 0 // when player crosses line -#define SPAC_USE 1 // when player uses line -#define SPAC_MCROSS 2 // when monster crosses line -#define SPAC_IMPACT 3 // when projectile hits line -#define SPAC_PUSH 4 // when player/monster pushes line -#define SPAC_PCROSS 5 // when projectile crosses line - -typedef struct +#define SPAC_CROSS 0 // when player crosses line +#define SPAC_USE 1 // when player uses line +#define SPAC_MCROSS 2 // when monster crosses line +#define SPAC_IMPACT 3 // when projectile hits line +#define SPAC_PUSH 4 // when player/monster pushes line +#define SPAC_PCROSS 5 // when projectile crosses line + +typedef struct { - short floorheight; - short ceilingheight; - char floorpic[8]; - char ceilingpic[8]; - short lightlevel; - short special; - short tag; + short floorheight; + short ceilingheight; + char floorpic[8]; + char ceilingpic[8]; + short lightlevel; + short special; + short tag; } mapsector_t; typedef struct { - short numsegs; - short firstseg; // segs are stored sequentially + short numsegs; + short firstseg; // segs are stored sequentially } mapsubsector_t; typedef struct { - short v1; - short v2; - short angle; - short linedef; - short side; - short offset; + short v1; + short v2; + short angle; + short linedef; + short side; + short offset; } mapseg_t; enum -{ // bbox coordinates - BOXTOP, - BOXBOTTOM, - BOXLEFT, - BOXRIGHT +{ // bbox coordinates + BOXTOP, + BOXBOTTOM, + BOXLEFT, + BOXRIGHT }; #define NF_SUBSECTOR 0x8000 typedef struct { - short x,y,dx,dy; // partition line - short bbox[2][4]; // bounding box for each child - unsigned short children[2]; // if NF_SUBSECTOR its a subsector + short x, y, dx, dy; // partition line + short bbox[2][4]; // bounding box for each child + unsigned short children[2]; // if NF_SUBSECTOR its a subsector } mapnode_t; typedef struct { - short tid; - short x; - short y; - short height; - short angle; - short type; - short options; - byte special; - byte arg1; - byte arg2; - byte arg3; - byte arg4; - byte arg5; + short tid; + short x; + short y; + short height; + short angle; + short type; + short options; + byte special; + byte arg1; + byte arg2; + byte arg3; + byte arg4; + byte arg5; } mapthing_t; #define MTF_EASY 1 @@ -174,22 +187,22 @@ typedef struct typedef struct { - short originx; - short originy; - short patch; - short stepdir; - short colormap; + short originx; + short originy; + short patch; + short stepdir; + short colormap; } mappatch_t; typedef struct { - char name[8]; - boolean masked; - short width; - short height; - void **columndirectory; // OBSOLETE - short patchcount; - mappatch_t patches[1]; + char name[8]; + boolean masked; + short width; + short height; + void **columndirectory; // OBSOLETE + short patchcount; + mappatch_t patches[1]; } maptexture_t; //-------------------------------------------------------------------------- @@ -201,31 +214,31 @@ typedef struct // posts are runs of non masked source pixels typedef struct { - byte topdelta; // -1 is the last post in a column - byte length; + byte topdelta; // -1 is the last post in a column + byte length; // length data bytes follows } post_t; // column_t is a list of 0 or more post_t, (byte)-1 terminated -typedef post_t column_t; +typedef post_t column_t; // a patch holds one or more columns // patches are used for sprites and all masked pictures -typedef struct -{ - short width; // bounding box size - short height; - short leftoffset; // pixels to the left of origin - short topoffset; // pixels below the origin - int columnofs[8]; // only [width] used - // the [0] is &columnofs[width] -} patch_t; +typedef struct +{ + short width; // bounding box size + short height; + short leftoffset; // pixels to the left of origin + short topoffset; // pixels below the origin + int columnofs[8]; // only [width] used + // the [0] is &columnofs[width] +} patch_t; // a pic is an unmasked block of pixels typedef struct { - byte width,height; - byte data; + byte width, height; + byte data; } pic_t; #endif // __XDDEFS__ -- cgit v1.2.3