*/
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_GL_SetSwapInterval(0);
glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
**** GAMELOOP ****
**************************/
+ std::cout << "Num threads: " << std::thread::hardware_concurrency() << std::endl;
gameRunning = true;
while(gameRunning){
mainLoop();
currentTime = millis();
deltaTime = currentTime - prevTime;
+
if(currentMenu)goto MENU;
/*
currentWorld->bgmPlay(prev);
ui::dialogBoxExists = false;
}
-
if(prevPrevTime + MSEC_PER_TICK <= currentTime){
logic();
prevPrevTime = currentTime;
}
for(unsigned int i=0;i<particles.size();i++){
- if(particles[i]->kill(deltaTime)){
+ if(particles[i]->kill(delta)){
delete particles[i];
particles.erase(particles.begin()+i);
}else if(particles[i]->canMove){
- particles[i]->loc.y += particles[i]->vely * deltaTime;
- particles[i]->loc.x += particles[i]->velx * deltaTime;
+ particles[i]->loc.y += particles[i]->vely * delta;
+ particles[i]->loc.x += particles[i]->velx * delta;
for(auto &b : build){
if(b->bsubtype==FOUNTAIN){