X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ffiles.c;h=1d7af7cdf7e410bd7e3c5a98df65c8c339bca537;hp=c2150acd6a3d02a0d0a1be9fea9266775b53ea7b;hb=9313fb0b8eb8d7fc73baeeb717530623674b95cc;hpb=01f0b2ddf524d4b05ac65b443f44f37f871b17cd diff --git a/src/files.c b/src/files.c index c2150acd..1d7af7cd 100644 --- a/src/files.c +++ b/src/files.c @@ -8935,6 +8935,14 @@ static struct TokenInfo internal_setup_tokens[] = TYPE_STRING, &setup.internal.default_level_series, "default_level_series" }, + { + TYPE_INTEGER, + &setup.internal.default_window_width, "default_window_width" + }, + { + TYPE_INTEGER, + &setup.internal.default_window_height, "default_window_height" + }, { TYPE_BOOLEAN, &setup.internal.choose_from_top_leveldir, "choose_from_top_leveldir" @@ -8944,12 +8952,44 @@ static struct TokenInfo internal_setup_tokens[] = &setup.internal.show_scaling_in_title, "show_scaling_in_title" }, { - TYPE_INTEGER, - &setup.internal.default_window_width, "default_window_width" + TYPE_BOOLEAN, + &setup.internal.menu_game, "menu_game" }, { - TYPE_INTEGER, - &setup.internal.default_window_height, "default_window_height" + TYPE_BOOLEAN, + &setup.internal.menu_editor, "menu_editor" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_graphics, "menu_graphics" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_sound, "menu_sound" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_artwork, "menu_artwork" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_input, "menu_input" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_touch, "menu_touch" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_shortcuts, "menu_shortcuts" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_exit, "menu_exit" + }, + { + TYPE_BOOLEAN, + &setup.internal.menu_save_and_exit, "menu_save_and_exit" }, }; @@ -11495,30 +11535,26 @@ void CreateLevelSketchImages(void) for (i = 0; i < NUM_FILE_ELEMENTS; i++) { - Bitmap *src_bitmap; - int src_x, src_y; int element = getMappedElement(i); - int graphic = el2edimg(element); char basename1[16]; char basename2[16]; char *filename1; char *filename2; - sprintf(basename1, "%03d.bmp", i); - sprintf(basename2, "%03ds.bmp", i); + sprintf(basename1, "%04d.bmp", i); + sprintf(basename2, "%04ds.bmp", i); filename1 = getPath2(global.create_images_dir, basename1); filename2 = getPath2(global.create_images_dir, basename2); - getFixedGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y); - BlitBitmap(src_bitmap, bitmap1, src_x, src_y, TILEX, TILEY, - 0, 0); + DrawSizedElement(0, 0, element, TILESIZE); + BlitBitmap(drawto, bitmap1, SX, SY, 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); + DrawSizedElement(0, 0, element, MINI_TILESIZE); + BlitBitmap(drawto, bitmap2, SX, SY, MINI_TILEX, MINI_TILEY, 0, 0); if (SDL_SaveBMP(bitmap2->surface, filename2) != 0) Error(ERR_EXIT, "cannot save level sketch image file '%s'", filename2); @@ -11526,15 +11562,26 @@ void CreateLevelSketchImages(void) free(filename1); free(filename2); + // create corresponding SQL statements (for normal and small images) + if (i < 1000) + { + printf("insert into phpbb_words values (NULL, '`%03d', '');\n", i, i); + printf("insert into phpbb_words values (NULL, '¸%03d', '');\n", i, i); + } + + printf("insert into phpbb_words values (NULL, '`%04d', '');\n", i, i); + printf("insert into phpbb_words values (NULL, '¸%04d', '');\n", i, i); + + // optional: create content for forum level sketch demonstration post if (options.debug) - printf("%03d `%03d%c", i, i, (i % 10 < 9 ? ' ' : '\n')); + fprintf(stderr, "%03d `%03d%c", i, i, (i % 10 < 9 ? ' ' : '\n')); } FreeBitmap(bitmap1); FreeBitmap(bitmap2); if (options.debug) - printf("\n"); + fprintf(stderr, "\n"); Error(ERR_INFO, "%d normal and small images created", NUM_FILE_ELEMENTS); @@ -11558,7 +11605,7 @@ void CreateCustomElementImages(char *directory) int yoffset_ge = (TILEY * NUM_CUSTOM_ELEMENTS / 16); int i; - SDLInitVideoDisplay(); + InitVideoDefaults(); ReCreateBitmap(&backbuffer, video.width, video.height);