rnd-20030830-2-src
authorHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2003 12:24:28 +0000 (14:24 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:43:34 +0000 (10:43 +0200)
src/conf_fnt.c
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/game.c
src/main.c
src/main.h
src/tools.c
src/tools.h

index 0a191dda15f257a76f19a1f25fb52e882c988d34..ef44d5383c5bc8d4c9bf4611ce53264338907131 100644 (file)
@@ -75,6 +75,10 @@ font_to_graphic[] =
     FONT_TEXT_1,                               GFX_SPECIAL_ARG_PREVIEW,
     IMG_FONT_TEXT_1_PREVIEW
   },
+  {
+    FONT_TEXT_1,                               GFX_SPECIAL_ARG_PLAYING,
+    IMG_FONT_TEXT_1_PLAYING
+  },
   {
     FONT_TEXT_1,                               GFX_SPECIAL_ARG_SCORES,
     IMG_FONT_TEXT_1_SCORES
index 258b7fde0750671b85b9d325a81940bade85311d..3bd3223f096da4b3e149e708c5e4cd29b7a89e50 100644 (file)
@@ -3263,6 +3263,11 @@ struct ConfigInfo image_config[] =
   { "font.text_1.PREVIEW.y",                   "160"                   },
   { "font.text_1.PREVIEW.width",               "16"                    },
   { "font.text_1.PREVIEW.height",              "16"                    },
+  { "font.text_1.PLAYING",                     "RocksFontEM.pcx"       },
+  { "font.text_1.PLAYING.x",                   "0"                     },
+  { "font.text_1.PLAYING.y",                   "160"                   },
+  { "font.text_1.PLAYING.width",               "16"                    },
+  { "font.text_1.PLAYING.height",              "16"                    },
   { "font.text_1.SCORES",                      "RocksFontMedium.pcx"   },
   { "font.text_1.SCORES.x",                    "0"                     },
   { "font.text_1.SCORES.y",                    "480"                   },
index 41fe2b22700ff03e067fa8cc47790449c846d233..71edd97e3339fbdeca4999c96fa96693f06b1f8b 100644 (file)
 #define IMG_FONT_TEXT_1                                        1227
 #define IMG_FONT_TEXT_1_LEVELS                         1228
 #define IMG_FONT_TEXT_1_PREVIEW                                1229
-#define IMG_FONT_TEXT_1_SCORES                         1230
-#define IMG_FONT_TEXT_1_ACTIVE_SCORES                  1231
-#define IMG_FONT_TEXT_2                                        1232
-#define IMG_FONT_TEXT_2_LEVELS                         1233
-#define IMG_FONT_TEXT_2_PREVIEW                                1234
-#define IMG_FONT_TEXT_2_SCORES                         1235
-#define IMG_FONT_TEXT_2_ACTIVE_SCORES                  1236
-#define IMG_FONT_TEXT_3                                        1237
-#define IMG_FONT_TEXT_3_LEVELS                         1238
-#define IMG_FONT_TEXT_3_PREVIEW                                1239
-#define IMG_FONT_TEXT_3_SCORES                         1240
-#define IMG_FONT_TEXT_3_ACTIVE_SCORES                  1241
-#define IMG_FONT_TEXT_4                                        1242
-#define IMG_FONT_TEXT_4_LEVELS                         1243
-#define IMG_FONT_TEXT_4_SCORES                         1244
-#define IMG_FONT_TEXT_4_ACTIVE_SCORES                  1245
-#define IMG_FONT_INPUT_1                               1246
-#define IMG_FONT_INPUT_1_MAIN                          1247
-#define IMG_FONT_INPUT_1_ACTIVE                                1248
-#define IMG_FONT_INPUT_1_ACTIVE_MAIN                   1249
-#define IMG_FONT_INPUT_1_ACTIVE_SETUP                  1250
-#define IMG_FONT_INPUT_2                               1251
-#define IMG_FONT_INPUT_2_ACTIVE                                1252
-#define IMG_FONT_OPTION_OFF                            1253
-#define IMG_FONT_OPTION_ON                             1254
-#define IMG_FONT_VALUE_1                               1255
-#define IMG_FONT_VALUE_2                               1256
-#define IMG_FONT_VALUE_OLD                             1257
-#define IMG_FONT_LEVEL_NUMBER                          1258
-#define IMG_FONT_TAPE_RECORDER                         1259
-#define IMG_FONT_GAME_INFO                             1260
-#define IMG_GLOBAL_BORDER                              1261
-#define IMG_GLOBAL_DOOR                                        1262
-#define IMG_EDITOR_ELEMENT_BORDER                      1263
-#define IMG_EDITOR_ELEMENT_BORDER_INPUT                        1264
-#define IMG_BACKGROUND                                 1265
-#define IMG_BACKGROUND_MAIN                            1266
-#define IMG_BACKGROUND_LEVELS                          1267
-#define IMG_BACKGROUND_SCORES                          1268
-#define IMG_BACKGROUND_EDITOR                          1269
-#define IMG_BACKGROUND_INFO                            1270
-#define IMG_BACKGROUND_SETUP                           1271
-#define IMG_BACKGROUND_DOOR                            1272
+#define IMG_FONT_TEXT_1_PLAYING                                1230
+#define IMG_FONT_TEXT_1_SCORES                         1231
+#define IMG_FONT_TEXT_1_ACTIVE_SCORES                  1232
+#define IMG_FONT_TEXT_2                                        1233
+#define IMG_FONT_TEXT_2_LEVELS                         1234
+#define IMG_FONT_TEXT_2_PREVIEW                                1235
+#define IMG_FONT_TEXT_2_SCORES                         1236
+#define IMG_FONT_TEXT_2_ACTIVE_SCORES                  1237
+#define IMG_FONT_TEXT_3                                        1238
+#define IMG_FONT_TEXT_3_LEVELS                         1239
+#define IMG_FONT_TEXT_3_PREVIEW                                1240
+#define IMG_FONT_TEXT_3_SCORES                         1241
+#define IMG_FONT_TEXT_3_ACTIVE_SCORES                  1242
+#define IMG_FONT_TEXT_4                                        1243
+#define IMG_FONT_TEXT_4_LEVELS                         1244
+#define IMG_FONT_TEXT_4_SCORES                         1245
+#define IMG_FONT_TEXT_4_ACTIVE_SCORES                  1246
+#define IMG_FONT_INPUT_1                               1247
+#define IMG_FONT_INPUT_1_MAIN                          1248
+#define IMG_FONT_INPUT_1_ACTIVE                                1249
+#define IMG_FONT_INPUT_1_ACTIVE_MAIN                   1250
+#define IMG_FONT_INPUT_1_ACTIVE_SETUP                  1251
+#define IMG_FONT_INPUT_2                               1252
+#define IMG_FONT_INPUT_2_ACTIVE                                1253
+#define IMG_FONT_OPTION_OFF                            1254
+#define IMG_FONT_OPTION_ON                             1255
+#define IMG_FONT_VALUE_1                               1256
+#define IMG_FONT_VALUE_2                               1257
+#define IMG_FONT_VALUE_OLD                             1258
+#define IMG_FONT_LEVEL_NUMBER                          1259
+#define IMG_FONT_TAPE_RECORDER                         1260
+#define IMG_FONT_GAME_INFO                             1261
+#define IMG_GLOBAL_BORDER                              1262
+#define IMG_GLOBAL_DOOR                                        1263
+#define IMG_EDITOR_ELEMENT_BORDER                      1264
+#define IMG_EDITOR_ELEMENT_BORDER_INPUT                        1265
+#define IMG_BACKGROUND                                 1266
+#define IMG_BACKGROUND_MAIN                            1267
+#define IMG_BACKGROUND_LEVELS                          1268
+#define IMG_BACKGROUND_SCORES                          1269
+#define IMG_BACKGROUND_EDITOR                          1270
+#define IMG_BACKGROUND_INFO                            1271
+#define IMG_BACKGROUND_SETUP                           1272
+#define IMG_BACKGROUND_DOOR                            1273
 
-#define NUM_IMAGE_FILES                                        1273
+#define NUM_IMAGE_FILES                                        1274
 
 #endif /* CONF_GFX_H */
index 728e804b69b184c63a6a6665ef60adf3d94c8331..b3ed1b20eae8bddd2c462c851fb449b097ead5b2 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-08-30 03:37]"
+#define COMPILE_DATE_STRING "[2003-08-30 14:20]"
index 184a258f8017b161dfc11d3ad30678ecf9ba34bf..91c8841ab9657c815e9cdb87359febc4adf9b0d7 100644 (file)
@@ -1989,6 +1989,75 @@ void CheckDynamite(int x, int y)
   Bang(x, y);
 }
 
