X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=16a3fc1b77b8e2e57758487aa5bd2258935eaba5;hb=ef10463b42e40a7a4327cf0b2e2cf926160eac9e;hp=421238bebf31da5c0e423d6764cb15d1efe4b75d;hpb=a99a1803e5097bc598b4c6f73259715da148ab27;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 421238be..16a3fc1b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -252,6 +252,7 @@ static void DrawChooseLevelSet(void); static void DrawChooseLevelNr(void); static void DrawInfoScreen(void); static void DrawSetupScreen(void); +static void DrawTypeName(void); static void DrawInfoScreen_NotAvailable(char *, char *); static void DrawInfoScreen_HelpAnim(int, int, boolean); @@ -680,6 +681,8 @@ static char *main_text_title_1 = NULL; static char *main_text_title_2 = NULL; static char *main_text_title_3 = NULL; +extern char debug_xsn_mode[]; + struct MainControlInfo { int nr; @@ -2078,7 +2081,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) { SetGameStatus(GAME_MODE_PSEUDO_TYPENAME); - HandleTypeName(strlen(setup.player_name), 0); + DrawTypeName(); } } else if (pos == MAIN_CONTROL_LEVELS) @@ -3692,6 +3695,10 @@ static void DrawInfoScreen_Version(void) DrawTextF(xstart1, ystart, font_head, "Source date"); DrawTextF(xstart2, ystart, font_text, getSourceDateString()); + ystart += ystep_line; + + DrawTextF(xstart1, ystart, font_head, "Commit hash"); + DrawTextF(xstart2, ystart, font_text, getSourceHashString()); ystart += ystep_para; DrawTextF(xstart1, ystart, font_head, "Library"); @@ -3954,7 +3961,7 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button) // type name functions // ============================================================================ -void HandleTypeName(int newxpos, Key key) +static void HandleTypeNameExt(boolean initialize, Key key) { static char last_player_name[MAX_PLAYER_NAME_LEN + 1]; struct MainControlInfo *mci = getMainControlInfo(MAIN_CONTROL_NAME); @@ -3971,11 +3978,11 @@ void HandleTypeName(int newxpos, Key key) DrawBackgroundForFont(startx,starty, pos->width, pos->height, font_active_nr); - if (newxpos) + if (initialize) { strcpy(last_player_name, setup.player_name); - xpos = newxpos; + xpos = strlen(setup.player_name); StartTextInput(startx, starty, pos->width, pos->height); } @@ -4028,6 +4035,16 @@ void HandleTypeName(int newxpos, Key key) } } +static void DrawTypeName(void) +{ + HandleTypeNameExt(TRUE, 0); +} + +void HandleTypeName(Key key) +{ + HandleTypeNameExt(FALSE, key); +} + // ============================================================================ // tree menu functions @@ -6387,6 +6404,7 @@ static struct TokenInfo setup_info_graphics[] = { TYPE_SWITCH, &setup.show_titlescreen,"Show Title Screens:" }, { TYPE_SWITCH, &setup.toons, "Show Menu Animations:" }, { TYPE_SWITCH, &setup.small_game_graphics, "Small Game Graphics:" }, + { TYPE_YES_NO_AUTO, &setup.debug.xsn_mode, debug_xsn_mode }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execSetupMain, "Back" }, @@ -6757,6 +6775,10 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) if (startx + font_xoffset < text_startx + text_width + text_font_xoffset) { + // when using narrow font, left-shifting text "auto" not needed + if (type & TYPE_YES_NO_AUTO) + xpos += 1; + xpos += 1; startx = mSX + xpos * 32; @@ -7543,7 +7565,7 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick) Event event; int alpha = 200, alpha_step = -1; int alpha_ticks = 0; - char mapping[4096], temp[4096]; + char mapping[4096], temp[256]; int font_name = MENU_SETUP_FONT_TITLE; int font_info = MENU_SETUP_FONT_TEXT; int spacing_name = menu.line_spacing_setup[SETUP_MODE_INPUT]; @@ -8714,7 +8736,7 @@ static void CreateScreenMenubuttons(void) GDI_END); if (gi == NULL) - Error(ERR_EXIT, "cannot create gadget"); + Fail("cannot create gadget"); screen_gadget[id] = gi; } @@ -8782,7 +8804,7 @@ static void CreateScreenScrollbuttons(void) GDI_END); if (gi == NULL) - Error(ERR_EXIT, "cannot create gadget"); + Fail("cannot create gadget"); screen_gadget[id] = gi; } @@ -8863,7 +8885,7 @@ static void CreateScreenScrollbars(void) GDI_END); if (gi == NULL) - Error(ERR_EXIT, "cannot create gadget"); + Fail("cannot create gadget"); screen_gadget[id] = gi; } @@ -8909,7 +8931,7 @@ static void CreateScreenTextInputGadgets(void) GDI_END); if (gi == NULL) - Error(ERR_EXIT, "cannot create gadget"); + Fail("cannot create gadget"); screen_gadget[id] = gi; }