rnd-20021215-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 15 Dec 2002 01:57:56 +0000 (02:57 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:39:13 +0000 (10:39 +0200)
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/editor.c
src/editor.h
src/events.c
src/screens.c
src/tools.c
src/tools.h

index 5fedea5a08b5ea570facf924e3420598ac1e8bdb..8b43852ea25a14a916a8f81281432da8a3e4b50e 100644 (file)
@@ -830,6 +830,7 @@ struct ConfigInfo image_config[] =
   { "amoeba.creating.frames",                  "3"                     },
   { "amoeba.creating.delay",                   "2"                     },
   { "amoeba.creating.mode_linear",             "1"                     },
+  { "amoeba.creating.global_sync",             "0"                     },
   { "amoeba.shrinking",                                "RocksElements.pcx"     },
   { "amoeba.shrinking.xpos",                   "5"                     },
   { "amoeba.shrinking.ypos",                   "6"                     },
@@ -837,6 +838,7 @@ struct ConfigInfo image_config[] =
   { "amoeba.shrinking.delay",                  "2"                     },
   { "amoeba.shrinking.mode_linear",            "1"                     },
   { "amoeba.shrinking.mode_reverse",           "1"                     },
+  { "amoeba.shrinking.global_sync",            "0"                     },
   { "amoeba_wet",                              "RocksElements.pcx"     },
   { "amoeba_wet.xpos",                         "8"                     },
   { "amoeba_wet.ypos",                         "6"                     },
@@ -1015,7 +1017,7 @@ struct ConfigInfo image_config[] =
   { "balloon_send_down.ypos",                  "7"                     },
   { "balloon_send_down.frames",                        "1"                     },
   { "balloon_send_any_direction",              "RocksDC.pcx"           },
-  { "balloon_send_any_direction.xpos",         "7"                     },
+  { "balloon_send_any_direction.xpos",         "15"                    },
   { "balloon_send_any_direction.ypos",         "0"                     },
   { "balloon_send_any_direction.frames",       "1"                     },
 
@@ -1663,24 +1665,28 @@ struct ConfigInfo image_config[] =
   { "wall_growing_active_left.ypos",           "10"                    },
   { "wall_growing_active_left.frames",         "3"                     },
   { "wall_growing_active_left.delay",          "6"                     },
+  { "wall_growing_active_left.mode_linear",    "1"                     },
   { "wall_growing_active_left.global_sync",    "0"                     },
   { "wall_growing_active_right",               "RocksElements.pcx"     },
   { "wall_growing_active_right.xpos",          "5"                     },
   { "wall_growing_active_right.ypos",          "10"                    },
   { "wall_growing_active_right.frames",                "3"                     },
   { "wall_growing_active_right.delay",         "6"                     },
+  { "wall_growing_active_right.mode_linear",   "1"                     },
   { "wall_growing_active_right.global_sync",   "0"                     },
   { "wall_growing_active_up",                  "RocksHeroes.pcx"       },
   { "wall_growing_active_up.xpos",             "3"                     },
   { "wall_growing_active_up.ypos",             "12"                    },
   { "wall_growing_active_up.frames",           "3"                     },
   { "wall_growing_active_up.delay",            "6"                     },
+  { "wall_growing_active_up.mode_linear",      "1"                     },
   { "wall_growing_active_up.global_sync",      "0"                     },
   { "wall_growing_active_down",                        "RocksHeroes.pcx"       },
   { "wall_growing_active_down.xpos",           "0"                     },
   { "wall_growing_active_down.ypos",           "12"                    },
   { "wall_growing_active_down.frames",         "3"                     },
   { "wall_growing_active_down.delay",          "6"                     },
+  { "wall_growing_active_down.mode_linear",    "1"                     },
   { "wall_growing_active_down.global_sync",    "0"                     },
 
   { "black_orb",                               "RocksElements.pcx"     },
@@ -2550,6 +2556,32 @@ struct ConfigInfo image_config[] =
   { "menu.font_medium",                                "RocksFontMedium.pcx"   },
   { "menu.font_em",                            "RocksFontEM.pcx"       },
 
+  { "info.font_em_1",                          "RocksFontEM.pcx"       },
+  { "info.font_em_1.xpos",                     "0"                     },
+  { "info.font_em_1.ypos",                     "0"                     },
+  { "info.font_em_1.frames",                   "16"                    },
+  { "info.font_em_1.delay",                    "10"                    },
+  { "info.font_em_2",                          "RocksFontEM.pcx"       },
+  { "info.font_em_2.xpos",                     "0"                     },
+  { "info.font_em_2.ypos",                     "1"                     },
+  { "info.font_em_2.frames",                   "16"                    },
+  { "info.font_em_2.delay",                    "10"                    },
+  { "info.font_em_3",                          "RocksFontEM.pcx"       },
+  { "info.font_em_3.xpos",                     "0"                     },
+  { "info.font_em_3.ypos",                     "2"                     },
+  { "info.font_em_3.frames",                   "16"                    },
+  { "info.font_em_3.delay",                    "10"                    },
+  { "info.font_em_4",                          "RocksFontEM.pcx"       },
+  { "info.font_em_4.xpos",                     "0"                     },
+  { "info.font_em_4.ypos",                     "3"                     },
+  { "info.font_em_4.frames",                   "16"                    },
+  { "info.font_em_4.delay",                    "10"                    },
+  { "info.font_em_5",                          "RocksFontEM.pcx"       },
+  { "info.font_em_5.xpos",                     "0"                     },
+  { "info.font_em_5.ypos",                     "4"                     },
+  { "info.font_em_5.frames",                   "4"                     },
+  { "info.font_em_5.delay",                    "10"                    },
+
   { "old.pix_elements",                                "RocksElements.pcx"     },
   { "old.pix_heroes",                          "RocksHeroes.pcx"       },
   { "old.pix_sp",                              "RocksSP.pcx"           },
index b2fe3673cc2b317a5f279933515ccaf23e440c18..0a98f7f814ba2684903a39ecc741d537dd8c6be3 100644 (file)
 #define IMG_MENU_FONT_SMALL                    638
 #define IMG_MENU_FONT_MEDIUM                   639
 #define IMG_MENU_FONT_EM                       640
-#define IMG_OLD_PIX_ELEMENTS                   641
-#define IMG_OLD_PIX_HEROES                     642
-#define IMG_OLD_PIX_SP                         643
-#define IMG_OLD_PIX_DC                         644
-#define IMG_OLD_PIX_MORE                       645
-#define IMG_OLD_PIX_FONT_EM                    646
+#define IMG_INFO_FONT_EM_1                     641
+#define IMG_INFO_FONT_EM_2                     642
+#define IMG_INFO_FONT_EM_3                     643
+#define IMG_INFO_FONT_EM_4                     644
+#define IMG_INFO_FONT_EM_5                     645
+#define IMG_OLD_PIX_ELEMENTS                   646
+#define IMG_OLD_PIX_HEROES                     647
+#define IMG_OLD_PIX_SP                         648
+#define IMG_OLD_PIX_DC                         649
+#define IMG_OLD_PIX_MORE                       650
+#define IMG_OLD_PIX_FONT_EM                    651
 
-#define NUM_IMAGE_FILES                                647
+#define NUM_IMAGE_FILES                                652
 
 #endif /* CONF_GFX_H */
index 722ce91fcb4dd52f211160d56fadf93e6736facb..26b62252daa5bc9b14f207f76136264aae9c513d 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-12-11 23:34]"
+#define COMPILE_DATE_STRING "[2002-12-15 02:57]"
index cbf6de4a301ec590eb650d28202043c40e689c26..952dbc6866bacbde8eb5b22aa7e37af026779447 100644 (file)
@@ -2649,6 +2649,43 @@ static void DrawElementContentAreas()
     MapDrawingArea(GADGET_ID_ELEM_CONTENT_0 + i);
 }
 
