projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added using headless mode (no window) when converting levels
[rocksndiamonds.git]
/
src
/
init.c
diff --git
a/src/init.c
b/src/init.c
index c480850c72a723c632524d9dc71c79a8d6b19841..97eaf2bf17ddfbb20f4f3d76c932626cf9a18978 100644
(file)
--- a/
src/init.c
+++ b/
src/init.c
@@
-219,13
+219,26
@@
void InitElementSmallImages()
print_timestamp_done("InitElementSmallImages");
}
print_timestamp_done("InitElementSmallImages");
}
+inline static void InitScaledImagesScaledUp(int graphic)
+{
+ struct GraphicInfo *g = &graphic_info[graphic];
+
+ ScaleImage(graphic, g->scale_up_factor);
+}
+
void InitScaledImages()
{
void InitScaledImages()
{
+ struct PropertyMapping *property_mapping = getImageListPropertyMapping();
+ int num_property_mappings = getImageListPropertyMappingSize();
int i;
/* scale normal images from static configuration, if not already scaled */
for (i = 0; i < NUM_IMAGE_FILES; i++)
int i;
/* scale normal images from static configuration, if not already scaled */
for (i = 0; i < NUM_IMAGE_FILES; i++)
- ScaleImage(i, graphic_info[i].scale_up_factor);
+ InitScaledImagesScaledUp(i);
+
+ /* scale images from dynamic configuration, if not already scaled */
+ for (i = 0; i < num_property_mappings; i++)
+ InitScaledImagesScaledUp(property_mapping[i].artwork_index);
}
void InitBitmapPointers()
}
void InitBitmapPointers()
@@
-1344,13
+1357,13
@@
static void set_graphic_parameters_ext(int graphic, int *parameter,
if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE)
{
if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE)
{
- anim_frames_per_row =
src_image_width / g->tile_size
;
- anim_frames_per_col =
src_image_height / g->tile_size
;
+ anim_frames_per_row =
MAX(1, src_image_width / g->tile_size)
;
+ anim_frames_per_col =
MAX(1, src_image_height / g->tile_size)
;
}
else
{
}
else
{
- anim_frames_per_row =
src_image_width / g->width
;
- anim_frames_per_col =
src_image_height / g->height
;
+ anim_frames_per_row =
MAX(1, src_image_width / g->width)
;
+ anim_frames_per_col =
MAX(1, src_image_height / g->height)
;
}
g->src_image_width = src_image_width;
}
g->src_image_width = src_image_width;
@@
-1697,6
+1710,9
@@
static void InitGraphicInfo()
src_x = graphic_info[i].src_x;
src_y = graphic_info[i].src_y;
src_x = graphic_info[i].src_x;
src_y = graphic_info[i].src_y;
+ if (program.headless)
+ continue;
+
if (src_x < 0 || src_y < 0 ||
src_x + width > src_bitmap_width ||
src_y + height > src_bitmap_height)
if (src_x < 0 || src_y < 0 ||
src_x + width > src_bitmap_width ||
src_y + height > src_bitmap_height)
@@
-4948,6
+4964,9
@@
void Execute_Command(char *command)
while (*str_ptr != ' ' && *str_ptr != '\t' && *str_ptr != '\0')
str_ptr++;
}
while (*str_ptr != ' ' && *str_ptr != '\t' && *str_ptr != '\0')
str_ptr++;
}
+
+ if (global.autoplay_mode == AUTOPLAY_MODE_TEST)
+ program.headless = TRUE;
}
else if (strPrefix(command, "convert "))
{
}
else if (strPrefix(command, "convert "))
{
@@
-4962,6
+4981,8
@@
void Execute_Command(char *command)
*str_ptr++ = '\0'; /* terminate leveldir string */
global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
}
*str_ptr++ = '\0'; /* terminate leveldir string */
global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
}
+
+ program.headless = TRUE;
}
else if (strPrefix(command, "create images "))
{
}
else if (strPrefix(command, "create images "))
{
@@
-5504,6
+5525,9
@@
static void InitMusic(char *identifier)
static void InitArtworkDone()
{
static void InitArtworkDone()
{
+ if (program.headless)
+ return;
+
InitGlobalAnimations();
}
InitGlobalAnimations();
}
@@
-5891,6
+5915,8
@@
void OpenAll()
print_timestamp_time("[init setup/config stuff (1)]");
print_timestamp_time("[init setup/config stuff (1)]");
+ InitScoresInfo();
+
if (options.execute_command)
Execute_Command(options.execute_command);
if (options.execute_command)
Execute_Command(options.execute_command);
@@
-5926,7
+5952,7
@@
void OpenAll()
InitVideoDisplay();
InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
InitVideoDisplay();
InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
- Init
EventFilter(FilterEvents
);
+ Init
OverlayInfo(
);
print_timestamp_time("[init video stuff]");
print_timestamp_time("[init video stuff]");