Removing GCC_PACK, we fully rely on START_PACK_STRUCTS / END_PACK_STRUCTS now (hiya eriktorbjorn, this one is for you *ggg*)

svn-id: r23547
This commit is contained in:
Max Horn 2006-07-21 21:25:17 +00:00
parent 348e34c685
commit f59cf1fcdc
30 changed files with 117 additions and 119 deletions

View file

@ -359,11 +359,9 @@
// GCC specific stuff
//
#if defined(__GNUC__)
#define GCC_PACK __attribute__((packed))
#define NORETURN __attribute__((__noreturn__))
#define GCC_PRINTF(x,y) __attribute__((format(printf, x, y)))
#else
#define GCC_PACK
#define GCC_PRINTF(x,y)
#endif

View file

@ -46,7 +46,7 @@ public:
int16 funcEnter;
int16 funcLeave;
int16 field_12; // New in GOB2
} GCC_PACK;
};
#define szGame_TotResItem (4 + 2 + 2 + 2)
struct TotResItem {
@ -55,7 +55,7 @@ public:
int16 size;
int16 width;
int16 height;
} GCC_PACK;
};
#define szGame_TotResTable (2 + 1)
struct TotResTable {
@ -63,7 +63,7 @@ public:
byte unknown;
TotResItem *items;
char *dataPtr;
} GCC_PACK;
};
#define szGame_ExtItem (4 + 2 + 2 + 2)
struct ExtItem {
@ -71,41 +71,41 @@ public:
uint16 size;
int16 width; // width&0x7fff - width, width&0x8000 - pack flag
int16 height; // not zero
} GCC_PACK;
};
#define szGame_ExtTable (2 + 1)
struct ExtTable {
int16 itemsCount;
byte unknown;
ExtItem* items;
} GCC_PACK;
};
#define szGame_TotTextItem (2 + 2)
struct TotTextItem {
int16 offset;
int16 size;
} GCC_PACK;
};
#define szGame_TotTextTable (2)
struct TotTextTable {
int16 itemsCount;
TotTextItem *items;
char *dataPtr;
} GCC_PACK;
};
struct InputDesc {
int16 fontIndex;
int16 backColor;
int16 frontColor;
char *ptr;
} GCC_PACK;
};
struct ImdCoord {
int16 left;
int16 top;
int16 right;
int16 bottom;
} GCC_PACK;
};
struct Imd {
int16 fileHandle;
@ -129,7 +129,7 @@ public:
ImdCoord *frameCoords;
int32 frameDataSize;
int32 vidBufferSize;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -51,7 +51,7 @@ public:
int16 freq; // +Ah, high/low byte * 100 - frequency
int16 repCount; // +Ch high/low byte - repeat count
int16 sndFrame; // +Eh
} GCC_PACK;
};
typedef Gob_State *Gob_PState;
@ -90,12 +90,12 @@ public:
char multObjIndex; // +37h, from which play mult animations
char unk14; // +38h
char visible; // +39h
} GCC_PACK;
};
struct Gob_Pos {
char x;
char y;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -51,7 +51,7 @@ public:
int16 x;
int16 y;
int16 field_2; // Gob2
} GCC_PACK;
};
#define szMap_ItemPos 3
@ -59,7 +59,7 @@ public:
int8 x;
int8 y;
int8 orient; // ??
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -64,7 +64,7 @@ public:
int8 somethingAnimation; // New in GOB2
int8 somethingLayer; // New in GOB2
int8 somethingFrame; // New in GOB2
} GCC_PACK;
};
struct Mult_GobState {
int16 animation; // .
@ -105,7 +105,7 @@ public:
struct Mult_StaticKey {
int16 frame;
int16 layer;
} GCC_PACK;
};
struct Mult_AnimKey {
int16 frame;
@ -113,7 +113,7 @@ public:
int16 posX;
int16 posY;
int16 order;
} GCC_PACK;
};
struct Mult_TextKey {
int16 frame;
@ -121,7 +121,7 @@ public:
int16 unknown0[9];
int16 index;
int16 unknown1[2];
} GCC_PACK;
};
struct Mult_PalKey {
int16 frame;
@ -130,14 +130,14 @@ public:
int16 unknown0;
int16 unknown1;
int8 subst[16][4];
} GCC_PACK;
};
struct Mult_PalFadeKey {
int16 frame;
int16 fade;
int16 palIndex;
int8 flag;
} GCC_PACK;
};
struct Mult_SndKey {
int16 frame;
@ -147,7 +147,7 @@ public:
int16 repCount;
int16 resId;
int16 soundIndex;
} GCC_PACK;
};
struct Mult_SomeKey {
int16 frame;
@ -158,7 +158,7 @@ public:
int16 field_A;
int16 field_C;
int16 field_E;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS
@ -344,7 +344,7 @@ public:
char *somepointer09; // ?
char *somepointer10; // ?
char *execPtr;
} GCC_PACK;
};
#pragma END_PACK_STRUCTS
Mult_Data *_multData2; // TODO: This'll be _multData once every function using it

