Fixed profile mode.

This commit is contained in:
hiker 2018-08-01 08:46:52 +10:00
parent 2bb52df3c8
commit 8ea8562ee6
2 changed files with 6 additions and 2 deletions

View File

@ -26,6 +26,7 @@
#include "karts/abstract_kart.hpp"
#include "karts/controller/spare_tire_ai.hpp"
#include "modes/easter_egg_hunt.hpp"
#include "modes/profile_world.hpp"
#include "network/network_config.hpp"
#include "network/race_event_manager.hpp"
#include "physics/triangle_mesh.hpp"
@ -312,7 +313,8 @@ Item* ItemManager::placeItem(ItemState::ItemType type, const Vec3& xyz,
// Make sure this subroutine is not used otherwise (since networking
// needs to be aware of items added to the track, so this would need
// to be added).
assert(World::getWorld()->getPhase() == WorldStatus::SETUP_PHASE);
assert(World::getWorld()->getPhase() == WorldStatus::SETUP_PHASE ||
ProfileWorld::isProfileMode() );
ItemState::ItemType mesh_type = type;
Item* item = new Item(type, xyz, normal, m_item_mesh[mesh_type],

View File

@ -124,7 +124,9 @@ float MainLoop::getLimitedDt()
// with clients (server time is supposed to be behind client time).
// So we play it safe by adding a loop to make sure at least 1ms
// (minimum time that can be handled by the integer timer) delay here.
while (dt <= 0)
// Only exception is profile mode (typically running without graphics),
// which we want to run as fast as possible.
while (dt <= 0 && !ProfileWorld::isProfileMode())
{
StkTime::sleep(1);
m_curr_time = device->getTimer()->getRealTime();