summaryrefslogtreecommitdiff
path: root/src/w_wad.c
diff options
context:
space:
mode:
authorSimon Howard2007-08-31 07:27:44 +0000
committerSimon Howard2007-08-31 07:27:44 +0000
commit11178d5abc068eeadf32f5cc7379a1ac53fc470c (patch)
tree1075d6b4f1221170d7702f40f59ffbc22e212185 /src/w_wad.c
parent693fb386fc1ca8551dcea553e3dd667f2f458f61 (diff)
downloadchocolate-doom-11178d5abc068eeadf32f5cc7379a1ac53fc470c.tar.gz
chocolate-doom-11178d5abc068eeadf32f5cc7379a1ac53fc470c.tar.bz2
chocolate-doom-11178d5abc068eeadf32f5cc7379a1ac53fc470c.zip
Use gcc packed attribute for all structures read/written to disk. This
fixes architectures where structure fields are aligned differently to optimise reads, causing the game to crash. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 960
Diffstat (limited to 'src/w_wad.c')
-rw-r--r--src/w_wad.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/w_wad.c b/src/w_wad.c
index 598794c4..2d58b574 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -32,7 +32,9 @@
#include <stdlib.h>
#include <string.h>
+#include "doomdef.h"
#include "doomtype.h"
+
#include "i_swap.h"
#include "i_system.h"
#include "i_video.h"
@@ -40,6 +42,22 @@
#include "w_wad.h"
+typedef struct
+{
+ // Should be "IWAD" or "PWAD".
+ char identification[4];
+ int numlumps;
+ int infotableofs;
+} PACKEDATTR wadinfo_t;
+
+
+typedef struct
+{
+ int filepos;
+ int size;
+ char name[8];
+} PACKEDATTR filelump_t;
+
//
// GLOBALS
//