+#if 0
+static void DrawPropertiesElement(int xstart, int ystart, int element)
+{
+  int x, y;
+
+  /* draw some decorative border for the object */
+  for (y=0; y<3; y++)
+    for (x=0; x<3; x++)
+      DrawMiniElement(xstart + x , ystart + y, EL_SAND);
+
+  ClearRectangle(drawto,
+                SX + xstart * MINI_TILEX + MINI_TILEX/2 - 1,
+                SY + ystart * MINI_TILEY + MINI_TILEY/2 - 1,
+                TILEX + 2, TILEY + 2);
+
+  /* copy border to the right location */
+  BlitBitmap(drawto, drawto,
+            SX + xstart * MINI_TILEX,
+            SY + ystart * MINI_TILEY,
+            2 * TILEX, 2 * TILEY,
+            SX + xstart * MINI_TILEX - MINI_TILEX/2,
+            SY + ystart * MINI_TILEY - MINI_TILEY/2);
+
+  DrawGraphicAnimation(xstart / 2, ystart / 2, el2img(element));
+
+  /* copy the whole stuff to the definitive location */
+  BlitBitmap(drawto, drawto,
+            SX + xstart * MINI_TILEX - MINI_TILEX/2,
+            SY + ystart * MINI_TILEY - MINI_TILEY,
+            2 * TILEX, 2 * TILEY,
+            SX + xstart * MINI_TILEX - MINI_TILEX/2,
+            SY + ystart * MINI_TILEY - MINI_TILEY/2);
+
+  FrameCounter++;      /* increase animation frame counter */
+}
+#endif
+
 #define TEXT_COLLECTING                "Score for collecting"
 #define TEXT_SMASHING          "Score for smashing"
 #define TEXT_CRACKING          "Score for cracking"
