X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=menu.c;h=804e42c1818c01d1ea3a6bc1ef67f7d41141570f;hb=2961039d9bd10e9aa838e243728e4b1acb03bb2c;hp=e13a43f490be568dea52facc62f6ef0abe76ac9b;hpb=01946832d5e1aeae1f707457a4f032b58b5de52c;p=xonotic%2Fdarkplaces.git diff --git a/menu.c b/menu.c index e13a43f4..804e42c1 100644 --- a/menu.c +++ b/menu.c @@ -829,8 +829,8 @@ static void M_ScanSaves (void) { strlcpy (m_filenames[i], "--- UNUSED SLOT ---", sizeof(m_filenames[i])); loadable[i] = false; - sprintf (name, "s%i.sav", (int)i); - f = FS_Open (name, "rb", false, false); + dpsnprintf (name, sizeof(name), "s%i.sav", (int)i); + f = FS_OpenRealFile (name, "rb", false); if (!f) continue; // read enough to get the comment @@ -1508,9 +1508,9 @@ static void M_DrawSlider (int x, int y, float num, float rangemin, float rangema M_DrawCharacter (x+i*8, y, 130); M_DrawCharacter (x + (SLIDER_RANGE-1)*8 * range, y, 131); if (fabs((int)num - num) < 0.01) - sprintf(text, "%i", (int)num); + dpsnprintf(text, sizeof(text), "%i", (int)num); else - sprintf(text, "%.3f", num); + dpsnprintf(text, sizeof(text), "%.3f", num); M_Print(x + (SLIDER_RANGE+2) * 8, y, text); } @@ -2176,7 +2176,7 @@ static void M_Options_ColorControl_Draw (void) float x, c, s, t, u, v; cachepic_t *p, *dither; - dither = Draw_CachePic ("gfx/colorcontrol/ditherpattern"); + dither = Draw_CachePic_Flags ("gfx/colorcontrol/ditherpattern", CACHEPICFLAG_NOCLAMP); M_Background(320, 256); @@ -2511,7 +2511,7 @@ static int bind_grab; void M_Menu_Keys_f (void) { - key_dest = key_menu; + key_dest = key_menu_grabbed; m_state = m_keys; m_entersound = true; } @@ -2634,7 +2634,7 @@ static void M_Keys_Key (int k, char ascii) } else //if (k != '`') { - sprintf (cmd, "bind \"%s\" \"%s\"\n", Key_KeynumToString (k), bindnames[keys_cursor][0]); + dpsnprintf (cmd, sizeof(cmd), "bind \"%s\" \"%s\"\n", Key_KeynumToString (k), bindnames[keys_cursor][0]); Cbuf_InsertText (cmd); } @@ -3272,7 +3272,7 @@ void M_Menu_LanConfig_f (void) if (StartingGame) lanConfig_cursor = 1; lanConfig_port = 26000; - sprintf(lanConfig_portname, "%u", (unsigned int) lanConfig_port); + dpsnprintf(lanConfig_portname, sizeof(lanConfig_portname), "%u", (unsigned int) lanConfig_port); M_Update_Return_Reason(""); } @@ -3438,7 +3438,7 @@ static void M_LanConfig_Key (int key, char ascii) l = atoi(lanConfig_portname); if (l <= 65535) lanConfig_port = l; - sprintf(lanConfig_portname, "%u", (unsigned int) lanConfig_port); + dpsnprintf(lanConfig_portname, sizeof(lanConfig_portname), "%u", (unsigned int) lanConfig_port); } //============================================================================= @@ -5166,6 +5166,8 @@ void MP_Init (void) // note: OP_STATE is not supported by menu qc, we don't even try to detect // it here + in_client_mouse = true; + // call the prog init PRVM_ExecuteProgram(prog->funcoffsets.m_init,"m_init() required");