aboutsummaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-12 20:01:45 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-12 20:01:45 -0400
commitd6412a6210d4fa25f8c97a98132d27db66ca4514 (patch)
tree610582245c9ed1608b06e42712f787f655636d9f /src/World.cpp
parentce7a96683ee94f8764e7811a5d6167b248accb7c (diff)
uh
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 8f9308e..790a8e0 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -52,13 +52,14 @@ static float drawOffsetX=0,
drawOffsetY=0;
void World::draw(void){
unsigned int i;
- float x,y;
+ float x,y,hline=HLINE;
static World *root,*cur;
root=cur=this;
LOOP:
if(cur->behind){
drawOffsetX+=(cur->getWidth()-cur->behind->getWidth())/2;
drawOffsetY+=.3;
+ hline/=2;
cur=cur->behind;
goto LOOP;
//behind->draw();
@@ -66,18 +67,18 @@ LOOP:
LOOP2:
glBegin(GL_QUADS);
for(i=0;i<cur->lineCount-10;i++){
- x=(HLINE*i)-1+drawOffsetX;
+ x=(hline*i)-1+drawOffsetX;
y=cur->line[i].start+drawOffsetY;
glColor3ub(0,200,0);
glVertex2f(x ,y);
- glVertex2f(x+HLINE,y);
- y-=HLINE*2;
- glVertex2f(x+HLINE,y);
+ glVertex2f(x+hline,y);
+ y-=hline*2;
+ glVertex2f(x+hline,y);
glVertex2f(x ,y);
glColor3ub(150,100,50);
glVertex2f(x ,y);
- glVertex2f(x+HLINE,y);
- glVertex2f(x+HLINE,-1);
+ glVertex2f(x+hline,y);
+ glVertex2f(x+hline,-1);
glVertex2f(x ,-1);
}
glEnd();
@@ -85,6 +86,7 @@ LOOP2:
cur=cur->infront;
drawOffsetX-=(cur->getWidth()-cur->behind->getWidth())/2;
drawOffsetY-=.3;
+ hline*=2;
goto LOOP2;
}else{
drawOffsetX=drawOffsetY=0;