From: Ash Tyndall Date: Sat, 8 Oct 2011 06:38:10 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=5bdb30f5054f2e6e4831b0fea17b50b56ce7bb10;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index ed4575e..f4467cc 100644 --- a/scene.c +++ b/scene.c @@ -247,10 +247,7 @@ void processLightEvents(int id) { } int makeSubmenuFromArray( const char *menuEntries[], void *callback ) { - for ( int i = 0; i < 54; i++ ) { - printf("%s\n", menuEntries[i]); - } - /* int menuEntriesSize = sizeof(menuEntries) / sizeof(menuEntries[0]); + int menuEntriesSize = 54;//sizeof(menuEntries) / sizeof(menuEntries[0]); int menuNumber = menuEntriesSize / 10 + 1; int submenuObjects[menuNumber-1]; @@ -269,14 +266,13 @@ int makeSubmenuFromArray( const char *menuEntries[], void *callback ) { int startNum = i*11 - (i-1); int endNum = startNum + 9; if ( i == menuNumber - 1 ) { // We're on the last one - endNum = startNum + 3; + endNum = startNum + (menuEntriesSize - startNum); } sprintf(name, "%d-%d", startNum, endNum); glutAddSubMenu( name, submenuObjects[i] ); } - return mainMenu;*/ - return 1; + return mainMenu; } void makeMenu() {