CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc
# compile special edition of R'n'D instead of the normal (classic) version
-SPECIAL_EDITION = rnd_jue
+# SPECIAL_EDITION = rnd_jue
# -----------------------------------------------------------------------------
leveltest: all
./Scripts/make_enginetest.sh leveltest
+levelsketch_images: all
+ ./Scripts/make_levelsketch_images.sh
+
backup:
./Scripts/make_backup.sh src 1
}
-/* ------------------------------------------------------------------------- *
- * convert levels
- * ------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
+/* convert levels */
+/* ------------------------------------------------------------------------- */
#define MAX_NUM_CONVERT_LEVELS 1000
CloseAllAndExit(0);
}
+
+
+/* ------------------------------------------------------------------------- */
+/* create images for use in level sketches (raw BMP format) */
+/* ------------------------------------------------------------------------- */
+
+void CreateLevelSketchImages()
+{
+#if defined(TARGET_SDL)
+ Bitmap *bitmap1;
+ Bitmap *bitmap2;
+ int i;
+
+ bitmap1 = CreateBitmap(TILEX, TILEY, DEFAULT_DEPTH);
+ bitmap2 = CreateBitmap(MINI_TILEX, MINI_TILEY, DEFAULT_DEPTH);
+
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ {
+ Bitmap *src_bitmap;
+ int src_x, src_y;
+ int graphic = el2edimg(i);
+ char basename1[16];
+ char basename2[16];
+ char *filename1;
+ char *filename2;
+
+ sprintf(basename1, "%03d.bmp", i);
+ sprintf(basename2, "%03ds.bmp", i);
+
+ filename1 = getPath2(global.create_images_dir, basename1);
+ filename2 = getPath2(global.create_images_dir, basename2);
+
+ getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
+ BlitBitmap(src_bitmap, bitmap1, src_x, src_y, TILEX, TILEY, 0, 0);
+
+ if (SDL_SaveBMP(bitmap1->surface, filename1) != 0)
+ Error(ERR_EXIT, "cannot save level sketch image file '%s'", filename1);
+
+ getMiniGraphicSource(graphic, &src_bitmap, &src_x, &src_y);
+ BlitBitmap(src_bitmap, bitmap2, src_x, src_y, MINI_TILEX, MINI_TILEY, 0, 0);
+
+ if (SDL_SaveBMP(bitmap2->surface, filename2) != 0)
+ Error(ERR_EXIT, "cannot save level sketch image file '%s'", filename2);
+
+ free(filename1);
+ free(filename2);
+
+ if (options.debug)
+ printf("%03d `%03d%c", i, i, (i % 10 < 9 ? ' ' : '\n'));
+ }
+
+ FreeBitmap(bitmap1);
+ FreeBitmap(bitmap2);
+
+ if (options.debug)
+ printf("\n");
+
+ Error(ERR_INFO, "%d normal and small images created", NUM_FILE_ELEMENTS);
+
+ CloseAllAndExit(0);
+#endif
+}
global.autoplay_leveldir = NULL;
global.convert_leveldir = NULL;
+ global.create_images_dir = NULL;
global.frames_per_second = 0;
global.fps_slowdown = FALSE;
global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
}
}
+ else if (strncmp(command, "create images ", 14) == 0)
+ {
+#if defined(TARGET_SDL)
+ global.create_images_dir = getStringCopy(&command[14]);
+
+ if (access(global.create_images_dir, W_OK) != 0)
+ Error(ERR_EXIT, "image target directory '%s' not found or not writable",
+ global.create_images_dir);
+#else
+ Error(ERR_EXIT, "command only available for SDL target");
+#endif
+ }
#if DEBUG
#if defined(TARGET_SDL)
ConvertLevels();
return;
}
+ else if (global.create_images_dir)
+ {
+ CreateLevelSketchImages();
+ return;
+ }
game_status = GAME_MODE_MAIN;