rnd-20030407-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 6 Apr 2003 22:35:02 +0000 (00:35 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:41:01 +0000 (10:41 +0200)
src/conf_fnt.c
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/init.c
src/main.h
src/screens.c
src/tools.c

index 2b839be3d79d642d6737ce93cbc7ff877e3b3b7c..09dbe0076815812b637b1c46b5132f3c6fc41703 100644 (file)
@@ -171,6 +171,10 @@ font_to_graphic[] =
     FONT_TAPE_RECORDER,                                -1,
     IMG_FONT_TAPE_RECORDER
   },
+  {
+    FONT_GAME_INFO,                            -1,
+    IMG_FONT_GAME_INFO
+  },
   {
     -1,                                                -1,
     -1
index 06367d296db97e7a401791f93c6aea84c3a3c2c1..d918b8c5f893844a3985d9f1c7f354d7a6edcfda 100644 (file)
@@ -3291,6 +3291,11 @@ struct ConfigInfo image_config[] =
   { "font.tape_recorder.width",                        "11"                    },
   { "font.tape_recorder.height",               "14"                    },
 
+  { "font.game_info",                          "RocksFontEM.pcx"       },
+  { "font.game_info.xpos",                     "0"                     },
+  { "font.game_info.ypos",                     "0"                     },
+  { "font.game_info.delay",                    "10"                    },
+
   { "global.border",                           "RocksScreen.pcx"       },
   { "global.door",                             "RocksDoor.pcx"         },
 
@@ -3307,32 +3312,6 @@ struct ConfigInfo image_config[] =
   { "background.SETUP",                                UNDEFINED_FILENAME      },
   { "background.DOOR",                         UNDEFINED_FILENAME      },
 
-  { "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"                    },
-
   /* the following directives are not associated with an image,
      but make sense to be defined in "graphicsinfo.conf", too */
 
index 1679146c7dd875d64e41f5034b2a979e972c45d9..9413a02d45651ebfc7e45499540e98b66e30395e 100644 (file)
 #define IMG_FONT_VALUE_OLD                             849
 #define IMG_FONT_LEVEL_NUMBER                          850
 #define IMG_FONT_TAPE_RECORDER                         851
-#define IMG_GLOBAL_BORDER                              852
-#define IMG_GLOBAL_DOOR                                        853
-#define IMG_EDITOR_ELEMENT_BORDER                      854
-#define IMG_BACKGROUND                                 855
-#define IMG_BACKGROUND_MAIN                            856
-#define IMG_BACKGROUND_LEVELS                          857
-#define IMG_BACKGROUND_SCORES                          858
-#define IMG_BACKGROUND_EDITOR                          859
-#define IMG_BACKGROUND_INFO                            860
-#define IMG_BACKGROUND_SETUP                           861
-#define IMG_BACKGROUND_DOOR                            862
-#define IMG_INFO_FONT_EM_1                             863
-#define IMG_INFO_FONT_EM_2                             864
-#define IMG_INFO_FONT_EM_3                             865
-#define IMG_INFO_FONT_EM_4                             866
-#define IMG_INFO_FONT_EM_5                             867
+#define IMG_FONT_GAME_INFO                             852
+#define IMG_GLOBAL_BORDER                              853
+#define IMG_GLOBAL_DOOR                                        854
+#define IMG_EDITOR_ELEMENT_BORDER                      855
+#define IMG_BACKGROUND                                 856
+#define IMG_BACKGROUND_MAIN                            857
+#define IMG_BACKGROUND_LEVELS                          858
+#define IMG_BACKGROUND_SCORES                          859
+#define IMG_BACKGROUND_EDITOR                          860
+#define IMG_BACKGROUND_INFO                            861
+#define IMG_BACKGROUND_SETUP                           862
+#define IMG_BACKGROUND_DOOR                            863
 
-#define NUM_IMAGE_FILES                                        868
+#define NUM_IMAGE_FILES                                        864
 
 #endif /* CONF_GFX_H */
index d03062df0a052f9973e8fb581aa28d31f162276c..de44c3ea49ad1306439bc305c39f5daf9bd152f1 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-04-06 22:55]"
+#define COMPILE_DATE_STRING "[2003-04-07 00:31]"
index 05ccd33732a21659a9648c802b6db09cf61d9967..40ecc4d759b37b0a7d8767933e494e83741a4390 100644 (file)
@@ -383,7 +383,7 @@ void InitFontGraphicInfo()
       int font_bitmap_id = font_info[i].special_bitmap_id[j];
       int graphic = font_info[i].special_graphic[j];
 
