X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Finit.c;h=3bb81ac08527d9bf7c84df25a4c58fea28d8202f;hp=c1faec094d8c91545a5b03913eb601984acc2fa8;hb=16273849f6e953b1fc9b651b51cee61c1f57d4f6;hpb=115ce6f2da1914d68b0fe0e5f9082973190dacdd diff --git a/src/init.c b/src/init.c index c1faec09..3bb81ac0 100644 --- a/src/init.c +++ b/src/init.c @@ -88,7 +88,7 @@ static int copy_properties[][5] = static int get_graphic_parameter_value(char *, char *, int); -void DrawInitAnim(void) +static void DrawInitAnim(void) { struct GraphicInfo *graphic_info_last = graphic_info; int graphic = 0; @@ -136,7 +136,21 @@ void DrawInitAnim(void) FrameCounter++; } -void FreeGadgets(void) +static void DrawProgramInfo(void) +{ + int font1_nr = FC_YELLOW; + int font2_nr = FC_RED; + int font2_height = getFontHeight(font2_nr); + int ypos1 = 20; + int ypos2 = 50; + int ypos3 = WIN_YSIZE - 20 - font2_height; + + DrawInitText(getProgramInitString(), ypos1, font1_nr); + DrawInitText(setup.internal.program_copyright, ypos2, font2_nr); + DrawInitText(setup.internal.program_website, ypos3, font2_nr); +} + +static void FreeGadgets(void) { FreeLevelEditorGadgets(); FreeGameButtons(); @@ -171,7 +185,7 @@ inline static void InitElementSmallImagesScaledUp(int graphic) CreateImageWithSmallImages(graphic, g->scale_up_factor, g->tile_size); } -void InitElementSmallImages(void) +static void InitElementSmallImages(void) { print_timestamp_init("InitElementSmallImages"); @@ -233,7 +247,7 @@ inline static void InitScaledImagesScaledUp(int graphic) ScaleImage(graphic, g->scale_up_factor); } -void InitScaledImages(void) +static void InitScaledImages(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -248,7 +262,7 @@ void InitScaledImages(void) InitScaledImagesScaledUp(property_mapping[i].artwork_index); } -void InitBitmapPointers(void) +static void InitBitmapPointers(void) { int num_images = getImageListSize(); int i; @@ -333,7 +347,7 @@ static int getFontFromToken(char *token) return FONT_INITIAL_1; } -void InitFontGraphicInfo(void) +static void InitFontGraphicInfo(void) { static struct FontBitmapInfo *font_bitmap_info = NULL; struct PropertyMapping *property_mapping = getImageListPropertyMapping(); @@ -572,7 +586,7 @@ void InitFontGraphicInfo(void) getFontBitmapID, getFontFromToken); } -void InitGlobalAnimGraphicInfo(void) +static void InitGlobalAnimGraphicInfo(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -644,7 +658,7 @@ void InitGlobalAnimGraphicInfo(void) #endif } -void InitGlobalAnimSoundInfo(void) +static void InitGlobalAnimSoundInfo(void) { struct PropertyMapping *property_mapping = getSoundListPropertyMapping(); int num_property_mappings = getSoundListPropertyMappingSize(); @@ -693,7 +707,7 @@ void InitGlobalAnimSoundInfo(void) #endif } -void InitGlobalAnimMusicInfo(void) +static void InitGlobalAnimMusicInfo(void) { struct PropertyMapping *property_mapping = getMusicListPropertyMapping(); int num_property_mappings = getMusicListPropertyMappingSize(); @@ -742,7 +756,7 @@ void InitGlobalAnimMusicInfo(void) #endif } -void InitElementGraphicInfo(void) +static void InitElementGraphicInfo(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -1123,7 +1137,7 @@ void InitElementGraphicInfo(void) UPDATE_BUSY_STATE(); } -void InitElementSpecialGraphicInfo(void) +static void InitElementSpecialGraphicInfo(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -4874,7 +4888,7 @@ static void InitGlobal(void) global.use_envelope_request = FALSE; } -void Execute_Command(char *command) +static void Execute_Command(char *command) { int i; @@ -5321,13 +5335,12 @@ void InitGfxBuffers(void) InitGfxBuffers_SP(); } -void InitGfx(void) +static void InitGfx(void) { struct GraphicInfo *graphic_info_last = graphic_info; char *filename_font_initial = NULL; char *filename_anim_initial = NULL; Bitmap *bitmap_font_initial = NULL; - int font_height; int i, j; /* determine settings for initial font (for displaying startup messages) */ @@ -5378,12 +5391,7 @@ void InitGfx(void) InitFontGraphicInfo(); - font_height = getFontHeight(FC_RED); - - DrawInitText(getProgramInitString(), 20, FC_YELLOW); - DrawInitText(setup.internal.program_copyright, 50, FC_RED); - DrawInitText(setup.internal.program_website, WIN_YSIZE - 20 - font_height, - FC_RED); + DrawProgramInfo(); DrawInitText("Loading graphics", 120, FC_GREEN); @@ -5490,7 +5498,7 @@ void InitGfx(void) init_last = init; } -void InitGfxBackground(void) +static void InitGfxBackground(void) { fieldbuffer = bitmap_db_field; SetDrawtoField(DRAW_TO_BACKBUFFER); @@ -5634,12 +5642,19 @@ static void InitArtworkDone(void) InitGlobalAnimations(); } -void InitNetworkSettings(void) +static void InitNetworkSettings(void) { - InitNetworkInfo(options.network || setup.network_mode, + boolean network_enabled = (options.network || setup.network_mode); + char *network_server = (options.server_host != NULL ? options.server_host : + setup.network_server_hostname); + + if (strEqual(network_server, STR_NETWORK_AUTO_DETECT)) + network_server = NULL; + + InitNetworkInfo(network_enabled, FALSE, options.serveronly, - options.server_host, + network_server, options.server_port); }