diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-11-13 08:49:37 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-11-13 08:49:37 -0500 |
commit | 5b41789c0e129c1e276917ef91ed53a1559cf31b (patch) | |
tree | db16627d239cda95cdbf9e3a597113bc996805d5 /src/world.cpp | |
parent | 180733d411b0844e878574e4c9f9b34690510367 (diff) | |
parent | a32339dc700759ab44a360953c9c24d009b11ecc (diff) |
major font fixes
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/world.cpp b/src/world.cpp index 9d41623..7b1580a 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -286,7 +286,9 @@ LOOP2: /* * Draw the layer up until the grass portion, which is done later. */ - + /* + * TODO: CLYNE CHANGE THE NAME OF THIS + */ bool hey=false; glBegin(GL_QUADS); for(i=is;i<ie-GEN_INC;i++){ @@ -372,6 +374,13 @@ LOOP2: m->draw(); m->loc.y-=(yoff-DRAW_Y_OFFSET); } + for(auto &o : current->object){ + if(o->alive){ + o->loc.y+=(yoff-DRAW_Y_OFFSET); + o->draw(); + o->loc.y-=(yoff-DRAW_Y_OFFSET); + } + } /* * If we're drawing the closest/last world, handle and draw the player. @@ -549,6 +558,18 @@ void World::addStructure(_TYPE t,float x,float y,World *outside,World *inside){ entity.push_back(build.back()); } +/*template<class T> +void World::getEntityLocation(std::vector<T*>&vecBuf, unsigned int n){ + T bufVar = vecBuf.at(n); + unsigned int i = 0; + for(auto &e : entity){ + if(entity.at(i) == bufVar){ + entity.erase(entity.begin()+i); + } + i++; + } +}*/ + void World::addMob(int t,float x,float y){ mob.push_back(new Mob(t)); mob.back()->spawn(x,y); @@ -563,6 +584,17 @@ void World::addNPC(float x,float y){ entity.push_back(npc.back()); } +void World::addObject(int i, float x, float y){ + object.push_back(new Object(i)); + object.back()->spawn(x,y); + + entity.push_back(object.back()); +} + +/*void World::removeObject(Object i){ + object.delete(i); +}*/ + /* * The rest of these functions are explained well enough in world.h ;) */ |