+void ShowEnvelope()
+{
+  int i, x, y;
+
+  /* open envelope window horizontally */
+  for (i=2; i <= level.envelope_xsize + 2; i += 2)
+  {
+    int startx = (SXSIZE / MINI_TILEX - i) / 2;
+    int starty = (SYSIZE / MINI_TILEY) / 2 - 1;
+
+    SetDrawtoField(DRAW_BUFFERED);
+
+    BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY);
+
+    SetDrawtoField(DRAW_BACKBUFFER);
+
+    for (y=0; y < 2; y++) for (x=0; x < i; x++)
+    {
+      int ex = (x == 0 ? -1 : x == i - 1 ? +1 : 0);
+      int ey = (y == 0 ? -1 : y == 1     ? +1 : 0);
+
+      DrawEnvelopeBorder(startx + x, starty + y, ex, ey);
+    }
+
+    redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER;
+    BackToFront();
+
+    Delay(GAME_FRAME_DELAY);
+  }
+
+  /* open envelope window vertically */
+  for (i=2; i <= level.envelope_ysize + 2; i += 2)
+  {
+    int xsize = level.envelope_xsize + 2;
+    int startx = (SXSIZE / MINI_TILEX - (xsize - 1)) / 2;
+    int starty = (SYSIZE / MINI_TILEY - i) / 2;
+
+    SetDrawtoField(DRAW_BUFFERED);
+
+    BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY);
+
+    SetDrawtoField(DRAW_BACKBUFFER);
+
+    for (y=0; y < i; y++) for (x=0; x < xsize; x++)
+    {
+      int ex = (x == 0 ? -1 : x == xsize - 1 ? +1 : 0);
+      int ey = (y == 0 ? -1 : y == i - 1     ? +1 : 0);
+
+      DrawEnvelopeBorder(startx + x, starty + y, ex, ey);
+    }
+
+    DrawTextToTextArea(SX + (startx + 1) * MINI_TILEX,
+                      SY + (starty + 1) * MINI_TILEY, level.envelope,
+                      FONT_TEXT_1, level.envelope_xsize, i - 2);
+
+    redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER;
+    BackToFront();
+
+    Delay(GAME_FRAME_DELAY);
+  }
+
+  Delay(3000);
+
+  SetDrawtoField(DRAW_BUFFERED);
+
+  redraw_mask |= REDRAW_FIELD;
+  BackToFront();
+}
+
 void RelocatePlayer(int x, int y, int element)
 {
   struct PlayerInfo *player = &stored_player[element - EL_PLAYER_1];
@@ -7511,6 +7580,10 @@ int DigField(struct PlayerInfo *player,
                             el2edimg(EL_KEY_1 + key_nr));
          redraw_mask |= REDRAW_DOOR_1;
        }
