From: drumsetmonkey Date: Wed, 9 Mar 2016 02:14:47 +0000 (-0500) Subject: Fixed incorrect language percentages X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=98e08cb7c2ae6c61192bac73a1fc7254224452be;p=clyne%2Fgamedev.git Fixed incorrect language percentages --- 98e08cb7c2ae6c61192bac73a1fc7254224452be diff --cc .gitattributes index 0000000,0000000..b98fd9b new file mode 100644 --- /dev/null +++ b/.gitattributes @@@ -1,0 -1,0 +1,6 @@@ ++src/tinyxml2.cpp linguist-vendored ++src/threadpool.cpp linguist-vendored ++include/tinyxml2.h linguist-vendored ++include/threadpool.h linguist-vendored ++include/SDL2/* linguist-vendored ++include/freetype/* linguist-vendored diff --cc main.cpp index f0b49ad,1ff97ca..f9282c4 --- a/main.cpp +++ b/main.cpp @@@ -321,7 -323,6 +323,7 @@@ int main(int argc, char *argv[]) */ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetSwapInterval(0); ++ //SDL_GL_SetSwapInterval(0); glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@@ -408,7 -409,8 +410,10 @@@ **** GAMELOOP **** **************************/ + std::cout << "Num threads: " << std::thread::hardware_concurrency() << std::endl; ++ + //currentWorld->mob.back()->followee = player; + gameRunning = true; while(gameRunning){ mainLoop(); diff --cc src/world.cpp index b2e1cfb,0a84c20..5ce0b2d --- a/src/world.cpp +++ b/src/world.cpp @@@ -317,36 -308,34 +308,34 @@@ update( Player *p, unsigned int delta p->loc.y += p->vel.y * delta; p->loc.x +=(p->vel.x * p->speed) * delta; - /* - * Update coordinates of all entities except for structures. - */ - - for(auto &e : entity){ + // update entity coords + for ( auto &e : entity ) { e->loc.y += e->vel.y * delta; - if(e->type != STRUCTURET && e->canMove){ + // dont let structures move? + if ( e->type != STRUCTURET && e->canMove ) { e->loc.x += e->vel.x * delta; - if(e->vel.x < 0)e->left = true; - else if(e->vel.x > 0)e->left = false; + // update boolean directions + if ( e->vel.x < 0 ) + e->left = true; + else if ( e->vel.x > 0 ) + e->left = false; } } - + // iterate through particles + particles.erase( std::remove_if( particles.begin(), particles.end(), [&delta](Particles &part){return part.kill(delta);}), particles.end()); + for ( auto part = particles.begin(); part != particles.end(); part++ ) { + if ( (*part).canMove ) { + (*part).loc.y += (*part).vely * delta; + (*part).loc.x += (*part).velx * delta; + + for ( auto &b : build ) { + if ( b->bsubtype == FOUNTAIN ) { + if ( (*part).loc.x >= b->loc.x && (*part).loc.x <= b->loc.x + b->width ) { + if ( (*part).loc.y <= b->loc.y + b->height * .25) + particles.erase( part ); + - for(unsigned int i=0;ikill(delta)){ - delete particles[i]; - particles.erase(particles.begin()+i); - }else if(particles[i]->canMove){ - particles[i]->loc.y += particles[i]->vely * delta; - particles[i]->loc.x += particles[i]->velx * delta; - - for(auto &b : build){ - if(b->bsubtype==FOUNTAIN){ - if(particles[i]->loc.x >= b->loc.x && particles[i]->loc.x <= b->loc.x + b->width){ - if(particles[i]->loc.y <= b->loc.y + b->height * .25){ - delete particles[i]; - particles.erase(particles.begin()+i); - } } } } @@@ -1656,4 -1512,11 +1512,12 @@@ loadWorldFromXMLNoSave( std::string pat } return tmp; - } ++ + } + + Village::Village(const char *meme, World *w){ + name = meme; + start.x = w->getTheWidth() / 2.0f; + end.x = -start.x; + in = false; + }