Skip to content

Commit 8f824a5

Browse files
author
hikerstk
committed
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
1 parent 1c811e4 commit 8f824a5

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

src/modes/profile_world.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,6 @@ void ProfileWorld::setProfileModeLaps(int laps)
7979
m_num_laps = laps;
8080
} // setProfileModeLaps
8181

82-
//-----------------------------------------------------------------------------
83-
/** Activates Demo mode. In this mode all karts are controlled by an AI, but
84-
* at the end no stats are printed, and the game isn't exited.
85-
* \param laps The number of laps.
86-
*/
87-
void ProfileWorld::setProfileModeDemo(int laps)
88-
{
89-
m_profile_mode = PROFILE_DEMO;
90-
m_num_laps = laps;
91-
} // setProfileModeDemo
92-
9382
//-----------------------------------------------------------------------------
9483
/** Creates a kart, having a certain position, starting location, and local
9584
* and global player id (if applicable).
@@ -131,8 +120,7 @@ bool ProfileWorld::isRaceOver()
131120
if(m_profile_mode==PROFILE_TIME)
132121
return getTime()>m_time;
133122

134-
if(m_profile_mode == PROFILE_LAPS ||
135-
m_profile_mode == PROFILE_DEMO)
123+
if(m_profile_mode == PROFILE_LAPS )
136124
{
137125
// Now it must be laps based profiling:
138126
return race_manager->getFinishedKarts()==getNumKarts();
@@ -148,7 +136,6 @@ bool ProfileWorld::isRaceOver()
148136
void ProfileWorld::update(float dt)
149137
{
150138
StandardRace::update(dt);
151-
if(m_profile_mode==PROFILE_DEMO) return;
152139

153140
m_frame_count++;
154141
video::IVideoDriver *driver = irr_driver->getVideoDriver();
@@ -195,9 +182,6 @@ void ProfileWorld::enterRaceOverState()
195182
m_karts[i]->finishedRace(estimateFinishTimeForKart(m_karts[i]));
196183
}
197184

198-
// Do nothing more in demo mode - esp. don't abort ;)
199-
if(m_profile_mode == PROFILE_DEMO) return;
200-
201185
// Print framerate statistics
202186
float runtime = (irr_driver->getRealTime()-m_start_time)*0.001f;
203187
printf("Number of frames: %d time %f, Average FPS: %f\n",

src/modes/profile_world.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ class ProfileWorld : public StandardRace
3232
{
3333
private:
3434
/** Profiling modes. */
35-
enum ProfileType {PROFILE_NONE, PROFILE_TIME, PROFILE_LAPS,
36-
PROFILE_DEMO};
35+
enum ProfileType {PROFILE_NONE, PROFILE_TIME, PROFILE_LAPS};
3736

3837
/** If profiling is done, and if so, which mode. */
3938
static ProfileType m_profile_mode;
@@ -89,7 +88,6 @@ class ProfileWorld : public StandardRace
8988

9089
static void setProfileModeTime(float time);
9190
static void setProfileModeLaps(int laps);
92-
static void setProfileModeDemo(int laps);
9391
// ------------------------------------------------------------------------
9492
/** Returns true if profile mode was selected. */
9593
static bool isProfileMode() {return m_profile_mode!=PROFILE_NONE; }

0 commit comments

Comments
 (0)