Removed unnecessary demo mode in ProfileWorld (r11218 on trunk).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/0.7.3@11219 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2012-05-09 23:20:45 +00:00
parent 1c811e4bde
commit 22fa069cd5
2 changed files with 2 additions and 20 deletions

View File

@@ -79,17 +79,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).
@@ -131,8 +120,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();
@@ -148,7 +136,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();
@@ -195,9 +182,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",

View File

@@ -32,8 +32,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;
@@ -89,7 +88,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; }