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:
9288707
)
(no commit message)
author
Ash Tyndall
<
[email protected]
>
Tue, 18 Oct 2011 11:41:45 +0000
(19:41 +0800)
committer
Ash Tyndall
<
[email protected]
>
Tue, 18 Oct 2011 11:41:45 +0000
(19:41 +0800)
scene.c
patch
|
blob
|
history
diff --git
a/scene.c
b/scene.c
index
cc96c00
..
caa7f19
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-602,13
+602,16
@@
void drawSquare(int recurseLevel, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2
printf("Recurse level %d\n", recurseLevel);
\r
\r
if ( drawFloorRecurse != recurseLevel ) {
\r
printf("Recurse level %d\n", recurseLevel);
\r
\r
if ( drawFloorRecurse != recurseLevel ) {
\r
- GLfloat xm = (x2 - x1) / 2.0;
\r
- if ( x1 > x2 ) {
\r
- xm = (x1 - x2) / 2.0;
\r
- }
\r
-
\r
- drawSquare(recurseLevel + 1, x1, y1, xm, y2);
\r
- drawSquare(recurseLevel + 1, xm, y1, x2, y2);
\r
+ GLfloat xm = (x1 + x2) / 2.0;
\r
+ GLfloat ym = (y1 + y2) / 2.0;
\r
+ int rnew = recurseLevel + 1;
\r
+
\r
+ // Split into four sub-quads
\r
+ drawSquare(rnew, x1, y1, xm, ym);
\r
+ drawSquare(rnew, x1, ym, xm, y2);
\r
+ drawSquare(rnew, xm, ym, x2, y2);
\r
+ drawSquare(rnew, xm, y1, x2, ym);
\r
+
\r
} else {
\r
printf("Drawing (%f, %f) -> (%f, %f)\n", x1, y2, x2, y2);
\r
glBegin(GL_QUADS);
\r
} else {
\r
printf("Drawing (%f, %f) -> (%f, %f)\n", x1, y2, x2, y2);
\r
glBegin(GL_QUADS);
\r
UCC
git Repository :: git.ucc.asn.au