From: Holger Schemel Date: Wed, 21 Mar 2007 23:12:57 +0000 (+0100) Subject: rnd-20070322-1-src X-Git-Tag: 3.2.4^2~58 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9233f6cfc90e72b7cc168c570fdd2e545f698674;p=rocksndiamonds.git rnd-20070322-1-src * fixed small bug with recognizing also ".font_xyz" style definitions --- diff --git a/ChangeLog b/ChangeLog index 94704133..02087c82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2007-03-21 * improved menu fading, adding separate fading definitions for entering and leaving a menu and for fading between menu and "content" screens + * fixed small bug with recognizing also ".font_xyz" style definitions 2007-03-20 * improved menu fading, adding separate fading definitions for fading diff --git a/src/conftime.h b/src/conftime.h index 0ef70a99..b44c1e5a 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-03-21 20:42" +#define COMPILE_DATE_STRING "2007-03-22 00:11" diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 7a780511..25df21ca 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -584,6 +584,14 @@ boolean strEqual(char *s1, char *s2) strcmp(s1, s2) == 0); } +boolean strEqualN(char *s1, char *s2, int n) +{ + return (s1 == NULL && s2 == NULL ? TRUE : + s1 == NULL && s2 != NULL ? FALSE : + s1 != NULL && s2 == NULL ? FALSE : + strncmp(s1, s2, n) == 0); +} + /* ------------------------------------------------------------------------- */ /* command line option handling functions */ @@ -1829,7 +1837,7 @@ int get_parameter_value(char *value_raw, char *suffix, int type) string_has_parameter(value, "crossfade") ? FADE_MODE_CROSSFADE : FADE_MODE_DEFAULT); } - else if (strEqual(suffix, ".font")) + else if (strEqualN(suffix, ".font", 5)) /* (may also be ".font_xyz") */ { result = gfx.get_font_from_token_function(value); } diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 4b9ead4f..8ac0f007 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -106,6 +106,7 @@ char *getStringCopy(char *); char *getStringToLower(char *); void setString(char **, char *); boolean strEqual(char *, char *); +boolean strEqualN(char *, char *, int); void GetOptions(char **, void (*print_usage_function)(void)); diff --git a/src/screens.c b/src/screens.c index a1126a79..b7e4572a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1459,6 +1459,20 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) } #endif +#if 0 + { + game_status = GAME_MODE_PSEUDO_PREVIEW; + + DrawText(20, 400, "text_3.PREVIEW", FONT_TEXT_3); + DrawText(20, 420, "text_4.PREVIEW", FONT_TEXT_4); + + game_status = GAME_MODE_MAIN; + + DrawText(20, 440, "text_3.MAIN", FONT_TEXT_3); + DrawText(20, 460, "text_4.MAIN", FONT_TEXT_4); + } +#endif + #if 1 FadeIn(redraw_mask); #else @@ -1579,9 +1593,11 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) DrawInfoScreen_NotAvailable("Title screen information:", "No title screen for this level set."); +#if 0 /* use default settings for fading, but always disable auto delay */ fading = title_default; fading.auto_delay = -1; +#endif return; } @@ -1630,8 +1646,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) return; } +#if 1 + if (fading.auto_delay > 0 && DelayReached(&title_delay, fading.auto_delay)) + button = MB_MENU_CHOICE; +#else if (fading.auto_delay > -1 && DelayReached(&title_delay, fading.auto_delay)) button = MB_MENU_CHOICE; +#endif if (button == MB_MENU_LEAVE) {