View file

@ -37,7 +37,7 @@ public:
int16 right; //These are stored in Little Endian format
int16 top; //And should be converted by client code when accessed
int16 bottom; //i.e. use FROM_LE_16()
} GCC_PACK;
};
struct StaticPlane {
int8 pictIndex;
@ -46,13 +46,13 @@ public:
int16 destX;
int16 destY;
int8 transp;
} GCC_PACK;
};
struct StaticLayer {
int16 backResId;
int16 planeCount;
StaticPlane *planes;
} GCC_PACK;
};
// Animations
@ -62,7 +62,7 @@ public:
int8 destX;
int8 destY;
int8 notFinal;
} GCC_PACK;
};
struct AnimLayer {
int16 unknown0;
@ -73,7 +73,7 @@ public:
int8 transp;
int16 framesCount;
AnimFramePiece *frames;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -81,7 +81,7 @@ public:
byte red;
byte green;
byte blue;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -45,7 +45,7 @@ struct VersionStructure {
uint16 id;
byte vMajor;
byte vMinor;
} GCC_PACK;
};
struct FileEntry {
uint16 id;
@ -53,7 +53,7 @@ struct FileEntry {
byte sizeExtension;
uint16 size;
uint16 offset;
} GCC_PACK;
};
struct HotspotResource {
uint16 hotspotId;
@ -86,7 +86,7 @@ struct HotspotResource {
uint16 npcSchedule;
uint16 characterMode;
uint16 delayCtr;
} GCC_PACK;
};
struct HotspotAnimResource {
uint16 animRecordId;
@ -100,13 +100,13 @@ struct HotspotAnimResource {
uint8 downFrame;
uint8 leftFrame;
uint8 rightFrame;
} GCC_PACK;
};
struct MovementResource {
uint16 frameNumber;
int16 xChange;
int16 yChange;
} GCC_PACK;
};
struct RoomRect {
int16 xs, xe;
@ -123,7 +123,7 @@ struct RoomResource {
int16 clippingXEnd;
RoomRect walkBounds;
uint16 numExits;
} GCC_PACK;
};
struct RoomExitResource {
int16 xs, xe, ys, ye;
@ -131,12 +131,12 @@ struct RoomExitResource {
uint8 newRoom;
uint8 direction;
int16 newRoomX, newRoomY;
} GCC_PACK;
};
struct HotspotOverrideResource {
uint16 hotspotId;
int16 xs, xe, ys, ye;
} GCC_PACK;
};
struct RoomExitHotspotResource {
uint16 hotspotId;
@ -144,7 +144,7 @@ struct RoomExitHotspotResource {
int16 ys, ye;
uint16 cursorNum;
uint16 destRoomNumber;
} GCC_PACK;
};
struct RoomExitJoinResource {
uint16 hotspot1Id;
@ -158,41 +158,41 @@ struct RoomExitJoinResource {
uint8 h2OpenSound;
uint8 h2CloseSound;
byte blocked;
} GCC_PACK;
};
struct HotspotActionResource {
byte action;
uint16 sequenceOffset;
} GCC_PACK;
};
struct TalkHeaderResource {
uint16 hotspotId;
uint16 offset;
} GCC_PACK;
};
struct TalkDataHeaderResource {
uint16 recordId;
uint16 listOffset;
uint16 responsesOffset;
} GCC_PACK;
};
struct TalkDataResource {
uint16 preSequenceId;
uint16 descId;
uint16 postSequenceId;
} GCC_PACK;
};
struct TalkResponseResource {
uint16 sequenceId1;
uint16 sequenceId2;
uint16 sequenceId3;
} GCC_PACK;
};
struct RoomExitCoordinateResource {
int16 x;
int16 y;
uint16 roomNumber;
} GCC_PACK;
};
#define ROOM_EXIT_COORDINATES_NUM_ENTRIES 6
#define ROOM_EXIT_COORDINATES_NUM_ROOMS 52
@ -200,7 +200,7 @@ struct RoomExitCoordinateResource {
struct RoomExitCoordinateEntryResource {
RoomExitCoordinateResource entries[ROOM_EXIT_COORDINATES_NUM_ENTRIES];
uint8 roomIndex[ROOM_EXIT_COORDINATES_NUM_ROOMS];
} GCC_PACK;
};
#define MAX_SCHEDULE_ENTRY_PARAMS 5

