From 7fbac4fc005baed6bc94d342cf7df2c8ad7a359a Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 30 Sep 2015 15:40:48 -0400 Subject: fixed structure drawing --- src/entities.cpp | 5 +++-- src/main.cpp | 11 ++++++----- src/ui.cpp | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/entities.cpp b/src/entities.cpp index b40ddd4..85505ce 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -19,13 +19,14 @@ void Entity::spawn(float x, float y){ //spawns the entity you pass to it based o } void Entity::draw(void){ //draws the entities - if(type==NPCT) + if(type==NPCT){ if(gender == MALE) glColor3ub(0,0,100); else if(gender == FEMALE) glColor3ub(255,105,180); - else if(type==STRUCTURET) + }else if(type==STRUCTURET){ glColor3ub(100,0,100); + } glRectf(loc.x,loc.y,loc.x+width,loc.y+height); } diff --git a/src/main.cpp b/src/main.cpp index 8b919a2..ea19668 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,7 @@ Player *player; std::vectorentity; std::vectornpc; -std::vectorbuild; +std::vectorbuild; int mx, my; FILE* names; @@ -32,6 +32,7 @@ void logic(); void render(); int entityInteractTest(NPC *speaker){ + ui::dialogBox("Here, have a quest!"); player->qh.assign("Test"); return 1; } @@ -111,12 +112,12 @@ int main(int argc, char *argv[]){ // Make structures entity.push_back(new Entity()); - build.push_back(Structures()); - entity[0]=&build[0]; + build.push_back(new Structures()); + entity[0]=build[0]; static unsigned int i; - build[0].spawn(STRUCTURET,0,10); - build[0].inside=iw; + build[0]->spawn(STRUCTURET,0,10); + build[0]->inside=iw; for(i=0;iinWorld=test; } diff --git a/src/ui.cpp b/src/ui.cpp index ec78507..c14b4ff 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -117,6 +117,7 @@ namespace ui { free(buf); } void dialogBox(const char *text){ + //while(dialogBoxExists); dialogBoxExists=true; dialogBoxText=text; } -- cgit v1.2.3