X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=e956c929545d01e6fb39f25a5dcdcd39f65a0505;hb=94db297fdff85690c300d58752c4d508d737dc29;hp=accd01fa3feb82bf763802ddc14bd75a6c56df19;hpb=dc6faf12f8c9b93ef7d5c67a99cb12e2aac93533;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index accd01f..e956c92 100644 --- a/scene.c +++ b/scene.c @@ -274,7 +274,8 @@ void makeMenu() { for( int i = 0; i < menuNumber; i++ ) { addObjectSubmenu[i] = glutCreateMenu(processObjectEvents); - for ( int j = i; j < (i+9); j++ ) { + int startNum = i*11 - (i-1); + for ( int j = startNum - 1; j < (startNum+9); j++ ) { if ( !objectMenuEntries[j] ) break; // Detect if we've reached the end of the array glutAddMenuEntry( objectMenuEntries[j], j ); }