@@ -2729,6 +2766,7 @@ static void DrawPropertiesWindow()
   DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS_YPOS,
           "Element Settings", FS_BIG, FC_YELLOW);
 
+#if 1
   /* draw some decorative border for the object */
   for (y=0; y<3; y++)
     for (x=0; x<3; x++)
@@ -2747,7 +2785,11 @@ static void DrawPropertiesWindow()
             SX + xstart * MINI_TILEX - MINI_TILEX/2,
             SY + ystart * MINI_TILEY - MINI_TILEY/2);
 
+#if 0
   DrawGraphic(xstart / 2, ystart / 2, el2img(properties_element), 0);
+#else
+  DrawGraphicAnimation(xstart / 2, ystart / 2, el2img(properties_element));
+#endif
 
   /* copy the whole stuff to the definitive location */
   BlitBitmap(drawto, drawto,
@@ -2757,6 +2799,15 @@ static void DrawPropertiesWindow()
             SX + xstart * MINI_TILEX - MINI_TILEX/2,
             SY + ystart * MINI_TILEY - MINI_TILEY/2);
 
+  FrameCounter = 0;    /* restart animation frame counter */
+
+#else
+
+  FrameCounter = 0;    /* restart animation frame counter */
+  DrawPropertiesElement(xstart, ystart, properties_element);
+
+#endif
+
   DrawTextF((xstart + 3) * MINI_TILEX, (ystart + 1) * MINI_TILEY,
            font_color, getElementInfoText(properties_element));
 
@@ -4127,6 +4178,32 @@ void HandleLevelEditorKeyInput(Key key)
   }
 }
 
