rnd-20020318-2-src
[rocksndiamonds.git] / src / main.h
index da78d7787b2bd37006c554e120aec3a736ed0a36..da629d537244d5e8a2330c6fdce43c6c9464f80d 100644 (file)
@@ -278,7 +278,7 @@ struct PlayerInfo
   int index_nr, client_nr, element_nr;
 
   byte action;                 /* action from local input device */
-  byte effective_action;       /* action aknowledged from network server
+  byte effective_action;       /* action acknowledged from network server
                                   or summarized over all configured input
                                   devices when in single player mode */
   byte programmed_action;      /* action forced by game itself (like moving
@@ -322,8 +322,12 @@ struct PlayerInfo
 
 struct LevelInfo
 {
-  int file_version;    /* version of file this level was stored with */
-  int game_version;    /* version of game engine to play this level */
+  int file_version;            /* version of file the level was stored with */
+  int game_version;            /* version of game engine to play this level */
+  boolean encoding_16bit_field;                /* level contains 16-bit elements */
+  boolean encoding_16bit_yamyam;       /* yamyam contains 16-bit elements */
+  boolean encoding_16bit_amoeba;       /* amoeba contains 16-bit elements */
+
   int fieldx;
   int fieldy;
   int time;
@@ -360,6 +364,7 @@ struct TapeInfo
   boolean fast_forward;
   boolean changed;
   boolean player_participates[MAX_PLAYERS];
+  int num_participating_players;
   struct
   {
     byte action[MAX_PLAYERS];
@@ -1528,7 +1533,11 @@ extern int               num_element_info;
 #define SETUPINPUT             9
 #define CALIBRATION            10
 
+#define PROGRAM_VERSION_MAJOR  2
+#define PROGRAM_VERSION_MINOR  0
+#define PROGRAM_VERSION_PATCH  1
 #define PROGRAM_VERSION_STRING "2.0.1"
+
 #define PROGRAM_TITLE_STRING   "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING  "Holger Schemel"
 #define PROGRAM_RIGHTS_STRING  "Copyright ^1995-2001 by"
@@ -1543,6 +1552,11 @@ extern int               num_element_info;
 #define X11_ICONMASK_FILENAME  "rocks_iconmask.xbm"
 #define MSDOS_POINTER_FILENAME "mouse.pcx"
 
+#define VERSION_IDENT(x,y,z)   ((x) * 10000 + (y) * 100 + (z))
+#define VERSION_MAJOR(x)       ((x) / 10000)
+#define VERSION_MINOR(x)       (((x) % 10000) / 100)
+#define VERSION_PATCH(x)       ((x) % 100)
+
 /* file version numbers for resource files (levels, tapes, score, setup, etc.)
 ** currently supported/known file version numbers:
 **     1.0 (old)
@@ -1550,16 +1564,24 @@ extern int              num_element_info;
 **     1.4 (still in use)
 **     2.0 (actual)
 */
-#define FILE_VERSION_1_0       10
-#define FILE_VERSION_1_2       12
-#define FILE_VERSION_1_4       14
-#define FILE_VERSION_2_0       20
+#define FILE_VERSION_1_0       VERSION_IDENT(1,0,0)
+#define FILE_VERSION_1_2       VERSION_IDENT(1,2,0)
+#define FILE_VERSION_1_4       VERSION_IDENT(1,4,0)
+#define FILE_VERSION_2_0       VERSION_IDENT(2,0,0)
+
+/* file version does not change for every program version, but is changed
+   when new features are introduced that are incompatible with older file
+   versions, so that they can be treated accordingly */
 #define FILE_VERSION_ACTUAL    FILE_VERSION_2_0
+
 #define GAME_VERSION_1_0       FILE_VERSION_1_0
 #define GAME_VERSION_1_2       FILE_VERSION_1_2
 #define GAME_VERSION_1_4       FILE_VERSION_1_4
 #define GAME_VERSION_2_0       FILE_VERSION_2_0
-#define GAME_VERSION_ACTUAL    GAME_VERSION_2_0
+
+#define GAME_VERSION_ACTUAL    VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
+                                             PROGRAM_VERSION_MINOR, \
+                                             PROGRAM_VERSION_PATCH)
 
 /* for DrawGraphicAnimation() [tools.c] and AnimateToon() [cartoons.c] */
 #define ANIM_NORMAL            0