Simplified vo_ngan_90's patch.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9752 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
4606f1b192
commit
c7c9f8150a
@ -241,8 +241,6 @@ supertuxkart_SOURCES = \
|
|||||||
modes/world.hpp \
|
modes/world.hpp \
|
||||||
modes/world_status.cpp \
|
modes/world_status.cpp \
|
||||||
modes/world_status.hpp \
|
modes/world_status.hpp \
|
||||||
modes/world_timer.cpp \
|
|
||||||
modes/world_timer.hpp \
|
|
||||||
modes/world_with_rank.cpp \
|
modes/world_with_rank.cpp \
|
||||||
modes/world_with_rank.hpp \
|
modes/world_with_rank.hpp \
|
||||||
network/character_confirm_message.hpp \
|
network/character_confirm_message.hpp \
|
||||||
|
@ -340,7 +340,6 @@
|
|||||||
95AAD98012BAD36300B7B8A3 /* tutorial_screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AAD97E12BAD36300B7B8A3 /* tutorial_screen.cpp */; };
|
95AAD98012BAD36300B7B8A3 /* tutorial_screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AAD97E12BAD36300B7B8A3 /* tutorial_screen.cpp */; };
|
||||||
95B5CD14102DE08F00EF2001 /* device_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95B5CD13102DE08F00EF2001 /* device_config.cpp */; };
|
95B5CD14102DE08F00EF2001 /* device_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95B5CD13102DE08F00EF2001 /* device_config.cpp */; };
|
||||||
95BF1E68127513A100F78AE7 /* max_speed.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95BF1E66127513A100F78AE7 /* max_speed.cpp */; };
|
95BF1E68127513A100F78AE7 /* max_speed.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95BF1E66127513A100F78AE7 /* max_speed.cpp */; };
|
||||||
95C6BB931414413B00990FF9 /* world_timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C6BB911414413B00990FF9 /* world_timer.cpp */; };
|
|
||||||
95C77D631069589B0080838E /* ambient_light_sphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C77D621069589B0080838E /* ambient_light_sphere.cpp */; };
|
95C77D631069589B0080838E /* ambient_light_sphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C77D621069589B0080838E /* ambient_light_sphere.cpp */; };
|
||||||
95C77D66106958A50080838E /* check_line.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C77D65106958A50080838E /* check_line.cpp */; };
|
95C77D66106958A50080838E /* check_line.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C77D65106958A50080838E /* check_line.cpp */; };
|
||||||
95C77D6F106958E10080838E /* check_sphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C77D6D106958E10080838E /* check_sphere.cpp */; };
|
95C77D6F106958E10080838E /* check_sphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C77D6D106958E10080838E /* check_sphere.cpp */; };
|
||||||
@ -1278,8 +1277,6 @@
|
|||||||
95C2B1E90F296546000D3E5D /* vec3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = vec3.hpp; path = ../../utils/vec3.hpp; sourceTree = SOURCE_ROOT; };
|
95C2B1E90F296546000D3E5D /* vec3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = vec3.hpp; path = ../../utils/vec3.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
95C65D760F532F7D00BE7BA7 /* xml_node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xml_node.cpp; path = ../../io/xml_node.cpp; sourceTree = SOURCE_ROOT; };
|
95C65D760F532F7D00BE7BA7 /* xml_node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xml_node.cpp; path = ../../io/xml_node.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
95C65D770F532F7D00BE7BA7 /* xml_node.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = xml_node.hpp; path = ../../io/xml_node.hpp; sourceTree = SOURCE_ROOT; };
|
95C65D770F532F7D00BE7BA7 /* xml_node.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = xml_node.hpp; path = ../../io/xml_node.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
95C6BB911414413B00990FF9 /* world_timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = world_timer.cpp; path = ../../modes/world_timer.cpp; sourceTree = SOURCE_ROOT; };
|
|
||||||
95C6BB921414413B00990FF9 /* world_timer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = world_timer.hpp; path = ../../modes/world_timer.hpp; sourceTree = SOURCE_ROOT; };
|
|
||||||
95C77D611069589B0080838E /* ambient_light_sphere.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ambient_light_sphere.hpp; path = ../../tracks/ambient_light_sphere.hpp; sourceTree = SOURCE_ROOT; };
|
95C77D611069589B0080838E /* ambient_light_sphere.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ambient_light_sphere.hpp; path = ../../tracks/ambient_light_sphere.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
95C77D621069589B0080838E /* ambient_light_sphere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ambient_light_sphere.cpp; path = ../../tracks/ambient_light_sphere.cpp; sourceTree = SOURCE_ROOT; };
|
95C77D621069589B0080838E /* ambient_light_sphere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ambient_light_sphere.cpp; path = ../../tracks/ambient_light_sphere.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
95C77D64106958A50080838E /* check_line.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = check_line.hpp; path = ../../tracks/check_line.hpp; sourceTree = SOURCE_ROOT; };
|
95C77D64106958A50080838E /* check_line.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = check_line.hpp; path = ../../tracks/check_line.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
@ -2514,8 +2511,6 @@
|
|||||||
95C2B1510F296545000D3E5D /* three_strikes_battle.hpp */,
|
95C2B1510F296545000D3E5D /* three_strikes_battle.hpp */,
|
||||||
9574F17A11206881008D202E /* world_status.cpp */,
|
9574F17A11206881008D202E /* world_status.cpp */,
|
||||||
9574F17B11206881008D202E /* world_status.hpp */,
|
9574F17B11206881008D202E /* world_status.hpp */,
|
||||||
95C6BB911414413B00990FF9 /* world_timer.cpp */,
|
|
||||||
95C6BB921414413B00990FF9 /* world_timer.hpp */,
|
|
||||||
9552C1F91231249000347B6C /* world_with_rank.cpp */,
|
9552C1F91231249000347B6C /* world_with_rank.cpp */,
|
||||||
9552C1FA1231249000347B6C /* world_with_rank.hpp */,
|
9552C1FA1231249000347B6C /* world_with_rank.hpp */,
|
||||||
95C2B1520F296545000D3E5D /* world.cpp */,
|
95C2B1520F296545000D3E5D /* world.cpp */,
|
||||||
@ -3159,7 +3154,6 @@
|
|||||||
95A0BA2413E63F6700620EA6 /* kart_with_stats.cpp in Sources */,
|
95A0BA2413E63F6700620EA6 /* kart_with_stats.cpp in Sources */,
|
||||||
958806E913EB675F005F90FE /* track_sector.cpp in Sources */,
|
958806E913EB675F005F90FE /* track_sector.cpp in Sources */,
|
||||||
957A2D291405E21D00F45B22 /* hit_sfx.cpp in Sources */,
|
957A2D291405E21D00F45B22 /* hit_sfx.cpp in Sources */,
|
||||||
95C6BB931414413B00990FF9 /* world_timer.cpp in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
#include "network/network_manager.hpp"
|
#include "network/network_manager.hpp"
|
||||||
#include "states_screens/dialogs/race_over_dialog.hpp"
|
#include "states_screens/dialogs/race_over_dialog.hpp"
|
||||||
#include "world_timer.hpp"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
WorldStatus::WorldStatus()
|
WorldStatus::WorldStatus()
|
||||||
@ -41,8 +40,6 @@ WorldStatus::WorldStatus()
|
|||||||
m_start_sound = sfx_manager->createSoundSource("start_race");
|
m_start_sound = sfx_manager->createSoundSource("start_race");
|
||||||
m_track_intro_sound = sfx_manager->createSoundSource("track_intro");
|
m_track_intro_sound = sfx_manager->createSoundSource("track_intro");
|
||||||
|
|
||||||
m_world_timer = new WorldTimer();
|
|
||||||
|
|
||||||
music_manager->stopMusic();
|
music_manager->stopMusic();
|
||||||
} // WorldStatus
|
} // WorldStatus
|
||||||
|
|
||||||
@ -69,8 +66,6 @@ WorldStatus::~WorldStatus()
|
|||||||
sfx_manager->deleteSFX(m_prestart_sound);
|
sfx_manager->deleteSFX(m_prestart_sound);
|
||||||
sfx_manager->deleteSFX(m_start_sound);
|
sfx_manager->deleteSFX(m_start_sound);
|
||||||
sfx_manager->deleteSFX(m_track_intro_sound);
|
sfx_manager->deleteSFX(m_track_intro_sound);
|
||||||
|
|
||||||
delete m_world_timer;
|
|
||||||
} // ~WorldStatus
|
} // ~WorldStatus
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -278,7 +273,8 @@ void WorldStatus::pause(Phase phase)
|
|||||||
m_previous_phase = m_phase;
|
m_previous_phase = m_phase;
|
||||||
m_phase = phase;
|
m_phase = phase;
|
||||||
|
|
||||||
m_world_timer->freezeTimer();
|
IrrlichtDevice *device = irr_driver->getDevice();
|
||||||
|
device->getTimer()->stop();
|
||||||
} // pause
|
} // pause
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -290,6 +286,6 @@ void WorldStatus::unpause()
|
|||||||
// Set m_previous_phase so that we can use an assert
|
// Set m_previous_phase so that we can use an assert
|
||||||
// in pause to detect incorrect pause/unpause sequences.
|
// in pause to detect incorrect pause/unpause sequences.
|
||||||
m_previous_phase = UNDEFINED_PHASE;
|
m_previous_phase = UNDEFINED_PHASE;
|
||||||
|
IrrlichtDevice *device = irr_driver->getDevice();
|
||||||
m_world_timer->unfreezeTimer();
|
device->getTimer()->start();
|
||||||
} // unpause
|
} // unpause
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#define HEADER_WORLD_STATUS_HPP
|
#define HEADER_WORLD_STATUS_HPP
|
||||||
|
|
||||||
class SFXBase;
|
class SFXBase;
|
||||||
class WorldTimer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A class that manages the clock (countdown, chrono, etc.)
|
* \brief A class that manages the clock (countdown, chrono, etc.)
|
||||||
@ -106,11 +105,6 @@ protected:
|
|||||||
*/
|
*/
|
||||||
float m_auxiliary_timer;
|
float m_auxiliary_timer;
|
||||||
|
|
||||||
/**
|
|
||||||
* Freeze-Unfreeze timer of the game
|
|
||||||
*/
|
|
||||||
WorldTimer *m_world_timer;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WorldStatus();
|
WorldStatus();
|
||||||
virtual ~WorldStatus();
|
virtual ~WorldStatus();
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
// SuperTuxKart - a fun racing game with go-kart
|
|
||||||
// Copyright (C) 2004 SuperTuxKart-Team
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 3
|
|
||||||
// of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
#include "world_timer.hpp"
|
|
||||||
|
|
||||||
/** Constructs the world timer.*/
|
|
||||||
WorldTimer::WorldTimer()
|
|
||||||
{
|
|
||||||
IrrlichtDevice* device = irr_driver->getDevice();
|
|
||||||
m_freeze = device->getTimer()->isStopped();
|
|
||||||
} //WorldTimer
|
|
||||||
|
|
||||||
/** Destructor the world timer.*/
|
|
||||||
WorldTimer::~WorldTimer()
|
|
||||||
{
|
|
||||||
//unfreeze timer before left
|
|
||||||
unfreezeTimer();
|
|
||||||
} //~WorldTimer
|
|
||||||
|
|
||||||
/** Stop timer of the game*/
|
|
||||||
void WorldTimer::freezeTimer()
|
|
||||||
{
|
|
||||||
if (!m_freeze)
|
|
||||||
{
|
|
||||||
IrrlichtDevice* device = irr_driver->getDevice();
|
|
||||||
device->getTimer()->stop();
|
|
||||||
m_freeze = device->getTimer()->isStopped();
|
|
||||||
}
|
|
||||||
} //freezeTimer
|
|
||||||
|
|
||||||
/** Restart timer of the game*/
|
|
||||||
void WorldTimer::unfreezeTimer()
|
|
||||||
{
|
|
||||||
if (m_freeze)
|
|
||||||
{
|
|
||||||
IrrlichtDevice* device = irr_driver->getDevice();
|
|
||||||
device->getTimer()->start();
|
|
||||||
m_freeze = device->getTimer()->isStopped();
|
|
||||||
}
|
|
||||||
} //unfreezeTimer
|
|
@ -1,42 +0,0 @@
|
|||||||
// SuperTuxKart - a fun racing game with go-kart
|
|
||||||
// Copyright (C) 2004 SuperTuxKart-Team
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 3
|
|
||||||
// of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
#ifndef HEADER_WORLD_TIMER_HPP
|
|
||||||
#define HEADER_WORLD_TIMER_HPP
|
|
||||||
|
|
||||||
#include "graphics/irr_driver.hpp"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When pause the game, something must be 'freeze' such as particle (nitro, terrain smoke...) and terrain animation(water...).
|
|
||||||
* WorldTimer will stop the timer of the game when gamer pause game, so that all thing bellow will not animate,
|
|
||||||
* when gamer resume, this class will start the timer, too.
|
|
||||||
*/
|
|
||||||
class WorldTimer
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
bool m_freeze;
|
|
||||||
public:
|
|
||||||
WorldTimer();
|
|
||||||
~WorldTimer();
|
|
||||||
|
|
||||||
/** Stop timer of the game*/
|
|
||||||
void freezeTimer();
|
|
||||||
/** Restart timer of the game*/
|
|
||||||
void unfreezeTimer();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user