+void HandleLevelEditorIdle()
+{
+  static unsigned long action_delay = 0;
+  unsigned long action_delay_value = GameFrameDelay;
+  int xpos = 1, ypos = 2;
+
+  if (edit_mode != ED_MODE_PROPERTIES)
+    return;
+
+  if (!DelayReached(&action_delay, action_delay_value))
+    return;
+
+  FY += MINI_TILEY / 2;
+#if 1
+  DrawGraphicAnimation(xpos, ypos, el2img(properties_element));
+#else
+  DrawGraphicAnimation(xpos, ypos, el_dir_act2img(properties_element,
+                                                 MV_NO_MOVING,
+                                                 ...));
+#endif
+  FY -= MINI_TILEY / 2;
+  MarkTileDirty(xpos, ypos + 1);
+
+  FrameCounter++;      /* increase animation frame counter */
+}
+
 void ClearEditorGadgetInfoText()
 {
   ClearRectangle(drawto,
index 7966bda17b2a315539162db11d50cb6aba62c831..d2338f1532a68ac6c8dd4701fa89f59914b88fea 100644 (file)
@@ -28,6 +28,7 @@ void CreateLevelEditorGadgets();
 void UnmapLevelEditorGadgets();
 void DrawLevelEd(void);
 void HandleLevelEditorKeyInput(Key);
+void HandleLevelEditorIdle();
 void HandleEditorGadgetInfoText(void *ptr);
 void RequestExitLevelEditor(boolean);
 
index fc6140fc84a0c959d5eaaeb5966acdd1c3fa2d95..8daab243f879851540e972dd04e79f0255a23b0a 100644 (file)
@@ -871,6 +871,10 @@ void HandleJoystick()
       HandleHelpScreen(!newbutton);
       break;
 
+    case LEVELED:
+      HandleLevelEditorIdle();
+      break;
+
     case PLAYING:
       if (tape.playing || keyboard)
        newbutton = ((joy & JOY_BUTTON) != 0);
index 6e2948aae75a0fb85ca75e62a408d2c7acee2494..0532cdd19e2f054e9d42df7059653fe2c0f40faf 100644 (file)
@@ -435,8 +435,8 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button)
 static long helpscreen_state;
 static int helpscreen_step[MAX_HELPSCREEN_ELS];
 static int helpscreen_frame[MAX_HELPSCREEN_ELS];
-static int helpscreen_delay[MAX_HELPSCREEN_ELS];
-static int helpscreen_action[] =
+#if 0
+static int OLD_helpscreen_action[] =
 {
   GFX_SPIELER1_DOWN,4,2,
   GFX_SPIELER1_UP,4,2,
@@ -544,6 +544,219 @@ static int helpscreen_action[] =
   GFX_SPEED_PILL,1,100,                                                HA_NEXT,
   HA_END
 };
+#endif
+
+static int helpscreen_action[] =
+{
+  IMG_PLAYER1_DOWN_MOVING,             16,
+  IMG_PLAYER1_UP_MOVING,               16,
+  IMG_PLAYER1_LEFT_MOVING,             16,
+  IMG_PLAYER1_RIGHT_MOVING,            16,
+  IMG_PLAYER1_LEFT_PUSHING,            16,
+  IMG_PLAYER1_RIGHT_PUSHING,           16,                     HA_NEXT,
+
+  IMG_SAND,                            -1,                     HA_NEXT,
+
+  IMG_EMPTY_SPACE,                     -1,                     HA_NEXT,
+
+  IMG_QUICKSAND_EMPTY,                 -1,                     HA_NEXT,
+
+  IMG_STEELWALL,                       -1,                     HA_NEXT,
+
+  IMG_WALL,                            -1,                     HA_NEXT,
+
+  IMG_WALL_GROWING_ACTIVE_LEFT,                20,
+  IMG_WALL,                            50,
+  IMG_EMPTY_SPACE,                     20,
+  IMG_WALL_GROWING_ACTIVE_RIGHT,       20,
+  IMG_WALL,                            50,
+  IMG_EMPTY_SPACE,                     20,
+  IMG_WALL_GROWING_ACTIVE_UP,          20,
+  IMG_WALL,                            50,
+  IMG_EMPTY_SPACE,                     20,
+  IMG_WALL_GROWING_ACTIVE_DOWN,                20,
+  IMG_WALL,                            50,
+  IMG_EMPTY_SPACE,                     20,                     HA_NEXT,
+
+  IMG_INVISIBLE_WALL,                  -1,                     HA_NEXT,
+
+  IMG_WALL_CRUMBLED,                   -1,                     HA_NEXT,
+
+  IMG_INFO_FONT_EM_1,                  160,
+  IMG_INFO_FONT_EM_2,                  160,
+  IMG_INFO_FONT_EM_3,                  160,
+  IMG_INFO_FONT_EM_4,                  160,
+  IMG_INFO_FONT_EM_5,                  40,                     HA_NEXT,
+
+  IMG_EMERALD,                         -1,                     HA_NEXT,
+
+  IMG_DIAMOND,                         -1,                     HA_NEXT,
+
+  IMG_BD_DIAMOND,                      -1,                     HA_NEXT,
+
+  IMG_EMERALD_YELLOW,                  50,
+  IMG_EMERALD_RED,                     50,
+  IMG_EMERALD_PURPLE,                  50,                     HA_NEXT,
+
+  IMG_BD_ROCK,                         -1,                     HA_NEXT,
+
+  IMG_BOMB,                            100,
+  IMG_EXPLOSION,                       16,
+  IMG_EMPTY_SPACE,                     10,                     HA_NEXT,
+
+  IMG_NUT,                             100,
+  IMG_NUT_CRACKING,                    6,
+  IMG_EMERALD,                         20,                     HA_NEXT,
+
+  IMG_WALL_EMERALD,                    100,
+  IMG_EXPLOSION,                       16,
+  IMG_EMERALD,                         20,                     HA_NEXT,
+
+  IMG_WALL_DIAMOND,                    100,
+  IMG_EXPLOSION,                       16,
+  IMG_DIAMOND,                         20,                     HA_NEXT,
+
+  IMG_WALL_BD_DIAMOND,                         100,
+  IMG_EXPLOSION,                       16,
+  IMG_BD_DIAMOND,                      20,                     HA_NEXT,
+
+  IMG_WALL_EMERALD_YELLOW,             100,
+  IMG_EXPLOSION,                       16,
+  IMG_EMERALD_YELLOW,                  20,
+  IMG_WALL_EMERALD_RED,                        100,
+  IMG_EXPLOSION,                       16,
+  IMG_EMERALD_RED,                     20,
+  IMG_WALL_EMERALD_PURPLE,             100,
+  IMG_EXPLOSION,                       16,
+  IMG_EMERALD_PURPLE,                  20,                     HA_NEXT,
+
+  IMG_ACID,                            -1,                     HA_NEXT,
+
+  IMG_KEY1,                            50,
+  IMG_KEY2,                            50,
+  IMG_KEY3,                            50,
+  IMG_KEY4,                            50,                     HA_NEXT,
+
+  IMG_GATE1,                           50,
+  IMG_GATE2,                           50,
+  IMG_GATE3,                           50,
+  IMG_GATE4,                           50,                     HA_NEXT,
+
+  IMG_GATE1_GRAY,                      50,
+  IMG_GATE2_GRAY,                      50,
+  IMG_GATE3_GRAY,                      50,
+  IMG_GATE4_GRAY,                      50,                     HA_NEXT,
+
+  IMG_DYNAMITE,                                -1,                     HA_NEXT,
+
+  IMG_DYNAMITE_ACTIVE,                 96,
+  IMG_EXPLOSION,                       16,
+  IMG_EMPTY_SPACE,                     20,                     HA_NEXT,
+
+  IMG_DYNABOMB_ACTIVE,                 100,
+  IMG_EXPLOSION,                       16,
+  IMG_EMPTY_SPACE,                     20,                     HA_NEXT,
+
+  IMG_DYNABOMB_NR,                     -1,                     HA_NEXT,
+
+  IMG_DYNABOMB_SZ,                     -1,                     HA_NEXT,
+
+  IMG_SPACESHIP_RIGHT,                 16,
+  IMG_SPACESHIP_UP,                    16,
+  IMG_SPACESHIP_LEFT,                  16,
+  IMG_SPACESHIP_DOWN,                  16,                     HA_NEXT,
+
+  IMG_BUG_RIGHT,                       16,
+  IMG_BUG_UP,                          16,
+  IMG_BUG_LEFT,                                16,
+  IMG_BUG_DOWN,                                16,                     HA_NEXT,
+
+  IMG_BD_BUTTERFLY,                    -1,                     HA_NEXT,
+
+  IMG_BD_FIREFLY,                      -1,                     HA_NEXT,
+
+  IMG_PACMAN_RIGHT,                    16,
+  IMG_PACMAN_UP,                       16,
+  IMG_PACMAN_LEFT,                     16,
+  IMG_PACMAN_DOWN,                     16,                     HA_NEXT,
+
+  IMG_YAMYAM,                          -1,                     HA_NEXT,
+
+  IMG_DARK_YAMYAM,                     -1,                     HA_NEXT,
+
+  IMG_ROBOT,                           -1,                     HA_NEXT,
+
+  IMG_MOLE_RIGHT_MOVING,               16,
+  IMG_MOLE_UP_MOVING,                  16,
+  IMG_MOLE_LEFT_MOVING,                        16,
+  IMG_MOLE_DOWN_MOVING,                        16,                     HA_NEXT,
+
+  IMG_PENGUIN_RIGHT_MOVING,            16,
+  IMG_PENGUIN_UP_MOVING,               16,
+  IMG_PENGUIN_LEFT_MOVING,             16,
+  IMG_PENGUIN_DOWN_MOVING,             16,                     HA_NEXT,
+
+  IMG_PIG_RIGHT_MOVING,                        16,
+  IMG_PIG_UP_MOVING,                   16,
+  IMG_PIG_LEFT_MOVING,                 16,
+  IMG_PIG_DOWN_MOVING,                 16,                     HA_NEXT,
+
+  IMG_DRAGON_RIGHT_MOVING,             16,
+  IMG_DRAGON_UP_MOVING,                        16,
+  IMG_DRAGON_LEFT_MOVING,              16,
+  IMG_DRAGON_DOWN_MOVING,              16,                     HA_NEXT,
+
+  IMG_SATELLITE,                       -1,                     HA_NEXT,
+
+  IMG_ROBOT_WHEEL,                     50,
+  IMG_ROBOT_WHEEL_ACTIVE,              100,                    HA_NEXT,
+
+  IMG_LAMP,                            50,
+  IMG_LAMP_ACTIVE,                     50,                     HA_NEXT,
+
+  IMG_TIME_ORB_FULL,                   50,
+  IMG_TIME_ORB_EMPTY,                  50,                     HA_NEXT,
+
+  IMG_AMOEBA_DROP,                     50,
+  IMG_AMOEBA_CREATING,                 6,
+  IMG_AMOEBA_WET,                      20,                     HA_NEXT,
+
+  IMG_AMOEBA_DEAD,                     -1,                     HA_NEXT,
+
+  IMG_AMOEBA_WET,                      -1,                     HA_NEXT,
+
+  IMG_AMOEBA_WET,                      100,
+  IMG_AMOEBA_CREATING,                 6,                      HA_NEXT,
+
+  IMG_AMOEBA_FULL,                     50,
+  IMG_AMOEBA_DEAD,                     50,
+  IMG_EXPLOSION,                       16,
+  IMG_DIAMOND,                         20,                     HA_NEXT,
+
+  IMG_GAMEOFLIFE,                      -1,                     HA_NEXT,
+
+  IMG_BIOMAZE,                         -1,                     HA_NEXT,
+
+  IMG_MAGIC_WALL_ACTIVE,               -1,                     HA_NEXT,
+
+  IMG_BD_MAGIC_WALL_ACTIVE,            -1,                     HA_NEXT,
+
+  IMG_EXIT_CLOSED,                     200,
+  IMG_EXIT_OPENING,                    16,
+  IMG_EXIT_OPEN,                       100,                    HA_NEXT,
+
+  IMG_EXIT_OPEN,                       -1,                     HA_NEXT,
+
+  IMG_SOKOBAN_OBJECT,                  -1,                     HA_NEXT,
+
+  IMG_SOKOBAN_FIELD_EMPTY,             -1,                     HA_NEXT,
+
+  IMG_SOKOBAN_FIELD_FULL,              -1,                     HA_NEXT,
+
+  IMG_SPEED_PILL,                      -1,                     HA_NEXT,
+
+  HA_END
+};
 static char *helpscreen_eltext[][2] =
 {
  {"THE HERO:",                         "(Is _this_ guy good old Rockford?)"},
@@ -608,7 +821,7 @@ static char *helpscreen_eltext[][2] =
  {"Sokoban element: Field with object", "which can be pushed away"},
  {"Speed pill: Lets the player run",    "twice as fast as normally"},
 };
-static int num_helpscreen_els = sizeof(helpscreen_eltext)/(2*sizeof(char *));
+static int num_helpscreen_els = sizeof(helpscreen_eltext) / (2*sizeof(char *));
 
 static char *helpscreen_music[][3] =
 {
@@ -623,7 +836,8 @@ static char *helpscreen_music[][3] =
 static int num_helpscreen_music = 7;
 static int helpscreen_musicpos;
 
-void DrawHelpScreenElAction(int start)
+#if 0
+void OLD_DrawHelpScreenElAction(int start)
 {
   int i = 0, j = 0;
   int frame, graphic;
@@ -685,6 +899,81 @@ void DrawHelpScreenElAction(int start)
     MarkTileDirty(1,i);
   }
 }
+#endif
+
+void DrawHelpScreenElAction(int start)
+{
+  int i = 0, j = 0;
+  int xstart = SX + 16;
+  int ystart = SY + 64 + 2 * 32;
+  int ystep = TILEY + 4;
+  int graphic;
+  int frame_count;
+  int sync_frame;
+  int frame;
+
+  while (helpscreen_action[j] != HA_END)
+  {
+    if (i >= start + MAX_HELPSCREEN_ELS || i >= num_helpscreen_els)
+      break;
+    else if (i < start)
+    {
+      while (helpscreen_action[j] != HA_NEXT)
+       j++;
+
+      j++;
+      i++;
+
+      continue;
+    }
+
+    j += 2 * helpscreen_step[i-start];
+    graphic = helpscreen_action[j++];
+    frame_count = helpscreen_action[j++];
+    if (frame_count == -1)
+      frame_count = 1000000;
+
+    if (helpscreen_frame[i-start] == 0)
+    {
+      sync_frame = 0;
+      helpscreen_frame[i-start] = frame_count - 1;
+    }
+    else
+    {
+      sync_frame = frame_count - helpscreen_frame[i-start];
+      helpscreen_frame[i-start]--;
+    }
+
+    if (helpscreen_action[j] == HA_NEXT)
+    {
+      if (!helpscreen_frame[i-start])
+       helpscreen_step[i-start] = 0;
+    }
+    else
+    {
+      if (!helpscreen_frame[i-start])
+       helpscreen_step[i-start]++;
+      while(helpscreen_action[j] != HA_NEXT)
+       j++;
+    }
+    j++;
+
+    frame = getGraphicAnimationFrame(graphic, sync_frame);
+
+    DrawGraphicExt(drawto, xstart, ystart + (i-start) * ystep,
+                  graphic, frame);
+
+    i++;
+  }
+
+  for(i=2; i<16; i++)
+  {
+    MarkTileDirty(0, i);
+    MarkTileDirty(1, i);
+  }
+
+  FrameCounter++;
+}
 
 void DrawHelpScreenElText(int start)
 {
@@ -812,7 +1101,7 @@ void DrawHelpScreen()
   CloseDoor(DOOR_CLOSE_2);
 
   for(i=0;i<MAX_HELPSCREEN_ELS;i++)
-    helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
+    helpscreen_step[i] = helpscreen_frame[i] = 0;
   helpscreen_musicpos = 0;
   helpscreen_state = 0;
   DrawHelpScreenElText(0);
@@ -836,8 +1125,10 @@ void HandleHelpScreen(int button)
     if (helpscreen_state < num_helpscreen_els_pages - 1)
     {
       for(i=0;i<MAX_HELPSCREEN_ELS;i++)
-       helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
+       helpscreen_step[i] = helpscreen_frame[i] = 0;
       helpscreen_state++;
+
+      FrameCounter = 0;
       DrawHelpScreenElText(helpscreen_state * MAX_HELPSCREEN_ELS);
       DrawHelpScreenElAction(helpscreen_state * MAX_HELPSCREEN_ELS);
     }
@@ -868,7 +1159,7 @@ void HandleHelpScreen(int button)
   }
   else
   {
-    if (DelayReached(&hs_delay, GAME_FRAME_DELAY * 2))
+    if (DelayReached(&hs_delay, GAME_FRAME_DELAY))
     {
       if (helpscreen_state < num_helpscreen_els_pages)
        DrawHelpScreenElAction(helpscreen_state * MAX_HELPSCREEN_ELS);
index 6a9bf818832e6c0474b97c258ec6c125a3dfb302..e241c79adb289bdb3fe69614687019ebf79a8aed 100644 (file)
@@ -768,23 +768,26 @@ void DrawPlayer(struct PlayerInfo *player)
   MarkTileDirty(sx,sy);
 }
 
-void DrawGraphicAnimationExt(int x, int y, int graphic, int mask_mode)
+void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
+                            int graphic, int mask_mode)
 {
-  if (IN_SCR_FIELD(x, y) &&
-      (FrameCounter % new_graphic_info[graphic].anim_delay) == 0)
-  {
-    int frame = getGraphicAnimationFrame(graphic, -1);
+  int frame = getGraphicAnimationFrame(graphic, -1);
 
-    if (mask_mode == USE_MASKING)
-      DrawGraphicThruMask(x, y, graphic, frame);
-    else
-      DrawGraphic(x, y, graphic, frame);
-  }
+  if (mask_mode == USE_MASKING)
+    DrawGraphicThruMaskExt(dst_bitmap, x, y, graphic, frame);
+  else
+    DrawGraphicExt(dst_bitmap, x, y, graphic, frame);
 }
 
 void DrawGraphicAnimation(int x, int y, int graphic)
 {
-  DrawGraphicAnimationExt(x, y, graphic, NO_MASKING);
+  if (!IN_SCR_FIELD(x, y) ||
+      (FrameCounter % new_graphic_info[graphic].anim_delay) != 0)
+    return;
+
+  DrawGraphicAnimationExt(drawto_field, FX + x * TILEX, FY + y * TILEY,
+                         graphic, NO_MASKING);
+  MarkTileDirty(x, y);
 }
 
 #if 1
@@ -876,7 +879,7 @@ void DrawGraphic(int x, int y, int graphic, int frame)
   MarkTileDirty(x, y);
 }
 
-#if 1
+#if 0
 void DrawOldGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic)
 {
   Bitmap *src_bitmap;
index d4fdb2693b0788c3086b7f0c014805f3df0bba46..2ed87114decea686f130ce2f106dc780e4e49a76 100644 (file)
@@ -72,9 +72,12 @@ void DrawPlayerField(int, int);
 void DrawPlayer(struct PlayerInfo *);
 int getGraphicAnimationFrame(int, int);
 void DrawGraphicAnimation(int, int, int);
+void DrawGraphicAnimationExt(DrawBuffer *, int, int, int, int);
 void getGraphicSource(int, int, Bitmap **, int *, int *);
 void DrawGraphic(int, int, int, int);
+#if 0
 void DrawOldGraphicExt(DrawBuffer *, int, int, int);
+#endif
 void DrawGraphicExt(DrawBuffer *, int, int, int, int);
 void DrawGraphicThruMask(int, int, int, int);
 void DrawGraphicThruMaskExt(DrawBuffer *, int, int, int, int);