Removed unnecessary settings of a demo mode in ProfileWorld.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11218 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
fb249f43bf
commit
4aecbb7ec3
@ -78,17 +78,6 @@ void ProfileWorld::setProfileModeLaps(int laps)
|
||||
m_num_laps = laps;
|
||||
} // setProfileModeLaps
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Activates Demo mode. In this mode all karts are controlled by an AI, but
|
||||
* at the end no stats are printed, and the game isn't exited.
|
||||
* \param laps The number of laps.
|
||||
*/
|
||||
void ProfileWorld::setProfileModeDemo(int laps)
|
||||
{
|
||||
m_profile_mode = PROFILE_DEMO;
|
||||
m_num_laps = laps;
|
||||
} // setProfileModeDemo
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Creates a kart, having a certain position, starting location, and local
|
||||
* and global player id (if applicable).
|
||||
@ -132,8 +121,7 @@ bool ProfileWorld::isRaceOver()
|
||||
if(m_profile_mode==PROFILE_TIME)
|
||||
return getTime()>m_time;
|
||||
|
||||
if(m_profile_mode == PROFILE_LAPS ||
|
||||
m_profile_mode == PROFILE_DEMO)
|
||||
if(m_profile_mode == PROFILE_LAPS )
|
||||
{
|
||||
// Now it must be laps based profiling:
|
||||
return race_manager->getFinishedKarts()==getNumKarts();
|
||||
@ -149,7 +137,6 @@ bool ProfileWorld::isRaceOver()
|
||||
void ProfileWorld::update(float dt)
|
||||
{
|
||||
StandardRace::update(dt);
|
||||
if(m_profile_mode==PROFILE_DEMO) return;
|
||||
|
||||
m_frame_count++;
|
||||
video::IVideoDriver *driver = irr_driver->getVideoDriver();
|
||||
@ -196,9 +183,6 @@ void ProfileWorld::enterRaceOverState()
|
||||
m_karts[i]->finishedRace(estimateFinishTimeForKart(m_karts[i]));
|
||||
}
|
||||
|
||||
// Do nothing more in demo mode - esp. don't abort ;)
|
||||
if(m_profile_mode == PROFILE_DEMO) return;
|
||||
|
||||
// Print framerate statistics
|
||||
float runtime = (irr_driver->getRealTime()-m_start_time)*0.001f;
|
||||
printf("Number of frames: %d time %f, Average FPS: %f\n",
|
||||
|
@ -31,8 +31,7 @@ class ProfileWorld : public StandardRace
|
||||
{
|
||||
private:
|
||||
/** Profiling modes. */
|
||||
enum ProfileType {PROFILE_NONE, PROFILE_TIME, PROFILE_LAPS,
|
||||
PROFILE_DEMO};
|
||||
enum ProfileType {PROFILE_NONE, PROFILE_TIME, PROFILE_LAPS};
|
||||
|
||||
/** If profiling is done, and if so, which mode. */
|
||||
static ProfileType m_profile_mode;
|
||||
@ -88,7 +87,6 @@ public:
|
||||
|
||||
static void setProfileModeTime(float time);
|
||||
static void setProfileModeLaps(int laps);
|
||||
static void setProfileModeDemo(int laps);
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns true if profile mode was selected. */
|
||||
static bool isProfileMode() {return m_profile_mode!=PROFILE_NONE; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user