From dd923608f42e41f8d77c5190e5ab613bbc7b6d21 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 3 Mar 2015 16:42:33 +0100 Subject: [PATCH] fixed special function to generate custom element graphics --- graphics/gfx_classic/Makefile | 2 +- src/files.c | 13 ++++++++----- src/main.c | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/graphics/gfx_classic/Makefile b/graphics/gfx_classic/Makefile index 59baa0ea..f81b7f4f 100644 --- a/graphics/gfx_classic/Makefile +++ b/graphics/gfx_classic/Makefile @@ -53,7 +53,7 @@ all: $(FILES) 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 diff --git a/src/files.c b/src/files.c index 94817cdd..ff600579 100644 --- a/src/files.c +++ b/src/files.c @@ -9772,19 +9772,22 @@ void CreateLevelSketchImages() /* 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"; - 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 *bitmap; 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, @@ -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); diff --git a/src/main.c b/src/main.c index 836e0594..17a1b3cb 100644 --- a/src/main.c +++ b/src/main.c @@ -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" - " \"create CE image FILE\" write BMP image to FILE\n" + " \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n" "\n", program.command_basename); } -- 2.34.1