X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=3be57faf78ea796d4bd4e638bd56b4bd72f2f829;hb=4239ba2adc93afb81230b1a4ea42e7eaf68452c6;hp=297d5dce7870e747d9c05666f4528d7631c2ceb6;hpb=cacc5129ff29981490cb53d43aeca8264b7f176c;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 297d5dce..3be57faf 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2748,48 +2748,6 @@ int get_parameter_value(char *value_raw, char *suffix, int type) return result; } -struct ScreenModeInfo *get_screen_mode_from_string(char *screen_mode_string) -{ - static struct ScreenModeInfo screen_mode; - char *screen_mode_string_x = strchr(screen_mode_string, 'x'); - char *screen_mode_string_copy; - char *screen_mode_string_pos_w; - char *screen_mode_string_pos_h; - - if (screen_mode_string_x == NULL) /* invalid screen mode format */ - return NULL; - - screen_mode_string_copy = getStringCopy(screen_mode_string); - - screen_mode_string_pos_w = screen_mode_string_copy; - screen_mode_string_pos_h = strchr(screen_mode_string_copy, 'x'); - *screen_mode_string_pos_h++ = '\0'; - - screen_mode.width = atoi(screen_mode_string_pos_w); - screen_mode.height = atoi(screen_mode_string_pos_h); - - return &screen_mode; -} - -void get_aspect_ratio_from_screen_mode(struct ScreenModeInfo *screen_mode, - int *x, int *y) -{ - float aspect_ratio = (float)screen_mode->width / (float)screen_mode->height; - float aspect_ratio_new; - int i = 1; - - do - { - *x = i * aspect_ratio + 0.000001; - *y = i; - - aspect_ratio_new = (float)*x / (float)*y; - - i++; - } - while (aspect_ratio_new != aspect_ratio && *y < screen_mode->height); -} - static void FreeCustomArtworkList(struct ArtworkListInfo *, struct ListNodeInfo ***, int *);