shithub: qk1

Download patch

ref: d1fe886f1a8dc1525299ae4a0111b04f5326bfcb
parent: da5379d799f82ad247c9bb0283d583dcfeac6b32
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Nov 22 14:47:54 EST 2023

models and sprites do not require packed structs

--- a/modelgen.h
+++ b/modelgen.h
@@ -2,16 +2,16 @@
 
 #define ALIAS_VERSION	6
 
-typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t;
+typedef enum {
+	ALIAS_SINGLE,
+	ALIAS_GROUP,
+}aliasframetype_t;
 
-typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t;
+typedef enum {
+	ALIAS_SKIN_SINGLE,
+	ALIAS_SKIN_GROUP,
+}aliasskintype_t;
 
-#ifdef __plan9__
-#pragma pack on
-#else
-#pragma pack(1)
-#endif
-
 typedef struct {
 	int			ident;
 	int			version;
@@ -86,10 +86,4 @@
 } daliasskintype_t;
 
 #define IDPOLYHEADER	(('O'<<24)+('P'<<16)+('D'<<8)+'I')
-														// little-endian "IDPO"
-
-#ifdef __plan9__
-#pragma pack off
-#else
-#pragma pack(0)
-#endif
+// little-endian "IDPO"
--- a/spritegn.h
+++ b/spritegn.h
@@ -1,13 +1,20 @@
 // spritegn.h: header file for sprite generation program
 
-#define SPRITE_VERSION	1
+enum {
+	SPRITE_VERSION = 1,
 
-#ifdef __plan9__
-#pragma pack on
-#else
-#pragma pack(1)
-#endif
+	SPR_VP_PARALLEL_UPRIGHT = 0,
+	SPR_FACING_UPRIGHT,
+	SPR_VP_PARALLEL,
+	SPR_ORIENTED,
+	SPR_VP_PARALLEL_ORIENTED,
+};
 
+typedef enum {
+	SPR_SINGLE,
+	SPR_GROUP,
+}spriteframetype_t;
+
 // TODO: shorten these?
 typedef struct {
 	int			ident;
@@ -21,12 +28,6 @@
 	synctype_t	synctype;
 } dsprite_t;
 
-#define SPR_VP_PARALLEL_UPRIGHT		0
-#define SPR_FACING_UPRIGHT			1
-#define SPR_VP_PARALLEL				2
-#define SPR_ORIENTED				3
-#define SPR_VP_PARALLEL_ORIENTED	4
-
 typedef struct {
 	int			origin[2];
 	int			width;
@@ -41,17 +42,9 @@
 	float	interval;
 } dspriteinterval_t;
 
-typedef enum { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t;
-
 typedef struct {
 	spriteframetype_t	type;
 } dspriteframetype_t;
 
 #define IDSPRITEHEADER	(('P'<<24)+('S'<<16)+('D'<<8)+'I')
-														// little-endian "IDSP"
-
-#ifdef __plan9__
-#pragma pack off
-#else
-#pragma pack(0)
-#endif
+// little-endian "IDSP"