View file

@ -58,7 +58,7 @@ struct GameStateHeader {
uint32 flags;
uint32 dataSize;
char description[32];
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -86,7 +86,7 @@ struct PalEntry {
byte red;
byte green;
byte blue;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -47,12 +47,12 @@ struct AkosHeader {
uint16 num_anims;
uint16 unk_3;
uint16 codec;
} GCC_PACK;
};
struct AkosOffset {
uint32 akcd;
uint16 akci;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -37,7 +37,7 @@ struct CostumeInfo {
uint16 width, height;
int16 rel_x, rel_y;
int16 move_x, move_y;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -43,7 +43,7 @@ struct Box { /* Internal walkbox file format */
byte y1;
byte y2;
byte mask;
} GCC_PACK c64;
} c64;
struct {
byte uy;
@ -54,7 +54,7 @@ struct Box { /* Internal walkbox file format */
byte lrx;
byte mask;
byte flags;
} GCC_PACK v2;
} v2;
struct {
int16 ulx, uly;
@ -64,7 +64,7 @@ struct Box { /* Internal walkbox file format */
byte mask;
byte flags;
uint16 scale;
} GCC_PACK old;
} old;
struct {
int32 ulx, uly;
@ -77,9 +77,9 @@ struct Box { /* Internal walkbox file format */
uint32 scale;
uint32 unk2;
uint32 unk3;
} GCC_PACK v8;
} GCC_PACK;
} GCC_PACK;
} v8;
};
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -1254,7 +1254,7 @@ struct _lfl_index {
uint16 script_addr[200];
byte sound_lfl[100];
uint16 sound_addr[100];
} GCC_PACK lfl_index;
} lfl_index;
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -237,7 +237,7 @@ protected:
int32 dim2start; //0C
int32 dim2end; //10
byte data[1]; //14
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -221,7 +221,7 @@ class Win32ResExtractor : public ResExtractor {
uint16 reserved;
uint16 type;
uint16 count;
Win32CursorIconDirEntry entries[1] GCC_PACK;
Win32CursorIconDirEntry entries[1];
};
struct Win32CursorIconFileDirEntry {

View file

@ -528,7 +528,7 @@ protected:
int16 type;
int16 dim2;
byte data[1];
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -45,13 +45,13 @@ struct BompHeader { /* Bomp header */
struct {
uint16 unk;
uint16 width, height;
} GCC_PACK old;
} old;
struct {
uint32 width, height;
} GCC_PACK v8;
} GCC_PACK;
} GCC_PACK;
} v8;
};
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -60,13 +60,13 @@ struct RoomHeader {
struct {
uint16 width, height;
uint16 numObjects;
} GCC_PACK old;
} old;
struct {
uint32 version;
uint16 width, height;
uint16 numObjects;
} GCC_PACK v7;
} v7;
struct {
uint32 version;
@ -74,9 +74,9 @@ struct RoomHeader {
uint32 numObjects;
uint32 numZBuffer;
uint32 transparency;
} GCC_PACK v8;
} GCC_PACK;
} GCC_PACK;
} v8;
};
};
struct CodeHeader {
union {
@ -88,7 +88,7 @@ struct CodeHeader {
int16 walk_x;
int16 walk_y;
byte actordir;
} GCC_PACK v5;
} v5;
struct {
uint16 obj_id;
@ -98,17 +98,17 @@ struct CodeHeader {
uint16 unk1;
uint16 unk2;
byte actordir;
} GCC_PACK v6;
} v6;
struct {
uint32 version;
uint16 obj_id;
byte parent;
byte parentstate;
} GCC_PACK v7;
} v7;
} GCC_PACK;
} GCC_PACK;
};
};
struct ImageHeader { /* file format */
union {
@ -124,8 +124,8 @@ struct ImageHeader { /* file format */
uint16 hotspot_num;
struct {
int16 x, y;
} GCC_PACK hotspot[15];
} GCC_PACK old;
} hotspot[15];
} old;
struct {
uint32 version;
@ -138,8 +138,8 @@ struct ImageHeader { /* file format */
uint16 hotspot_num;
struct {
int16 x, y;
} GCC_PACK hotspot[15];
} GCC_PACK v7;
} hotspot[15];
} v7;
struct {
char name[32];
@ -154,10 +154,10 @@ struct ImageHeader { /* file format */
uint32 flags; // This field is missing in the COMI demo (version == 800) !
struct {
int32 x, y;
} GCC_PACK hotspot[15];
} GCC_PACK v8;
} GCC_PACK;
} GCC_PACK;
} hotspot[15];
} v8;
};
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -64,7 +64,7 @@ struct channel_data {
uint16 unknown[4]; // 38 - 44
uint16 music_timer; // 46
uint16 music_script_nr; // 48
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -67,7 +67,7 @@ struct SaveInfoSection {
uint32 date;
uint16 time;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -41,7 +41,7 @@ struct ThumbnailHeader {
byte version;
uint16 width, height;
byte bpp;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -35,7 +35,7 @@ struct VgaFileHeader_Feeble {
uint16 x_1;
uint16 hdr2_start;
uint16 x_2, x_3;
} GCC_PACK;
};
struct VgaFileHeader2_Feeble {
uint16 imageCount;
@ -46,27 +46,27 @@ struct VgaFileHeader2_Feeble {
uint16 x_4;
uint16 animationTable;
uint16 x_5;
} GCC_PACK;
};
struct ImageHeader_Feeble {
uint16 id;
uint16 x_1;
uint16 scriptOffs;
uint16 x_2;
} GCC_PACK;
};
struct AnimationHeader_Feeble {
uint16 scriptOffs;
uint16 x_2;
uint16 id;
} GCC_PACK;
};
// Simon 1/2
struct VgaFileHeader_Simon {
uint16 x_1, x_2;
uint16 hdr2_start;
uint16 x_3, x_4;
} GCC_PACK;
};
struct VgaFileHeader2_Simon {
uint16 x_1;
@ -78,20 +78,20 @@ struct VgaFileHeader2_Simon {
uint16 x_4;
uint16 animationTable;
uint16 x_5;
} GCC_PACK;
};
struct ImageHeader_Simon {
uint16 id;
uint16 x_1;
uint16 x_2;
uint16 scriptOffs;
} GCC_PACK;
};
struct AnimationHeader_Simon {
uint16 id;
uint16 x_2;
uint16 scriptOffs;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)

