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:
893757e
)
(no commit message)
author
Ash Tyndall
<
[email protected]
>
Fri, 21 Oct 2011 06:29:01 +0000
(14:29 +0800)
committer
Ash Tyndall
<
[email protected]
>
Fri, 21 Oct 2011 06:29:01 +0000
(14:29 +0800)
helper.c
patch
|
blob
|
history
diff --git
a/helper.c
b/helper.c
index
0f711c2
..
79cc5d8
100644
(file)
--- a/
helper.c
+++ b/
helper.c
@@
-210,8
+210,11
@@
int makeSubmenuFromArray( const char *menuEntries[], unsigned int menuEntriesSiz
* Draw a floor by looping over the floorSize and squareSize variables
*/
void drawFloor() {
* Draw a floor by looping over the floorSize and squareSize variables
*/
void drawFloor() {
- getTexture(currentGroundTexture);
- glBindTexture(GL_TEXTURE_2D, currentGroundTexture);
+ if ( currentGroundTexture != 0 ) {
+ getTexture(currentGroundTexture);
+ glBindTexture(GL_TEXTURE_2D, currentGroundTexture);
+ }
+
glBegin(GL_QUADS);
for ( int x = -floorSize; x < floorSize; x++ ) {
for ( int z = -floorSize; z < floorSize; z++ ) {
glBegin(GL_QUADS);
for ( int x = -floorSize; x < floorSize; x++ ) {
for ( int z = -floorSize; z < floorSize; z++ ) {
@@
-231,7
+234,10
@@
void drawFloor() {
}
}
glEnd();
}
}
glEnd();
- glBindTexture(GL_TEXTURE_2D, 0);
+
+ if ( currentGroundTexture != 0 ) {
+ glBindTexture(GL_TEXTURE_2D, 0);
+ }
}
/**
}
/**
UCC
git Repository :: git.ucc.asn.au