-      /* set 'graphic_info' for font entries, if uninitialized */
+      /* set 'graphic_info' for font entries, if uninitialized (guessed) */
       if (graphic_info[graphic].anim_frames < MIN_NUM_CHARS_PER_FONT)
       {
        graphic_info[graphic].anim_frames = DEFAULT_NUM_CHARS_PER_FONT;
index a3ce361adbe422a512545977d6e7bad967a7e627..34e646e59faa984b0e66de8029bdc75cb7459a06 100644 (file)
 
 #define EL_CHAR(c)                     (EL_CHAR_ASCII0 + MAP_FONT_ASCII(c))
 
-#if 0
-#define EL_CHAR(x)                     ((x) == 'Ä' ? EL_CHAR_AE         : \
-                                        (x) == 'Ö' ? EL_CHAR_OE         : \
-                                        (x) == 'Ü' ? EL_CHAR_UE         : \
-                                        (x) == 'ä' ? EL_CHAR_AE         : \
-                                        (x) == 'ö' ? EL_CHAR_OE         : \
-                                        (x) == 'ü' ? EL_CHAR_UE         : \
-                                        (x) == '©' ? EL_CHAR_COPYRIGHT  : \
-                                        (x) == '_' ? EL_CHAR_UNDERSCORE : \
-                                        (x) == '°' ? EL_CHAR_DEGREE     : \
-                                        (x) == '´' ? EL_CHAR_TM         : \
-                                        (x) == '|' ? EL_CHAR_CURSOR     : \
-                                        EL_CHAR_A + (x) - 'A')
-#endif
-
 #define EL_EXPANDABLE_WALL_HORIZONTAL  200
 #define EL_EXPANDABLE_WALL_VERTICAL    201
 #define EL_EXPANDABLE_WALL_ANY         202
 #define FONT_VALUE_1                           16
 #define FONT_VALUE_2                           17
 #define FONT_VALUE_OLD                         18
-#define FONT_TAPE_RECORDER                     19
-#define FONT_LEVEL_NUMBER                      20
+#define FONT_LEVEL_NUMBER                      19
+#define FONT_TAPE_RECORDER                     20
+#define FONT_GAME_INFO                         21
 
-#define NUM_FONTS                              21
+#define NUM_FONTS                              22
 #define NUM_INITIAL_FONTS                      4
 
 /* values for game_status */
index 6e8c548cf2ac3251fe991d0715da35c735645123..0737cd79819653211c767bd71710f3bf841ee912 100644 (file)
@@ -639,11 +639,7 @@ static int helpscreen_action[] =
 
   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_FONT_GAME_INFO,                  -1,                     HA_NEXT,
 
   IMG_EMERALD,                         -1,                     HA_NEXT,
 
index 8bd0a153ebf8483ff3de6a0fc4ac2abbfef96fbc..b29cb819122cbc032a244d5f96c1f78151120222 100644 (file)
@@ -773,15 +773,25 @@ void DrawPlayer(struct PlayerInfo *player)
 
 void getGraphicSource(int graphic, int frame, Bitmap **bitmap, int *x, int *y)
 {
-  Bitmap *src_bitmap = graphic_info[graphic].bitmap;
-  int offset_x = graphic_info[graphic].offset_x;
-  int offset_y = graphic_info[graphic].offset_y;
-  int src_x = graphic_info[graphic].src_x + frame * offset_x;
-  int src_y = graphic_info[graphic].src_y + frame * offset_y;
+  struct GraphicInfo *g = &graphic_info[graphic];
 
-  *bitmap = src_bitmap;
-  *x = src_x;
-  *y = src_y;
+  *bitmap = g->bitmap;
+
+  if (g->offset_y == 0)                /* frames are ordered horizontally */
+  {
+    *x = g->src_x + (frame % g->anim_frames_per_line) * g->offset_x;
+    *y = g->src_y + (frame / g->anim_frames_per_line) * g->height;
+  }
+  else if (g->offset_x == 0)   /* frames are ordered vertically */
+  {
+    *x = g->src_x + (frame / g->anim_frames_per_line) * g->width;
+    *y = g->src_y + (frame % g->anim_frames_per_line) * g->offset_y;
+  }
+  else                         /* frames are ordered diagonally */
+  {
+    *x = g->src_x + frame * g->offset_x;
+    *y = g->src_y + frame * g->offset_y;
+  }
 }
 
 void DrawGraphic(int x, int y, int graphic, int frame)
@@ -883,32 +893,13 @@ void DrawMiniGraphic(int x, int y, int graphic)
 
 void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
 {
-  Bitmap *src_bitmap = graphic_info[graphic].bitmap;
+  struct GraphicInfo *g = &graphic_info[graphic];
   int mini_startx = 0;
-  int mini_starty = src_bitmap->height * 2 / 3;
-  int src_x = mini_startx + graphic_info[graphic].src_x / 2;
-  int src_y = mini_starty + graphic_info[graphic].src_y / 2;
-
-#if 0
-  /* !!! not needed anymore, because of automatically created mini graphics */
-  if (src_x + MINI_TILEX > src_bitmap->width ||
-      src_y + MINI_TILEY > src_bitmap->height)
-  {
-    /* graphic of desired size seems not to be contained in this image;
-       dirty workaround: get it from the middle of the normal sized image */
-
-    printf("::: using dirty workaround for %d (%d, %d)\n",
-          graphic, src_bitmap->width, src_bitmap->height);
+  int mini_starty = g->bitmap->height * 2 / 3;
 
-    getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
-    src_x += (TILEX / 2 - MINI_TILEX / 2);
-    src_y += (TILEY / 2 - MINI_TILEY / 2);
-  }
-#endif
-
-  *bitmap = src_bitmap;
-  *x = src_x;
-  *y = src_y;
+  *bitmap = g->bitmap;
+  *x = mini_startx + g->src_x / 2;
+  *y = mini_starty + g->src_y / 2;
 }
 
 void DrawMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic)