X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=ab1d2be1188928f23ee4fc54d066a8de9c5fee02;hb=1db2f63d60082eadc1ef59bb872060edb1c7efb6;hp=af53b7f83651a5d9b2b733181182a891deee6078;hpb=1f9ffbb0cc61dd3b7216d71141d047383d7700c8;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index af53b7f8..ab1d2be1 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1482,6 +1482,8 @@ void DrawMainMenu() LoadLevel(level_nr); LoadScore(level_nr); + SaveLevelSetup_SeriesInfo(); + // set this after "ChangeViewportPropertiesIfNeeded()" (which may reset it) SetDrawDeactivationMask(REDRAW_NONE); SetDrawBackgroundMask(REDRAW_FIELD); @@ -1785,6 +1787,8 @@ void HandleMainMenu_SelectLevel(int step, int direction, int selected_level_nr) LoadTape(level_nr); DrawCompleteVideoDisplay(); + SaveLevelSetup_SeriesInfo(); + /* needed because DrawPreviewLevelInitial() takes some time */ BackToFront(); /* SyncDisplay(); */ @@ -3308,6 +3312,13 @@ void DrawInfoScreen_Version() DrawTextF(xstart1, ystart2, font_header, "Version"); DrawTextF(xstart2, ystart2, font_text, getProgramVersionString()); + if (!strEqual(getProgramVersionString(), getProgramRealVersionString())) + { + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_header, "Version (real)"); + DrawTextF(xstart2, ystart2, font_text, getProgramRealVersionString()); + } + ystart2 += ystep; DrawTextF(xstart1, ystart2, font_header, "Platform"); DrawTextF(xstart2, ystart2, font_text, PLATFORM_STRING); @@ -5593,12 +5604,10 @@ static Key getSetupKey() while (!got_key_event) { - if (PendingEvent()) /* got event */ - { - Event event; - - NextEvent(&event); + Event event; + if (NextValidEvent(&event)) + { switch (event.type) { case EVENT_KEYPRESS: @@ -5631,7 +5640,9 @@ static Key getSetupKey() static int getSetupValueFont(int type, void *value) { - if (type & TYPE_KEY) + if (type & TYPE_GHOSTED) + return FONT_OPTION_OFF; + else if (type & TYPE_KEY) return (type & TYPE_QUERY ? FONT_INPUT_1_ACTIVE : FONT_VALUE_1); else if (type & TYPE_STRING) return FONT_VALUE_2; @@ -5809,6 +5820,28 @@ static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx) ToggleFullscreenOrChangeWindowScalingIfNeeded(); } +static struct TokenInfo *getSetupInfoFinal(struct TokenInfo *setup_info_orig) +{ + static struct TokenInfo *setup_info_hide = NULL; + int list_size = 0; + int list_pos = 0; + int i; + + /* determine maximum list size of target list */ + while (setup_info_orig[list_size++].type != 0); + + /* free, allocate and clear memory for target list */ + checked_free(setup_info_hide); + setup_info_hide = checked_calloc(list_size * sizeof(struct TokenInfo)); + + /* copy setup info list without setup entries marked as hidden */ + for (i = 0; setup_info_orig[i].type != 0; i++) + if (!hideSetupEntry(setup_info_orig[i].value)) + setup_info_hide[list_pos++] = setup_info_orig[i]; + + return setup_info_hide; +} + static void DrawSetupScreen_Generic() { int fade_mask = REDRAW_FIELD; @@ -5908,6 +5941,9 @@ static void DrawSetupScreen_Generic() title_string = "Setup Shortcuts"; } + /* use modified setup info without setup entries marked as hidden */ + setup_info = getSetupInfoFinal(setup_info); + DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string); // determine maximal number of setup entries that can be displayed on screen @@ -6252,12 +6288,10 @@ void CustomizeKeyboard(int player_nr) while (!finished) { - if (PendingEvent()) /* got event */ - { - Event event; - - NextEvent(&event); + Event event; + if (NextValidEvent(&event)) + { switch (event.type) { case EVENT_KEYPRESS: