diff --git a/client/client_application.cpp b/client/client_application.cpp index f2dcd8a..70957fe 100644 --- a/client/client_application.cpp +++ b/client/client_application.cpp @@ -137,11 +137,17 @@ void ClientApplication::Proc() { realTime = Clock::now(); //simulate game time - while (simTime < realTime) { - //call each user defined function - activeScene->RunFrame(); - //~60 FPS - simTime += std::chrono::duration(16); + if (simTime < realTime) { + while (simTime < realTime) { + //call each user defined function + activeScene->RunFrame(); + //~60 FPS + simTime += std::chrono::duration(16); + } + } + else { + //give the machine a break + SDL_Delay(10); } //draw the game to the screen diff --git a/server/server_logic.cpp b/server/server_logic.cpp index d4d96fa..802c8c9 100644 --- a/server/server_logic.cpp +++ b/server/server_logic.cpp @@ -187,7 +187,7 @@ void ServerApplication::Proc() { std::cerr << "Client dropped: " << disconnected << std::endl; } - //give the computer a break + //give the machine a break SDL_Delay(10); } delete reinterpret_cast(packetBuffer);