View file

@ -45,13 +45,13 @@ struct RoomList {
uint8 room;
uint8 adlibVolume;
uint8 rolandVolume;
} GCC_PACK;
};
struct Sfx {
uint8 soundNo;
uint8 flags;
RoomList roomList[10];
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -54,7 +54,7 @@ struct dataFileHeader {
int16 s_offset_x;
int16 s_offset_y;
uint16 s_compressed_size;
} GCC_PACK;
};
struct TurnTable {
uint16 turnTableUp[5];
@ -62,7 +62,7 @@ struct TurnTable {
uint16 turnTableLeft[5];
uint16 turnTableRight[5];
uint16 turnTableTalk[5];
} GCC_PACK;
};
struct MegaSet {
uint16 gridWidth; // 0
@ -81,7 +81,7 @@ struct MegaSet {
uint16 standRightId; // 11
uint16 standTalkId; // 12
uint16 turnTableId; // 13
} GCC_PACK;
};
struct Compact {
uint16 logic; // 0: Entry in logic table to run (byte as <256entries in logic table
@ -164,7 +164,7 @@ struct Compact {
MegaSet megaSet1; //
MegaSet megaSet2; //
MegaSet megaSet3; //
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -59,7 +59,7 @@ struct MousePtr {
uint16 hotSpotX;
uint16 hotSpotY;
uint8 dummyData[0x30];
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -39,7 +39,7 @@ namespace Sword1 {
struct OEventSlot { //receiving event list in the compact -
int32 o_event; //array of these with O_TOTAL_EVENTS elements
int32 o_event_script;
} GCC_PACK; // size = 2*int32 = 8 bytes
}; // size = 2*int32 = 8 bytes
#define TOTAL_script_levels 5
@ -47,12 +47,12 @@ struct ScriptTree { //this is a logic tree, used by OBJECTs
int32 o_script_level; //logic level
int32 o_script_id[TOTAL_script_levels]; //script id's (are unique to each level)
int32 o_script_pc[TOTAL_script_levels]; //pc of script for each (if script_manager)
} GCC_PACK; // size = 11*int32 = 44 bytes
}; // size = 11*int32 = 44 bytes
struct TalkOffset {
int32 x;
int32 y;
} GCC_PACK; // size = 2*int32 = 8 bytes
}; // size = 2*int32 = 8 bytes
struct WalkData {
int32 frame;
@ -60,7 +60,7 @@ struct WalkData {
int32 y;
int32 step;
int32 dir;
} GCC_PACK; // size = 5*int32 = 20 bytes
}; // size = 5*int32 = 20 bytes
struct Object {
int32 o_type; // 0 broad description of type - object, floor, etc.
@ -118,7 +118,7 @@ struct Object {
WalkData o_route[O_WALKANIM_SIZE]; // 340 size = 600*20 bytes = 12000
// mega size = 12340 bytes (+ 8 byte offset table + 20 byte header = 12368)
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -43,7 +43,7 @@ struct BarData {
int16 dx; // x2 - x1
int16 dy; // y2 - y1
int32 co; // co = (y1*dx) - (x1*dy) from an equation for a line y*dx = x*dy + co
} GCC_PACK;
};
struct NodeData {
int16 x;
@ -51,7 +51,7 @@ struct NodeData {
int16 level;
int16 prev;
int16 dist;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -99,7 +99,7 @@ struct Header {
uint32 comp_length;
char compression[4];
uint32 decomp_length;
} GCC_PACK;
};
struct FrameHeader {
uint8 runTimeComp[4];
@ -108,31 +108,31 @@ struct FrameHeader {
uint16 height;
int16 offsetX;
int16 offsetY;
} GCC_PACK;
};
struct ParallaxHeader {
char type[16];
uint16 sizeX;
uint16 sizeY;
} GCC_PACK;
};
struct AnimUnit {
uint32 animX;
uint32 animY;
uint32 animFrame;
} GCC_PACK;
};
struct AnimSet {
uint32 cdt;
uint32 spr;
} GCC_PACK;
};
struct WalkGridHeader {
int32 scaleA;
int32 scaleB;
int32 numBars;
int32 numNodes;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS

View file

@ -43,14 +43,14 @@ struct VocFileHeader {
uint16 datablock_offset;
uint16 version;
uint16 id;
} GCC_PACK;
};
struct VocBlockHeader {
uint8 blocktype;
uint8 size[3];
uint8 sr;
uint8 pack;
} GCC_PACK;
};
#if defined(END_PACK_STRUCTS)
#pragma END_PACK_STRUCTS