X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=6d409c44c7908b6ffc28c8ceb9d4e9ffe674b3e9;hb=8ff72a216ac9dfefcb4cf85b47063600867ceec2;hp=6a0920abc33d31c726d73e5c90ba3b151478166e;hpb=74550f945f0d175ed304adef5ca38f834ca56623;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 6a0920ab..6d409c44 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1458,6 +1458,11 @@ static void clearMenuListArea(void) // clear menu list area, but not title or scrollbar DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32, scrollbar_xpos - mSX, NUM_MENU_ENTRIES_ON_SCREEN * 32); + + // special compatibility handling for "Snake Bite" graphics set + if (strPrefix(leveldir_current->identifier, "snake_bite")) + ClearRectangle(drawto, mSX, mSY + MENU_SCREEN_START_YPOS * 32, + scrollbar_xpos - mSX, NUM_MENU_ENTRIES_ON_SCREEN * 32); } static void drawCursorExt(int xpos, int ypos, boolean active, int graphic) @@ -5431,7 +5436,7 @@ static void DrawScoreInfo_Content(int entry_nr) ClearField(); - // redraw score selection buttons (which have just been erased) + // redraw level selection buttons (which have just been erased) RedrawScreenMenuGadgets(SCREEN_MASK_SCORES); if (score_entries == NULL) @@ -5528,15 +5533,27 @@ static void DrawScoreInfo(int entry_nr) UnmapAllGadgets(); + FreeScreenGadgets(); + CreateScreenGadgets(); + FadeOut(REDRAW_FIELD); // needed if different viewport properties defined after playing score tape ChangeViewportPropertiesIfNeeded(); + // set this after "ChangeViewportPropertiesIfNeeded()" (which may reset it) + SetDrawDeactivationMask(REDRAW_NONE); + SetDrawBackgroundMask(REDRAW_FIELD); + // needed if different background image defined after playing score tape SetMainBackgroundImage(IMG_BACKGROUND_SCORES); SetMainBackgroundImageIfDefined(IMG_BACKGROUND_SCOREINFO); + // special compatibility handling for "Snake Bite" graphics set + if (strPrefix(leveldir_current->identifier, "snake_bite")) + ClearRectangle(gfx.background_bitmap, gfx.real_sx, gfx.real_sy + 64, + gfx.full_sxsize, gfx.full_sysize - 64); + DrawScoreInfo_Content(entry_nr); // map gadgets for score info screen @@ -9718,12 +9735,18 @@ static void CreateScreenMenubuttons(void) // if x/y set to -1, dynamically place buttons next to title text int title_width = getTextWidth(INFOTEXT_SCORE_ENTRY, FONT_TITLE_1); + // special compatibility handling for "Snake Bite" graphics set + if (strPrefix(leveldir_current->identifier, "snake_bite")) + title_width = strlen(INFOTEXT_SCORE_ENTRY) * 32; + + // use "SX" here to center buttons (ignore horizontal draw offset) if (pos->x == -1) x = (id == SCREEN_CTRL_ID_PREV_LEVEL2 ? SX + (SXSIZE - title_width) / 2 - width * 3 / 2 : id == SCREEN_CTRL_ID_NEXT_LEVEL2 ? SX + (SXSIZE + title_width) / 2 + width / 2 : 0); + // use "mSY" here to place buttons (respect vertical draw offset) if (pos->y == -1) y = (id == SCREEN_CTRL_ID_PREV_LEVEL2 || id == SCREEN_CTRL_ID_NEXT_LEVEL2 ? mSY + MENU_TITLE1_YPOS : 0); @@ -10232,6 +10255,12 @@ static void HandleScreenGadgets(struct GadgetInfo *gi) } } +void HandleScreenGadgetKeys(Key key) +{ + if (key == setup.shortcut.tape_play) + HandleScreenGadgets(screen_gadget[SCREEN_CTRL_ID_PLAY_TAPE]); +} + void DumpScreenIdentifiers(void) { int i;