X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffreeglut_menu.c;h=f49ca5259a562150ddf8e7081a1a0d5f8950a6e1;hb=9338532e9e7986bb018825c869ddeaaa535da8e2;hp=fe7f42d816ec05fe540a04c833b56f4309757643;hpb=1334fab6bdba435989bf7a9112759dea1d4b3696;p=freeglut diff --git a/src/freeglut_menu.c b/src/freeglut_menu.c index fe7f42d..f49ca52 100644 --- a/src/freeglut_menu.c +++ b/src/freeglut_menu.c @@ -79,14 +79,13 @@ /* - * These variables should be moved into the freeglut global state, but for now, - * we'll put them here. They are for rendering the freeglut menu items. + * These variables are for rendering the freeglut menu items. + * * The choices are fore- and background, with and without h for Highlighting. * Old GLUT appeared to be system-dependant for its colors (sigh) so we are * too. These variables should be stuffed into global state and initialized * via the glutInit*() system. */ - #if TARGET_HOST_WIN32 static float menu_pen_fore [4] = {0.0f, 0.0f, 0.0f, 1.0f}; static float menu_pen_back [4] = {0.85f, 0.85f, 0.85f, 1.0f}; @@ -862,15 +861,15 @@ void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int subMenuID SFG_MenuEntry* menuEntry = NULL; freeglut_assert_ready; - freeglut_return_if_fail( fgStructure.Menu != NULL ); - freeglut_return_if_fail( subMenu != NULL ); + freeglut_return_if_fail( fgStructure.Menu ); + freeglut_return_if_fail( subMenu ); menuEntry = fghFindMenuEntry( fgStructure.Menu, item ); - freeglut_return_if_fail( menuEntry != NULL ); + freeglut_return_if_fail( menuEntry ); /* * We want it to become a sub menu entry, so: */ - if( menuEntry->Text != NULL ) + if( menuEntry->Text ) free( menuEntry->Text ); menuEntry->Text = strdup( label ); @@ -890,7 +889,7 @@ void FGAPIENTRY glutRemoveMenuItem( int item ) freeglut_assert_ready; freeglut_return_if_fail( fgStructure.Menu ); menuEntry = fghFindMenuEntry( fgStructure.Menu, item ); - freeglut_return_if_fail( menuEntry != NULL ); + freeglut_return_if_fail( menuEntry ); fgListRemove( &fgStructure.Menu->Entries, &menuEntry->Node ); free( menuEntry->Text ); free( menuEntry );