aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-05 14:46:12 +0000
committerTorbjörn Andersson2004-01-05 14:46:12 +0000
commit6a7cf6d6cfb4be5d212a8d27304e11820125679e (patch)
treea7cceb58f536e787d799cdc51d9113a9808d5f5b /sword2
parentbe09d4dddc276a836e02a18f8e330e09b53a233b (diff)
downloadscummvm-rg350-6a7cf6d6cfb4be5d212a8d27304e11820125679e.tar.gz
scummvm-rg350-6a7cf6d6cfb4be5d212a8d27304e11820125679e.tar.bz2
scummvm-rg350-6a7cf6d6cfb4be5d212a8d27304e11820125679e.zip
Marked some more structs as packed. I don't know if it makes any
difference, as they contain only 32-bit integers, but I also believe it does no harm. svn-id: r12159
Diffstat (limited to 'sword2')
-rw-r--r--sword2/icons.h10
-rw-r--r--sword2/object.h20
2 files changed, 23 insertions, 7 deletions
diff --git a/sword2/icons.h b/sword2/icons.h
index 3a6512ad64..4a6ca24e00 100644
--- a/sword2/icons.h
+++ b/sword2/icons.h
@@ -28,11 +28,19 @@ namespace Sword2 {
// define these in a script and then register them with the system
+#if !defined(__GNUC__)
+ #pragma START_PACK_STRUCTS
+#endif
+
struct MenuObject {
int32 icon_resource; // icon graphic graphic
int32 luggage_resource; // luggage icon resource (for attaching to
// mouse pointer)
-};
+} GCC_PACK;
+
+#if !defined(__GNUC__)
+ #pragma END_PACK_STRUCTS
+#endif
} // End of namespace Sword2
diff --git a/sword2/object.h b/sword2/object.h
index f8ea422a1d..bf7250fc18 100644
--- a/sword2/object.h
+++ b/sword2/object.h
@@ -22,6 +22,10 @@
namespace Sword2 {
+#if !defined(__GNUC__)
+ #pragma START_PACK_STRUCTS
+#endif
+
// these structures represent the broken up compact components
// these here declared to the system must be the same as those declared to
// LINC (or it wont work)
@@ -36,7 +40,7 @@ struct ObjectMouse {
int32 y2;
int32 priority;
int32 pointer; // type (or resource id?) of pointer used over this area
-};
+} GCC_PACK;
// logic structure - contains fields used in logic script processing
@@ -44,7 +48,7 @@ struct ObjectLogic {
int32 looping; // 0 when first calling fn<function>;
// 1 when calling subsequent times in same loop
int32 pause; // pause count, used by fnPause()
-};
+} GCC_PACK;
// status bits for 'type' field of ObjectGraphic)
@@ -70,7 +74,7 @@ struct ObjectGraphic {
int32 type; // see above
int32 anim_resource; // resource id of animation file
int32 anim_pc; // current frame number of animation
-};
+} GCC_PACK;
// speech structure - contains fields used by speech scripts & text output
@@ -84,7 +88,7 @@ struct ObjectSpeech {
int32 ins4;
int32 ins5;
int32 wait_state; // 0 not waiting, 1 waiting for next speech command
-};
+} GCC_PACK;
// mega structure - contains fields used for mega-character & mega-set
// processing
@@ -104,7 +108,7 @@ struct ObjectMega {
int32 NOT_USED_5; // means were currently avoiding a collision (see fnWalk)
int32 megaset_res; // resource id of mega-set file
int32 NOT_USED_6; // NOT USED
-};
+} GCC_PACK;
// walk-data structure - contains details of layout of frames in the
// mega-set, and how they are to be used
@@ -119,7 +123,11 @@ struct ObjectWalkdata {
int32 leadingLeg[8]; // leading leg for walk in each direction (0 = left 1 = right)
int32 dx[8 * (12 + 1)]; // walk step distances in x direction
int32 dy[8 * (12 + 1)]; // walk step distances in y direction
-};
+} GCC_PACK;
+
+#if !defined(__GNUC__)
+ #pragma END_PACK_STRUCTS
+#endif
} // End of namespace Sword2