diff options
-rw-r--r-- | .gitattributes | 6 | ||||
-rw-r--r-- | main.cpp | 4 | ||||
-rw-r--r-- | src/world.cpp | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b98fd9b --- /dev/null +++ b/.gitattributes @@ -0,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 @@ -323,6 +323,7 @@ int main(int argc, char *argv[]){ */ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + //SDL_GL_SetSwapInterval(0); glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@ -409,6 +410,8 @@ int main(int argc, char *argv[]){ **** GAMELOOP **** **************************/ + std::cout << "Num threads: " << std::thread::hardware_concurrency() << std::endl; + //currentWorld->mob.back()->followee = player; gameRunning = true; @@ -466,6 +469,7 @@ void mainLoop(void){ currentTime = millis(); deltaTime = currentTime - prevTime; + if(currentMenu)goto MENU; /* diff --git a/src/world.cpp b/src/world.cpp index 0a84c20..5ce0b2d 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -323,7 +323,6 @@ update( Player *p, unsigned int delta ) 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++ ) { @@ -336,6 +335,7 @@ update( Player *p, unsigned int delta ) 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 ); + } } } @@ -1512,6 +1512,7 @@ loadWorldFromXMLNoSave( std::string path ) { } return tmp; + } Village::Village(const char *meme, World *w){ |