git.ucc.asn.au
/
atyndall
/
cits2231.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09058e2
)
(no commit message)
author
Ash Tyndall
<
[email protected]
>
Sat, 8 Oct 2011 05:44:22 +0000
(13:44 +0800)
committer
Ash Tyndall
<
[email protected]
>
Sat, 8 Oct 2011 05:44:22 +0000
(13:44 +0800)
scene.c
patch
|
blob
|
history
diff --git
a/scene.c
b/scene.c
index
8fddc81
..
2733cf8
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-269,10
+269,13
@@
void makeMenu() {
\r
// Construct add object submenus
\r
int addObjectSubmenu[6];
\r
\r
// Construct add object submenus
\r
int addObjectSubmenu[6];
\r
+ int objectMenuEntriesSize = sizeof(objectMenuEntries) / sizeof(objectMenuEntries[0]);
\r
+ int menuNumber = objectMenuEntriesSize / 10 + 1;
\r
\r
\r
- for( int i = 0; i <
6
; i++ ) {
\r
+ for( int i = 0; i <
menuNumber
; i++ ) {
\r
addObjectSubmenu[i] = glutCreateMenu(processObjectEvents);
\r
for ( int j = i; j < (i+9); j++ ) {
\r
addObjectSubmenu[i] = glutCreateMenu(processObjectEvents);
\r
for ( int j = i; j < (i+9); j++ ) {
\r
+ if ( !objectMenuEntries[j] ) break; // Detect if we've reached the end of the array
\r
glutAddMenuEntry( objectMenuEntries[j], j );
\r
}
\r
}
\r
glutAddMenuEntry( objectMenuEntries[j], j );
\r
}
\r
}
\r
UCC
git Repository :: git.ucc.asn.au