]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Stuff
authordrumsetmonkey <abelleisle@roadrunner.com>
Mon, 29 Feb 2016 21:04:38 +0000 (16:04 -0500)
committerdrumsetmonkey <abelleisle@roadrunner.com>
Mon, 29 Feb 2016 21:04:38 +0000 (16:04 -0500)
main.cpp
src/world.cpp

index 0adb0d56bd5f97c28de6e047f5420ffe09bace36..f0b49adf7ee68f0d6801e670e7a3bfb4db12b09c 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -321,6 +321,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);
        
@@ -407,6 +408,7 @@ int main(/*int argc, char *argv[]*/){
        ****     GAMELOOP      ****
        **************************/
        
+       std::cout << "Num threads: " << std::thread::hardware_concurrency() << std::endl;
        gameRunning = true;
        while(gameRunning){
                mainLoop();
@@ -462,6 +464,7 @@ void mainLoop(void){
        currentTime = millis();
        deltaTime       = currentTime - prevTime;
 
+
        if(currentMenu)goto MENU;
 
        /*
@@ -475,7 +478,6 @@ void mainLoop(void){
                currentWorld->bgmPlay(prev);
                ui::dialogBoxExists = false;
        }
-       
        if(prevPrevTime + MSEC_PER_TICK <= currentTime){
                logic();
                prevPrevTime = currentTime;
index 971325ce75203504b369b03d36a9c1b2a1eba62c..b2e1cfb77a22e63e178653e766229b4e8fdc560c 100644 (file)
@@ -333,12 +333,12 @@ void World::update(Player *p,unsigned int delta){
        }
 
        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){