X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_menu.c;h=87e476ff20610d90f318fc45836d6b69b128476b;hb=4ccf632b1b12b8147cede1c7b94b71633204cc80;hp=d7ee2acbe663e7e1e93584e70d6e9ebae0505cbc;hpb=9786fb052e94dc0a4c0a40aaa3133d35a5d7061f;p=freeglut diff --git a/src/freeglut_menu.c b/src/freeglut_menu.c index d7ee2ac..87e476f 100644 --- a/src/freeglut_menu.c +++ b/src/freeglut_menu.c @@ -62,7 +62,7 @@ static SFG_MenuEntry *fghFindMenuEntry( SFG_Menu* menu, int index ) SFG_MenuEntry *entry; int i = 1; - for( entry = menu->Entries.First; entry; entry = entry->Node.Next) + for( entry = (SFG_MenuEntry *)menu->Entries.First; entry; entry = (SFG_MenuEntry *)entry->Node.Next) { if (i == index) break; @@ -83,8 +83,8 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu ) /* * First of all check any of the active sub menus... */ - for( menuEntry = menu->Entries.First; menuEntry; - menuEntry = menuEntry->Node.Next ) + for( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next ) { /* * Is that an active sub menu by any case? @@ -117,8 +117,8 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu ) /* * Mark all menu entries inactive... */ - for( menuEntry = menu->Entries.First; menuEntry; - menuEntry = menuEntry->Node.Next ) + for( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next ) { menuEntry->IsActive = FALSE; } @@ -255,8 +255,8 @@ static void fghDisplayMenuBox( SFG_Menu* menu ) /* * Check if any of the submenus is currently active... */ - for( menuEntry = menu->Entries.First; menuEntry; - menuEntry = menuEntry->Node.Next ) + for( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next ) { /* * Has the menu been marked as active, maybe? @@ -288,8 +288,8 @@ static void fghDisplayMenuBox( SFG_Menu* menu ) */ glColor4f( 1, 1, 1, 1 ); - for( menuEntry = menu->Entries.First, i=0; menuEntry; - menuEntry = menuEntry->Node.Next, ++i ) + for( menuEntry = (SFG_MenuEntry *)menu->Entries.First, i=0; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next, ++i ) { /* * Move the raster into position... @@ -334,8 +334,8 @@ static void fghDisplayMenuBox( SFG_Menu* menu ) /* * Now we are ready to check if any of our children needs to be redrawn: */ - for( menuEntry = menu->Entries.First; menuEntry; - menuEntry = menuEntry->Node.Next ) + for( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next ) { /* * Is that an active sub menu by any case? @@ -361,7 +361,7 @@ static void fghSetSubmenuParentWindow ( SFG_Window *window, SFG_Menu *menu ) menu->ParentWindow = window ; - for ( menuEntry = menu->Entries.First; menuEntry; menuEntry = menuEntry->Node.Next ) + for ( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next ) { if ( menuEntry->SubMenu != NULL ) fghSetSubmenuParentWindow ( window, menuEntry->SubMenu ) ; @@ -514,7 +514,7 @@ void fgExecuteMenuCallback( SFG_Menu* menu ) /* * First of all check any of the active sub menus... */ - for( menuEntry = menu->Entries.First; menuEntry; menuEntry = menuEntry->Node.Next) + for( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next) { /* * Is this menu entry active? @@ -584,8 +584,8 @@ void fgDeactivateMenu( SFG_Window *window ) /* * Hide all submenu windows, and the root menu's window. */ - for ( menuEntry = menu->Entries.First; menuEntry; - menuEntry = menuEntry->Node.Next ) + for ( menuEntry = (SFG_MenuEntry *)menu->Entries.First; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next ) { /* * Is that an active submenu by any case? @@ -594,7 +594,7 @@ void fgDeactivateMenu( SFG_Window *window ) fgDeactivateSubMenu ( menuEntry ) ; } - fgStructure.Window = current_window ; + fgSetWindow ( current_window ) ; } /* @@ -619,8 +619,8 @@ void fgDeactivateSubMenu( SFG_MenuEntry *menuEntry ) /* * Hide all submenu windows, and the root menu's window. */ - for ( subMenuIter = menuEntry->SubMenu->Entries.First; subMenuIter; - subMenuIter = subMenuIter->Node.Next ) + for ( subMenuIter = (SFG_MenuEntry *)menuEntry->SubMenu->Entries.First; subMenuIter; + subMenuIter = (SFG_MenuEntry *)subMenuIter->Node.Next ) { /* * Is that an active submenu by any case? @@ -629,7 +629,7 @@ void fgDeactivateSubMenu( SFG_MenuEntry *menuEntry ) fgDeactivateSubMenu ( subMenuIter ) ; } - fgStructure.Window = current_window ; + fgSetWindow ( current_window ) ; } /* @@ -648,8 +648,8 @@ void fghCalculateMenuBoxSize( void ) /* * The menu's box size depends on the menu entries: */ - for( menuEntry = fgStructure.Menu->Entries.First; menuEntry; - menuEntry = menuEntry->Node.Next) + for( menuEntry = (SFG_MenuEntry *)fgStructure.Menu->Entries.First; menuEntry; + menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next) { /* * Update the menu entry's width value @@ -752,7 +752,7 @@ void FGAPIENTRY glutSetMenu( int menuID ) */ void FGAPIENTRY glutAddMenuEntry( const char* label, int value ) { - SFG_MenuEntry* menuEntry = calloc( sizeof(SFG_MenuEntry), 1 ); + SFG_MenuEntry* menuEntry = (SFG_MenuEntry *)calloc( sizeof(SFG_MenuEntry), 1 ); /* * Make sure there is a current menu set @@ -781,7 +781,7 @@ void FGAPIENTRY glutAddMenuEntry( const char* label, int value ) */ void FGAPIENTRY glutAddSubMenu( const char* label, int subMenuID ) { - SFG_MenuEntry* menuEntry = calloc( sizeof(SFG_MenuEntry), 1 ); + SFG_MenuEntry* menuEntry = (SFG_MenuEntry *)calloc( sizeof(SFG_MenuEntry), 1 ); SFG_Menu* subMenu = fgMenuByID( subMenuID ); /*