fixed special function to generate custom element graphics
authorHolger Schemel <info@artsoft.org>
Tue, 3 Mar 2015 15:42:33 +0000 (16:42 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 3 Mar 2015 15:42:33 +0000 (16:42 +0100)
graphics/gfx_classic/Makefile
src/files.c
src/main.c

index 59baa0ea4878c429bb36d52822e1613074ef2d3a..f81b7f4f6fc8228d41f608b24ba612ef62845534 100644 (file)
@@ -53,7 +53,7 @@ all: $(FILES)
        ilbmtoppm $< | pnmtopng > $@
 
 RocksCE.ilbm: RocksCE-template.ilbm
        ilbmtoppm $< | pnmtopng > $@
 
 RocksCE.ilbm: RocksCE-template.ilbm
-       $(RND) -e "create CE image RocksCE.bmp"
+       $(RND) -e "create CE image ."
        bmptoppm RocksCE.bmp | ppmtoilbm > RocksCE.ilbm
        $(RM) RocksCE.bmp
 
        bmptoppm RocksCE.bmp | ppmtoilbm > RocksCE.ilbm
        $(RM) RocksCE.bmp
 
index 94817cddef85e653cb3c5d8a15c7c63887148baf..ff600579fd8150761456211a422276cb30120137 100644 (file)
@@ -9772,19 +9772,22 @@ void CreateLevelSketchImages()
 /* create and save images for custom and group elements (raw BMP format)     */
 /* ------------------------------------------------------------------------- */
 
 /* create and save images for custom and group elements (raw BMP format)     */
 /* ------------------------------------------------------------------------- */
 
-void CreateCustomElementImages(char *filename)
+void CreateCustomElementImages(char *directory)
 {
 #if defined(TARGET_SDL)
   char *src_basename = "RocksCE-template.ilbm";
 {
 #if defined(TARGET_SDL)
   char *src_basename = "RocksCE-template.ilbm";
-  Bitmap *bitmap;
+  char *dst_basename = "RocksCE.bmp";
+  char *src_filename = getPath2(directory, src_basename);
+  char *dst_filename = getPath2(directory, dst_basename);
   Bitmap *src_bitmap;
   Bitmap *src_bitmap;
+  Bitmap *bitmap;
   int yoffset_ce = 0;
   int yoffset_ge = (TILEY * NUM_CUSTOM_ELEMENTS / 16);
   int i;
 
   SDLInitVideoDisplay();
 
   int yoffset_ce = 0;
   int yoffset_ge = (TILEY * NUM_CUSTOM_ELEMENTS / 16);
   int i;
 
   SDLInitVideoDisplay();
 
-  src_bitmap = LoadCustomImage(src_basename);
+  src_bitmap = LoadImage(src_filename);
 
   bitmap = CreateBitmap(TILEX * 16 * 2,
                        TILEY * (NUM_CUSTOM_ELEMENTS + NUM_GROUP_ELEMENTS) / 16,
 
   bitmap = CreateBitmap(TILEX * 16 * 2,
                        TILEY * (NUM_CUSTOM_ELEMENTS + NUM_GROUP_ELEMENTS) / 16,
@@ -9855,8 +9858,8 @@ void CreateCustomElementImages(char *filename)
     }
   }
 
     }
   }
 
-  if (SDL_SaveBMP(bitmap->surface, filename) != 0)
-    Error(ERR_EXIT, "cannot save CE graphics file '%s'", filename);
+  if (SDL_SaveBMP(bitmap->surface, dst_filename) != 0)
+    Error(ERR_EXIT, "cannot save CE graphics file '%s'", dst_filename);
 
   FreeBitmap(bitmap);
 
 
   FreeBitmap(bitmap);
 
index 836e0594df2d850731e86e68f239ec8b534f17c6..17a1b3cb3c31fe0c4b3cd0676ff70b9f62c2c09e 100644 (file)
@@ -5580,7 +5580,7 @@ static void print_usage()
         "  \"autoplay LEVELDIR [NR ...]\"     play level tapes for LEVELDIR\n"
         "  \"convert LEVELDIR [NR]\"          convert levels in LEVELDIR\n"
         "  \"create images DIRECTORY\"        write BMP images to DIRECTORY\n"
         "  \"autoplay LEVELDIR [NR ...]\"     play level tapes for LEVELDIR\n"
         "  \"convert LEVELDIR [NR]\"          convert levels in LEVELDIR\n"
         "  \"create images DIRECTORY\"        write BMP images to DIRECTORY\n"
-        "  \"create CE image FILE\"           write BMP image to FILE\n"
+        "  \"create CE image DIRECTORY\"      write BMP image to DIRECTORY\n"
         "\n",
         program.command_basename);
 }
         "\n",
         program.command_basename);
 }