rnd-20041121-1-src
[rocksndiamonds.git] / src / game_em / main_em.h
index 5a0d04367a2634a7c66e8b9d65c159359909f42c..920498ee0feb65f46f58ef57c6e1aaa61efefe05 100644 (file)
@@ -1,14 +1,28 @@
 #ifndef MAIN_EM_H
 #define MAIN_EM_H
 
+#include "game_em.h"
+
+
 /* 2000-07-30T11:06:03Z ---------------------------------------------------- */
 
 #define EM_MAX_CAVE_WIDTH              102
 #define EM_MAX_CAVE_HEIGHT             102
 
 /* define these for backwards compatibility */
-#define BAD_ROLL
-#define BAD_SPRING
+#define EM_ENGINE_BAD_ROLL
+#define EM_ENGINE_BAD_SPRING
+
+
+/*
+  -----------------------------------------------------------------------------
+  definition of elements used in the Emerald Mine Club engine;
+  the element names have the following properties:
+  - elements that start with an 'X' can be stored in a level file;
+  - elements that start with an 'Y' indicate moving elements;
+  - elements that end with a 'B' are the "backside" of a moving element.
+  -----------------------------------------------------------------------------
+*/
 
 enum
 {
@@ -16,7 +30,7 @@ enum
   Yacid_splash_eB,     /* hmm */
   Yacid_splash_wB,     /* hmm */
 
-#ifdef BAD_ROLL
+#ifdef EM_ENGINE_BAD_ROLL
   Xstone_force_e,      /* only use these in eater */
   Xstone_force_w,
   Xnut_force_e,
@@ -252,14 +266,14 @@ enum
   Ygrow_ew_eat,
   Xwonderwall,
   XwonderwallB,
-  Xameuba_1,
-  Xameuba_2,
-  Xameuba_3,
-  Xameuba_4,
-  Xameuba_5,
-  Xameuba_6,
-  Xameuba_7,
-  Xameuba_8,
+  Xamoeba_1,
+  Xamoeba_2,
+  Xamoeba_3,
+  Xamoeba_4,
+  Xamoeba_5,
+  Xamoeba_6,
+  Xamoeba_7,
+  Xamoeba_8,
   Xdoor_1,
   Xdoor_2,
   Xdoor_3,
@@ -425,6 +439,44 @@ enum
   TILE_MAX
 };
 
+enum
+{
+  SAMPLE_blank = 0,    /* player walks on blank */
+  SAMPLE_roll,         /* player pushes stone/bomb/nut/spring */
+  SAMPLE_stone,                /* stone hits ground */
+  SAMPLE_nut,          /* nut hits ground */
+  SAMPLE_crack,                /* stone hits nut */
+  SAMPLE_bug,          /* bug moves */
+  SAMPLE_tank,         /* tank moves */
+  SAMPLE_android,      /* android places something */
+  SAMPLE_spring,       /* spring hits ground/wall/bumper, stone hits spring */
+  SAMPLE_slurp,                /* spring kills alien */
+  SAMPLE_eater,                /* eater sits/eats diamond */
+  SAMPLE_alien,                /* alien moves */
+  SAMPLE_collect,      /* player collects object */
+  SAMPLE_diamond,      /* diamond/emerald hits ground */
+  SAMPLE_squash,       /* stone squashes diamond */
+  SAMPLE_wonderfall,   /* object falls thru wonderwall */
+  SAMPLE_drip,         /* drip hits ground */
+  SAMPLE_push,         /* player pushes balloon/android */
+  SAMPLE_dirt,         /* player walks on dirt */
+  SAMPLE_acid,         /* acid splashes */
+  SAMPLE_ball,         /* ball places something */
+  SAMPLE_grow,         /* growing wall grows */
+  SAMPLE_wonder,       /* wonderwall is active */
+  SAMPLE_door,         /* player goes thru door (gate) */
+  SAMPLE_exit,         /* player goes into exit */
+  SAMPLE_dynamite,     /* player places dynamite */
+  SAMPLE_tick,         /* dynamite ticks */
+  SAMPLE_press,                /* player presses wheel/wind/switch */
+  SAMPLE_wheel,                /* wheel moves */
+  SAMPLE_boom,         /* explosion */
+  SAMPLE_time,         /* time runs out */
+  SAMPLE_die,          /* player dies */
+
+  SAMPLE_MAX
+};
+
 struct LEVEL
 {
   unsigned int home_initial;          /* number of players (initial) */
@@ -433,15 +485,19 @@ struct LEVEL
 
   unsigned int width;                 /* playfield width */
   unsigned int height;                /* playfield height */
-  unsigned int time_initial;          /* time remaining (initial) */
+
+  unsigned int time_seconds;          /* available time (seconds) */
+  unsigned int time_initial;          /* available time (initial) */
   unsigned int time;                  /* time remaining (runtime) */
+
   unsigned int required_initial;      /* emeralds needed (initial) */
   unsigned int required;              /* emeralds needed (runtime) */
+
   unsigned int score;                 /* score */
 
   /* fill in all below /every/ time you read a level */
   unsigned int alien_score;           /* alien popped by stone/spring score */
-  unsigned int ameuba_time;           /* ameuba speed */
+  unsigned int amoeba_time;           /* amoeba speed */
   unsigned int android_move_cnt_initial; /* android move time counter (initial) */
   unsigned int android_move_cnt;      /* android move time counter */
   unsigned int android_move_time;     /* android move reset time */
@@ -522,17 +578,36 @@ struct PLAYER
   unsigned joy_spin:1;
 };
 
+
+/* ------------------------------------------------------------------------- */
+/* definitions and structures for use by the main game functions             */
+/* ------------------------------------------------------------------------- */
+
+/* values for native Emerald Mine game version */
+#define FILE_VERSION_EM_V3     3
+#define FILE_VERSION_EM_V4     4
+#define FILE_VERSION_EM_V5     5
+#define FILE_VERSION_EM_V6     6
+
+#define FILE_VERSION_EM_ACTUAL FILE_VERSION_EM_V6
+
 struct LevelInfo_EM
 {
-  struct LEVEL lev;
-  struct PLAYER ply1, ply2;
+  int file_version;
+
+  struct LEVEL *lev;
+  struct PLAYER *ply1, *ply2;
 
   unsigned short cave[EM_MAX_CAVE_WIDTH][EM_MAX_CAVE_HEIGHT];
+};
 
-  unsigned short **Boom;
-  unsigned short **Cave;
-  unsigned short **Next;
-  unsigned short **Draw;
+struct GraphicInfo_EM
+{
+  Bitmap *bitmap;
+  int src_x, src_y;
+  int src_offset_x, src_offset_y;
+  int dst_offset_x, dst_offset_y;
+  int width, height;
 };
 
 #endif /* MAIN_EM_H */