aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-30 15:40:48 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-30 15:40:48 -0400
commit7fbac4fc005baed6bc94d342cf7df2c8ad7a359a (patch)
tree73ade25a5e339ba82f6c2011e74af501b192bf04 /src
parentc669b83b4f273df6f6ed824b997a77267fd0186f (diff)
fixed structure drawing
Diffstat (limited to 'src')
-rw-r--r--src/entities.cpp5
-rw-r--r--src/main.cpp11
-rw-r--r--src/ui.cpp1
3 files changed, 10 insertions, 7 deletions
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::vector<Entity*>entity;
std::vector<NPC>npc;
-std::vector<Structures>build;
+std::vector<Structures *>build;
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;i<entity.size()+1;i++){
entity[i]->inWorld=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;
}