X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=menu.c;h=864dcbbb9ebafa02352c6b480feb6d1890668980;hb=346a62627336fb1f89c9342b4d32b154b1338c1a;hp=8067e63f5f7f4d9f62c0b2a219870f7039d444db;hpb=1dc239f97a1e99a72d17de824029d3c95664669b;p=xonotic%2Fdarkplaces.git diff --git a/menu.c b/menu.c index 8067e63f..864dcbbb 100644 --- a/menu.c +++ b/menu.c @@ -107,7 +107,7 @@ static void M_ModList_Key (int key, int ascii); static qboolean m_entersound; ///< play after drawing a frame, so caching won't disrupt the sound -void M_Update_Return_Reason(char *s) +void M_Update_Return_Reason(const char *s) { strlcpy(m_return_reason, s, sizeof(m_return_reason)); if (s) @@ -121,8 +121,8 @@ void M_Update_Return_Reason(char *s) #define NumberOfNehahraDemos 34 typedef struct nehahrademonames_s { - char *name; - char *desc; + const char *name; + const char *desc; } nehahrademonames_t; static nehahrademonames_t NehahraDemos[NumberOfNehahraDemos] = @@ -167,8 +167,8 @@ static float menu_x, menu_y, menu_width, menu_height; static void M_Background(int width, int height) { - menu_width = bound(1, width, vid_conwidth.integer); - menu_height = bound(1, height, vid_conheight.integer); + menu_width = bound(1.0f, (float)width, vid_conwidth.value); + menu_height = bound(1.0f, (float)height, vid_conheight.value); menu_x = (vid_conwidth.integer - menu_width) * 0.5; menu_y = (vid_conheight.integer - menu_height) * 0.5; //DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0); @@ -279,14 +279,14 @@ void M_ToggleMenu(int mode) if ((key_dest != key_menu && key_dest != key_menu_grabbed) || m_state != m_main) { - if(mode == 1) - return; + if(mode == 0) + return; // the menu is off, and we want it off M_Menu_Main_f (); } else { - if(mode == 0) - return; + if(mode == 1) + return; // the menu is on, and we want it on key_dest = key_game; m_state = m_none; } @@ -817,12 +817,13 @@ static int loadable[MAX_SAVEGAMES]; static void M_ScanSaves (void) { - int i, j, len; + int i, j; + size_t len; char name[MAX_OSPATH]; char buf[SAVEGAME_COMMENT_LENGTH + 256]; const char *t; qfile_t *f; - int version; +// int version; for (i=0 ; i