ref: 4cb20a815b8e763ecc30e882e3ec695452e2b835
parent: b0cc15b69f56542e294c474f28cfcc5318014651
author: Simon Howard <[email protected]>
date: Wed Oct 29 16:57:47 EDT 2008
Add packed structure attribute for structures read from disk. Subversion-branch: /branches/raven-branch Subversion-revision: 1365
--- a/src/heretic/doomdata.h
+++ b/src/heretic/doomdata.h
@@ -40,8 +40,18 @@
// 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_LABEL,
+ ML_THINGS,
+ ML_LINEDEFS,
+ ML_SIDEDEFS,
+ ML_VERTEXES,
+ ML_SEGS,
+ ML_SSECTORS,
+ ML_NODES,
+ ML_SECTORS,
+ ML_REJECT,
+ ML_BLOCKMAP
};
@@ -48,7 +58,7 @@
typedef struct
{
short x, y;
-} mapvertex_t;
+} PACKEDATTR mapvertex_t;
typedef struct
{
@@ -56,7 +66,7 @@
short rowoffset;
char toptexture[8], bottomtexture[8], midtexture[8];
short sector; // on viewer's side
-} mapsidedef_t;
+} PACKEDATTR mapsidedef_t;
typedef struct
{
@@ -64,7 +74,7 @@
short flags;
short special, tag;
short sidenum[2]; // sidenum[1] will be -1 if one sided
-} maplinedef_t;
+} PACKEDATTR maplinedef_t;
#define ML_BLOCKING 1
#define ML_BLOCKMONSTERS 2
@@ -91,13 +101,13 @@
char floorpic[8], ceilingpic[8];
short lightlevel;
short special, tag;
-} mapsector_t;
+} PACKEDATTR mapsector_t;
typedef struct
{
short numsegs;
short firstseg; // segs are stored sequentially
-} mapsubsector_t;
+} PACKEDATTR mapsubsector_t;
typedef struct
{
@@ -105,7 +115,7 @@
short angle;
short linedef, side;
short offset;
-} mapseg_t;
+} PACKEDATTR mapseg_t;
#define NF_SUBSECTOR 0x8000
typedef struct
@@ -113,7 +123,7 @@
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;
+} PACKEDATTR mapnode_t;
typedef struct
{
@@ -121,7 +131,7 @@
short angle;
short type;
short options;
-} mapthing_t;
+} PACKEDATTR mapthing_t;
#define MTF_EASY 1
#define MTF_NORMAL 2
@@ -143,7 +153,7 @@
short patch;
short stepdir;
short colormap;
-} mappatch_t;
+} PACKEDATTR mappatch_t;
typedef struct
{
@@ -151,10 +161,10 @@
boolean masked;
short width;
short height;
- void **columndirectory; // OBSOLETE
+ int obsolete;
short patchcount;
mappatch_t patches[1];
-} maptexture_t;
+} PACKEDATTR maptexture_t;
/*
--- a/src/hexen/p_acs.c
+++ b/src/hexen/p_acs.c
@@ -54,7 +54,7 @@
int marker;
int infoOffset;
int code;
-} acsHeader_t;
+} PACKEDATTR acsHeader_t;
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
--- a/src/hexen/xddefs.h
+++ b/src/hexen/xddefs.h
@@ -55,7 +55,7 @@
{
short x;
short y;
-} mapvertex_t;
+} PACKEDATTR mapvertex_t;
typedef struct
{
@@ -65,7 +65,7 @@
char bottomtexture[8];
char midtexture[8];
short sector; // on viewer's side
-} mapsidedef_t;
+} PACKEDATTR mapsidedef_t;
typedef struct
{
@@ -79,7 +79,7 @@
byte arg4;
byte arg5;
short sidenum[2]; // sidenum[1] will be -1 if one sided
-} maplinedef_t;
+} PACKEDATTR maplinedef_t;
#define ML_BLOCKING 0x0001
#define ML_BLOCKMONSTERS 0x0002
@@ -112,13 +112,13 @@
short lightlevel;
short special;
short tag;
-} mapsector_t;
+} PACKEDATTR mapsector_t;
typedef struct
{
short numsegs;
short firstseg; // segs are stored sequentially
-} mapsubsector_t;
+} PACKEDATTR mapsubsector_t;
typedef struct
{
@@ -128,7 +128,7 @@
short linedef;
short side;
short offset;
-} mapseg_t;
+} PACKEDATTR mapseg_t;
#define NF_SUBSECTOR 0x8000
typedef struct
@@ -136,7 +136,7 @@
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;
+} PACKEDATTR mapnode_t;
typedef struct
{
@@ -153,7 +153,7 @@
byte arg3;
byte arg4;
byte arg5;
-} mapthing_t;
+} PACKEDATTR mapthing_t;
#define MTF_EASY 1
#define MTF_NORMAL 2
@@ -180,7 +180,7 @@
short patch;
short stepdir;
short colormap;
-} mappatch_t;
+} PACKEDATTR mappatch_t;
typedef struct
{
@@ -191,7 +191,7 @@
void **columndirectory; // OBSOLETE
short patchcount;
mappatch_t patches[1];
-} maptexture_t;
+} PACKEDATTR maptexture_t;
//--------------------------------------------------------------------------
//