From: Holger Schemel Date: Thu, 14 Apr 2016 19:25:46 +0000 (+0200) Subject: added support for separate animations for 'main only' and 'type name' screen X-Git-Tag: 4.0.0.0-rc1~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3466bff66861926f480a96e5b8923a4e044d50a4;p=rocksndiamonds.git added support for separate animations for 'main only' and 'type name' screen --- diff --git a/src/cartoons.c b/src/cartoons.c index e90b2e58..2e74c72b 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -26,21 +26,24 @@ #define ANIM_CLASS_BIT_TITLE_INITIAL 0 #define ANIM_CLASS_BIT_TITLE 1 -#define ANIM_CLASS_BIT_SUBMENU 2 -#define ANIM_CLASS_BIT_MENU 3 -#define ANIM_CLASS_BIT_TOONS 4 +#define ANIM_CLASS_BIT_MAIN 2 +#define ANIM_CLASS_BIT_SUBMENU 3 +#define ANIM_CLASS_BIT_MENU 4 +#define ANIM_CLASS_BIT_TOONS 5 -#define NUM_ANIM_CLASSES 5 +#define NUM_ANIM_CLASSES 6 #define ANIM_CLASS_NONE 0 #define ANIM_CLASS_TITLE_INITIAL (1 << ANIM_CLASS_BIT_TITLE_INITIAL) #define ANIM_CLASS_TITLE (1 << ANIM_CLASS_BIT_TITLE) +#define ANIM_CLASS_MAIN (1 << ANIM_CLASS_BIT_MAIN) #define ANIM_CLASS_SUBMENU (1 << ANIM_CLASS_BIT_SUBMENU) #define ANIM_CLASS_MENU (1 << ANIM_CLASS_BIT_MENU) #define ANIM_CLASS_TOONS (1 << ANIM_CLASS_BIT_TOONS) -#define ANIM_CLASS_TOONS_MENU (ANIM_CLASS_TOONS | \ - ANIM_CLASS_MENU) +#define ANIM_CLASS_TOONS_MENU_MAIN (ANIM_CLASS_TOONS | \ + ANIM_CLASS_MENU | \ + ANIM_CLASS_MAIN) #define ANIM_CLASS_TOONS_MENU_SUBMENU (ANIM_CLASS_TOONS | \ ANIM_CLASS_MENU | \ @@ -130,7 +133,8 @@ struct GameModeAnimClass { GAME_MODE_LEVELNR, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_INFO, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_SETUP, ANIM_CLASS_TOONS_MENU_SUBMENU }, - { GAME_MODE_MAIN, ANIM_CLASS_TOONS_MENU }, + { GAME_MODE_PSEUDO_MAINONLY, ANIM_CLASS_TOONS_MENU_MAIN }, + { GAME_MODE_PSEUDO_TYPENAME, ANIM_CLASS_TOONS_MENU_MAIN }, { GAME_MODE_SCORES, ANIM_CLASS_TOONS }, { -1, -1 } @@ -144,6 +148,7 @@ struct AnimClassGameMode { { ANIM_CLASS_BIT_TITLE_INITIAL, GAME_MODE_TITLE_INITIAL }, { ANIM_CLASS_BIT_TITLE, GAME_MODE_TITLE }, + { ANIM_CLASS_BIT_MAIN, GAME_MODE_MAIN }, { ANIM_CLASS_BIT_SUBMENU, GAME_MODE_PSEUDO_SUBMENU }, { ANIM_CLASS_BIT_MENU, GAME_MODE_PSEUDO_MENU }, { ANIM_CLASS_BIT_TOONS, GAME_MODE_PSEUDO_TOONS }, diff --git a/src/main.c b/src/main.c index 71cc74d6..69b72b4e 100644 --- a/src/main.c +++ b/src/main.c @@ -5499,6 +5499,7 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { ".PANEL", GFX_SPECIAL_ARG_PANEL, }, { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, }, { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, }, + { ".MAINONLY", GFX_SPECIAL_ARG_MAINONLY, }, { ".TYPENAME", GFX_SPECIAL_ARG_TYPENAME, }, { ".SUBMENU", GFX_SPECIAL_ARG_SUBMENU, }, { ".MENU", GFX_SPECIAL_ARG_MENU, }, diff --git a/src/main.h b/src/main.h index cea3c982..ec4a4679 100644 --- a/src/main.h +++ b/src/main.h @@ -1809,14 +1809,15 @@ #define GFX_SPECIAL_ARG_PANEL 24 #define GFX_SPECIAL_ARG_PREVIEW 25 #define GFX_SPECIAL_ARG_CRUMBLED 26 -#define GFX_SPECIAL_ARG_TYPENAME 27 -#define GFX_SPECIAL_ARG_SUBMENU 28 -#define GFX_SPECIAL_ARG_MENU 29 -#define GFX_SPECIAL_ARG_TOONS 30 -#define GFX_SPECIAL_ARG_FADING 31 -#define GFX_SPECIAL_ARG_QUIT 32 +#define GFX_SPECIAL_ARG_MAINONLY 27 +#define GFX_SPECIAL_ARG_TYPENAME 28 +#define GFX_SPECIAL_ARG_SUBMENU 29 +#define GFX_SPECIAL_ARG_MENU 30 +#define GFX_SPECIAL_ARG_TOONS 31 +#define GFX_SPECIAL_ARG_FADING 32 +#define GFX_SPECIAL_ARG_QUIT 33 -#define NUM_SPECIAL_GFX_ARGS 33 +#define NUM_SPECIAL_GFX_ARGS 34 /* these additional definitions are currently only used for draw offsets */ #define GFX_SPECIAL_ARG_INFO_MAIN 0 @@ -2026,14 +2027,15 @@ #define GAME_MODE_PSEUDO_PANEL 24 #define GAME_MODE_PSEUDO_PREVIEW 25 #define GAME_MODE_PSEUDO_CRUMBLED 26 -#define GAME_MODE_PSEUDO_TYPENAME 27 -#define GAME_MODE_PSEUDO_SUBMENU 28 -#define GAME_MODE_PSEUDO_MENU 29 -#define GAME_MODE_PSEUDO_TOONS 30 -#define GAME_MODE_PSEUDO_FADING 31 -#define GAME_MODE_QUIT 32 - -#define NUM_GAME_MODES 33 +#define GAME_MODE_PSEUDO_MAINONLY 27 +#define GAME_MODE_PSEUDO_TYPENAME 28 +#define GAME_MODE_PSEUDO_SUBMENU 29 +#define GAME_MODE_PSEUDO_MENU 30 +#define GAME_MODE_PSEUDO_TOONS 31 +#define GAME_MODE_PSEUDO_FADING 32 +#define GAME_MODE_QUIT 33 + +#define NUM_GAME_MODES 34 /* special definitions currently only used for custom artwork configuration */ #define MUSIC_PREFIX_BACKGROUND 0 diff --git a/src/tools.c b/src/tools.c index bd235f94..8610e510 100644 --- a/src/tools.c +++ b/src/tools.c @@ -8277,7 +8277,17 @@ void JoinRectangles(int *x, int *y, int *width, int *height, void SetAnimStatus(int anim_status_new) { + if (anim_status_new == GAME_MODE_MAIN) + anim_status_new = GAME_MODE_PSEUDO_MAINONLY; + global.anim_status_next = anim_status_new; + + // directly set screen modes that are entered without fading + if ((global.anim_status == GAME_MODE_PSEUDO_MAINONLY && + global.anim_status_next == GAME_MODE_PSEUDO_TYPENAME) || + (global.anim_status == GAME_MODE_PSEUDO_TYPENAME && + global.anim_status_next == GAME_MODE_PSEUDO_MAINONLY)) + global.anim_status = global.anim_status_next; } void SetGameStatus(int game_status_new)