+       else if (element == EL_ENVELOPE)
+       {
+         ShowEnvelope();
+       }
        else if (IS_DROPPABLE(element)) /* can be collected and dropped */
        {
          int i;
index 479e0122634d42a0a02e6964d4c0c175f6469794..380af747136b26ab94b5d9de164e54381a4e2c27 100644 (file)
@@ -3687,6 +3687,7 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] =
   { ".EDITOR",         GAME_MODE_EDITOR,               },
   { ".INFO",           GAME_MODE_INFO,                 },
   { ".SETUP",          GAME_MODE_SETUP,                },
+  { ".PLAYING",                GAME_MODE_PLAYING,              },
   { ".DOOR",           GAME_MODE_PSEUDO_DOOR,          },
   { ".PREVIEW",                GAME_MODE_PSEUDO_PREVIEW,       },
   { ".CRUMBLED",       GAME_MODE_PSEUDO_CRUMBLED,      },
index 8a0fca2c30269df31ab100a379625bde365543bf..68ad89ca303d0a240c3c656f0e3d25204e26c355 100644 (file)
 #define GFX_SPECIAL_ARG_EDITOR                 3
 #define GFX_SPECIAL_ARG_INFO                   4
 #define GFX_SPECIAL_ARG_SETUP                  5
-#define GFX_SPECIAL_ARG_DOOR                   6
-#define GFX_SPECIAL_ARG_PREVIEW                        7
-#define GFX_SPECIAL_ARG_CRUMBLED               8
+#define GFX_SPECIAL_ARG_PLAYING                        6
+#define GFX_SPECIAL_ARG_DOOR                   7
+#define GFX_SPECIAL_ARG_PREVIEW                        8
+#define GFX_SPECIAL_ARG_CRUMBLED               9
 
-#define NUM_SPECIAL_GFX_ARGS                   9
+#define NUM_SPECIAL_GFX_ARGS                   10
 
 
 /* values for image configuration suffixes */
 #define GAME_MODE_EDITOR                       3
 #define GAME_MODE_INFO                         4
 #define GAME_MODE_SETUP                                5
