X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=27acb33a5245747fc62cb8479f93652bca414a8c;hb=536e46a4eadb99140f58a8b09a7e25ca02b50680;hp=cdfac29bb3094b75b54c9c212dff24d8c2e4dff5;hpb=095207353ef58a65f5146e6ddc7eefb51bfe0f55;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index cdfac29b..27acb33a 100644 --- a/src/init.c +++ b/src/init.c @@ -239,6 +239,11 @@ void InitGadgets() gadgets_initialized = TRUE; } +inline void InitElementSmallImagesScaledUp(int graphic) +{ + CreateImageWithSmallImages(graphic, graphic_info[graphic].scale_up_factor); +} + void InitElementSmallImages() { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); @@ -247,17 +252,34 @@ void InitElementSmallImages() /* initialize normal images from static configuration */ for (i = 0; element_to_graphic[i].element > -1; i++) - CreateImageWithSmallImages(element_to_graphic[i].graphic); + InitElementSmallImagesScaledUp(element_to_graphic[i].graphic); /* initialize special images from static configuration */ for (i = 0; element_to_special_graphic[i].element > -1; i++) - CreateImageWithSmallImages(element_to_special_graphic[i].graphic); + InitElementSmallImagesScaledUp(element_to_special_graphic[i].graphic); /* initialize images from dynamic configuration */ for (i = 0; i < num_property_mappings; i++) if (property_mapping[i].artwork_index < MAX_NUM_ELEMENTS) - CreateImageWithSmallImages(property_mapping[i].artwork_index); + InitElementSmallImagesScaledUp(property_mapping[i].artwork_index); + +#if 1 + /* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */ + for (i = IMG_EMC_OBJECT; i <= IMG_EMC_TITLE; i++) + InitElementSmallImagesScaledUp(i); +#endif +} + +#if 1 +/* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */ +void SetBitmaps_EM(Bitmap **em_bitmap) +{ + em_bitmap[0] = graphic_info[IMG_EMC_OBJECT].bitmap; + em_bitmap[1] = graphic_info[IMG_EMC_SCORE].bitmap; + em_bitmap[2] = graphic_info[IMG_EMC_SPRITE].bitmap; + em_bitmap[3] = graphic_info[IMG_EMC_TITLE].bitmap; } +#endif static int getFontBitmapID(int font_nr) { @@ -846,6 +868,7 @@ static void set_graphic_parameters(int graphic, char **parameter_raw) graphic_info[graphic].crumbled_like = -1; /* do not use clone element */ graphic_info[graphic].diggable_like = -1; /* do not use clone element */ graphic_info[graphic].border_size = TILEX / 8; /* "CRUMBLED" border size */ + graphic_info[graphic].scale_up_factor = 1; /* default: no scaling up */ graphic_info[graphic].anim_delay_fixed = 0; graphic_info[graphic].anim_delay_random = 0; graphic_info[graphic].post_delay_fixed = 0; @@ -945,6 +968,12 @@ static void set_graphic_parameters(int graphic, char **parameter_raw) if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE) graphic_info[graphic].border_size = parameter[GFX_ARG_BORDER_SIZE]; + /* optional zoom factor for scaling up the image to a larger size */ + if (parameter[GFX_ARG_SCALE_UP] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].scale_up_factor = parameter[GFX_ARG_SCALE_UP]; + if (graphic_info[graphic].scale_up_factor < 1) + graphic_info[graphic].scale_up_factor = 1; /* no scaling */ + /* this is only used for player "boring" and "sleeping" actions */ if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE) graphic_info[graphic].anim_delay_fixed = @@ -4434,28 +4463,26 @@ void OpenAll() game_status = GAME_MODE_MAIN; - DrawMainMenu(); - - InitNetworkServer(); - #if 1 em_open_all(); #endif + DrawMainMenu(); + + InitNetworkServer(); } void CloseAllAndExit(int exit_value) { - -#if 1 - em_close_all(); -#endif - StopSounds(); FreeAllSounds(); FreeAllMusic(); CloseAudio(); /* called after freeing sounds (needed for SDL) */ +#if 1 + em_close_all(); +#endif + FreeAllImages(); FreeTileClipmasks();