X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_menu.c;h=171704b0ae818a4bdc8097ef983b5637173f6083;hb=fc156eaa76fec92ffefa68ed4d2e4b0fc2542144;hp=b1bc04dff7f6afbd91fcc71d5a55c3af2adadfef;hpb=7094cf70ed46d1e6f0ef900b53c8af039933354e;p=freeglut diff --git a/src/fg_menu.c b/src/fg_menu.c index b1bc04d..171704b 100644 --- a/src/fg_menu.c +++ b/src/fg_menu.c @@ -213,10 +213,10 @@ static GLboolean fghCheckMenuStatus( SFG_Menu* menu ) } menu->ActiveEntry = menuEntry; - menu->IsActive = GL_TRUE; /* XXX Do we need this? */ + menu->IsActive = GL_TRUE; /* - * OKi, we have marked that entry as active, but it would be also + * OK, we have marked that entry as active, but it would be also * nice to have its contents updated, in case it's a sub menu. * Also, ignore the return value of the check function: */ @@ -633,15 +633,6 @@ GLboolean fgCheckActiveMenu ( SFG_Window *window, int button, GLboolean pressed, /* Could reopen again in different location, as is_clicked remains false */ } - /* - * XXX Why does an active menu require a redisplay at - * XXX this point? If this can come out cleanly, then - * XXX it probably should do so; if not, a comment should - * XXX explain it. - */ - if( ! window->IsMenu ) - window->State.Redisplay = GL_TRUE; - is_handled = GL_TRUE; } @@ -659,8 +650,6 @@ GLboolean fgCheckActiveMenu ( SFG_Window *window, int button, GLboolean pressed, if (window->State.MouseX>0 && window->State.MouseY>0 && window->State.MouseXState.Width && window->State.MouseYState.Height) { - /* XXX Posting a requisite Redisplay seems bogus. */ - window->State.Redisplay = GL_TRUE; fghActivateMenu( window, button ); is_handled = GL_TRUE; } @@ -892,19 +881,23 @@ void FGAPIENTRY glutAddSubMenu( const char *label, int subMenuID ) /* * Changes the current menu's font */ -void FGAPIENTRY glutSetMenuFont( void* fontID ) +void FGAPIENTRY glutSetMenuFont( int menuID, void* fontID ) { SFG_Font* font; + SFG_Menu* menu; FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetMenuFont" ); - freeglut_return_if_fail( fgStructure.CurrentMenu ); + menu = fgMenuByID( menuID ); + freeglut_return_if_fail( menu ); if (fgGetActiveMenu()) fgError("Menu manipulation not allowed while menus in use."); font = fghFontByID( fontID ); if (!font) + { fgWarning("glutChangeMenuFont: bitmap font 0x%08x not found. Make sure you're not passing a stroke font. Ignoring...\n",fontID); - freeglut_return_if_fail( font ); + return; + } fgStructure.CurrentMenu->Font = fontID; fghCalculateMenuBoxSize( );