-#define GAME_MODE_PSEUDO_DOOR                  6
-#define GAME_MODE_PSEUDO_PREVIEW               7
-#define GAME_MODE_PSEUDO_CRUMBLED              8
+#define GAME_MODE_PLAYING                      6
+#define GAME_MODE_PSEUDO_DOOR                  7
+#define GAME_MODE_PSEUDO_PREVIEW               8
+#define GAME_MODE_PSEUDO_CRUMBLED              9
 
 /* there are no special config file suffixes for these modes */
-#define GAME_MODE_PLAYING                      9
 #define GAME_MODE_PSEUDO_TYPENAME              10
 #define GAME_MODE_QUIT                         11
 
index 9d48e4b3ba1e7f6ee8a1747dd8cea42f56494645..28c64bdff9d704f9f72ec8b88aefca8874a77757 100644 (file)
@@ -1371,12 +1371,12 @@ static int getBorderElement(int x, int y)
     { EL_STEELWALL,                    EL_INVISIBLE_STEELWALL             }
   };
   int steel_type = (BorderElement == EL_STEELWALL ? 0 : 1);
-  int steel_position = (x == -1 && y == -1                     ? 0 :
-                       x == lev_fieldx && y == -1              ? 1 :
-                       x == -1 && y == lev_fieldy              ? 2 :
-                       x == lev_fieldx && y == lev_fieldy      ? 3 :
-                       x == -1 || x == lev_fieldx              ? 4 :
-                       y == -1 || y == lev_fieldy              ? 5 : 6);
+  int steel_position = (x == -1                && y == -1              ? 0 :
+                       x == lev_fieldx && y == -1              ? 1 :
+                       x == -1         && y == lev_fieldy      ? 2 :
+                       x == lev_fieldx && y == lev_fieldy      ? 3 :
+                       x == -1         || x == lev_fieldx      ? 4 :
+                       y == -1         || y == lev_fieldy      ? 5 : 6);
 
   return border[steel_position][steel_type];
 }
@@ -1525,6 +1525,31 @@ void DrawMiniElementOrWall(int sx, int sy, int scroll_x, int scroll_y)
     DrawMiniGraphic(sx, sy, el2edimg(getBorderElement(x, y)));
 }
 
+void DrawEnvelopeBorder(int sx, int sy, int ex, int ey)
+{
+  int border[8][2] =
+  {
+    { EL_STEELWALL_TOPLEFT,            EL_INVISIBLE_STEELWALL_TOPLEFT     },
+    { EL_STEELWALL_TOPRIGHT,           EL_INVISIBLE_STEELWALL_TOPRIGHT    },
+    { EL_STEELWALL_BOTTOMLEFT,         EL_INVISIBLE_STEELWALL_BOTTOMLEFT  },
+    { EL_STEELWALL_BOTTOMRIGHT,                EL_INVISIBLE_STEELWALL_BOTTOMRIGHT },
+    { EL_STEELWALL_VERTICAL,           EL_INVISIBLE_STEELWALL_VERTICAL    },
+    { EL_STEELWALL_HORIZONTAL,         EL_INVISIBLE_STEELWALL_HORIZONTAL  },
+    { EL_STEELWALL,                    EL_INVISIBLE_STEELWALL             },
+    { EL_EMPTY,                                EL_EMPTY                           }
+  };
+  int steel_type = (BorderElement == EL_STEELWALL ? 0 : 1);
+  int steel_position = (ex == -1 && ey == -1 ? 0 :
+                       ex == +1 && ey == -1 ? 1 :
+                       ex == -1 && ey == +1 ? 2 :
+                       ex == +1 && ey == +1 ? 3 :
+                       ex == -1 || ex == +1 ? 4 :
+                       ey == -1 || ey == +1 ? 5 : 7);
+  int element = border[steel_position][steel_type];
+
+  DrawMiniGraphic(sx, sy, el2edimg(element));
+}
+
 void getMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
 {
   Bitmap *src_bitmap = graphic_info[graphic].bitmap;
index e7a65872bcf2593d3e54ce884610504637990567..05f6ed307983cd7f70713ac19359b477e4e2b5f5 100644 (file)
@@ -112,6 +112,7 @@ void DrawLevelField(int, int);
 
 void DrawMiniElement(int, int, int);
 void DrawMiniElementOrWall(int, int, int, int);
+void DrawEnvelopeBorder(int, int, int, int);
 
 void getMicroGraphicSource(int, Bitmap **, int *, int *);
 void DrawMicroElement(int, int, int);