An attempt to merge with hilnius' branch

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13390 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx
2013-07-30 21:39:27 +00:00
109 changed files with 4934 additions and 2827 deletions

View File

@@ -29,7 +29,6 @@
#include "input/wiimote_manager.hpp"
#include "modes/profile_world.hpp"
#include "modes/world.hpp"
#include "network/network_manager.hpp"
#include "race/race_manager.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/profiler.hpp"
@@ -94,21 +93,8 @@ float MainLoop::getLimitedDt()
*/
void MainLoop::updateRace(float dt)
{
// Server: Send the current position and previous controls to all clients
// Client: send current controls to server
// But don't do this if the race is in finish phase (otherwise
// messages can be mixed up in the race manager)
if(!World::getWorld()->isFinishPhase())
network_manager->sendUpdates();
if(ProfileWorld::isProfileMode()) dt=1.0f/60.0f;
// Again, only receive updates if the race isn't over - once the
// race results are displayed (i.e. game is in finish phase)
// messages must be handled by the normal update of the network
// manager
if(!World::getWorld()->isFinishPhase())
network_manager->receiveUpdates();
World::getWorld()->updateWorld(dt);
} // updateRace
@@ -127,13 +113,8 @@ void MainLoop::run()
m_prev_time = m_curr_time;
float dt = getLimitedDt();
network_manager->update(dt);
if (World::getWorld()) // race is active if world exists
{
// Busy wait if race_manager is active (i.e. creating of world is done)
// till all clients have reached this state.
if (network_manager->getState()==NetworkManager::NS_READY_SET_GO_BARRIER) continue;
updateRace(dt);
} // if race is active