Header clean up
This commit is contained in:
parent
f547753aaa
commit
01b95d873e
@ -32,6 +32,7 @@
|
|||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
#include "karts/max_speed.hpp"
|
#include "karts/max_speed.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "tracks/quad.hpp"
|
#include "tracks/quad.hpp"
|
||||||
#include "utils/constants.hpp"
|
#include "utils/constants.hpp"
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "karts/explosion_animation.hpp"
|
#include "karts/explosion_animation.hpp"
|
||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "physics/triangle_mesh.hpp"
|
#include "physics/triangle_mesh.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
#include "karts/controller/controller.hpp"
|
#include "karts/controller/controller.hpp"
|
||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
#include "physics/physical_object.hpp"
|
#include "physics/physical_object.hpp"
|
||||||
#include "physics/physics.hpp"
|
#include "physics/physics.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "physics/triangle_mesh.hpp"
|
#include "physics/triangle_mesh.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include "items/projectile_manager.hpp"
|
#include "items/projectile_manager.hpp"
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
#include "modes/linear_world.hpp"
|
#include "modes/linear_world.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "physics/btKart.hpp"
|
#include "physics/btKart.hpp"
|
||||||
#include "physics/triangle_mesh.hpp"
|
#include "physics/triangle_mesh.hpp"
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
|
|
||||||
#define SWAT_POS_OFFSET core::vector3df(0.0, 0.2f, -0.4f)
|
#define SWAT_POS_OFFSET core::vector3df(0.0, 0.2f, -0.4f)
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "karts/skidding.hpp"
|
#include "karts/skidding.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "physics/physics.hpp"
|
#include "physics/physics.hpp"
|
||||||
|
|
||||||
|
@ -17,35 +17,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "karts/controller/kart_control.hpp"
|
#include "karts/controller/kart_control.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
#include "network/protocols/game_protocol.hpp"
|
|
||||||
#include "network/rewind_manager.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
/** Called when going back in time during a rewind. Nothing to do here
|
|
||||||
* in this case.
|
|
||||||
*/
|
|
||||||
void KartControl::undo(BareNetworkString *buffer)
|
|
||||||
{
|
|
||||||
} // undo
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
/** Replay an event for a KartControl object from the buffer.
|
|
||||||
* \param buffer BareNetworkString with saved event into.
|
|
||||||
*/
|
|
||||||
void KartControl::rewind(BareNetworkString *buffer)
|
|
||||||
{
|
|
||||||
if(buffer->getTotalSize()>1)
|
|
||||||
{
|
|
||||||
// Full state including accel and steering was saved
|
|
||||||
rewindTo(buffer);
|
|
||||||
}
|
|
||||||
else // only a button event was stored
|
|
||||||
{
|
|
||||||
setButtonsCompressed(buffer->getUInt8());
|
|
||||||
}
|
|
||||||
} // rewind
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Sets the current steering value. */
|
/** Sets the current steering value. */
|
||||||
@ -102,3 +74,20 @@ void KartControl::setLookBack(bool b)
|
|||||||
{
|
{
|
||||||
m_look_back = b;
|
m_look_back = b;
|
||||||
} // setLookBack
|
} // setLookBack
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
/** Copies the important data from this objects into a memory buffer. */
|
||||||
|
void KartControl::saveState(BareNetworkString *buffer) const
|
||||||
|
{
|
||||||
|
buffer->add(m_steer);
|
||||||
|
buffer->add(m_accel);
|
||||||
|
buffer->addChar(getButtonsCompressed());
|
||||||
|
} // saveState
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
/** Restores this object from a previously saved memory buffer. */
|
||||||
|
void KartControl::rewindTo(BareNetworkString *buffer)
|
||||||
|
{
|
||||||
|
m_steer = buffer->getFloat();
|
||||||
|
m_accel = buffer->getFloat();
|
||||||
|
setButtonsCompressed(buffer->getUInt8());
|
||||||
|
} // setFromMemory
|
||||||
|
@ -19,13 +19,12 @@
|
|||||||
#ifndef HEADER_KART_CONTROL_HPP
|
#ifndef HEADER_KART_CONTROL_HPP
|
||||||
#define HEADER_KART_CONTROL_HPP
|
#define HEADER_KART_CONTROL_HPP
|
||||||
|
|
||||||
#include "network/network_string.hpp"
|
class BareNetworkString;
|
||||||
#include "network/rewind_info.hpp"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \ingroup controller
|
* \ingroup controller
|
||||||
*/
|
*/
|
||||||
class KartControl : public EventRewinder
|
class KartControl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** The skidding control state: SC_NONE: not pressed;
|
/** The skidding control state: SC_NONE: not pressed;
|
||||||
@ -51,8 +50,6 @@ private:
|
|||||||
/** True if the kart looks (and shoots) backwards. */
|
/** True if the kart looks (and shoots) backwards. */
|
||||||
bool m_look_back;
|
bool m_look_back;
|
||||||
public:
|
public:
|
||||||
virtual void undo(BareNetworkString *buffer);
|
|
||||||
virtual void rewind(BareNetworkString *buffer);
|
|
||||||
void setSteer(float f);
|
void setSteer(float f);
|
||||||
void setAccel(float f);
|
void setAccel(float f);
|
||||||
void setBrake(bool b);
|
void setBrake(bool b);
|
||||||
@ -100,22 +97,10 @@ public:
|
|||||||
static int getLength() { return 9; }
|
static int getLength() { return 9; }
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Copies the important data from this objects into a memory buffer. */
|
/** Copies the important data from this objects into a memory buffer. */
|
||||||
void saveState(BareNetworkString *buffer) const
|
void saveState(BareNetworkString *buffer) const;
|
||||||
{
|
|
||||||
buffer->add(m_steer);
|
|
||||||
buffer->add(m_accel);
|
|
||||||
buffer->addChar(getButtonsCompressed());
|
|
||||||
} // saveState
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Restores this object from a previously saved memory buffer. */
|
/** Restores this object from a previously saved memory buffer. */
|
||||||
void rewindTo(BareNetworkString *buffer)
|
void rewindTo(BareNetworkString *buffer);
|
||||||
{
|
|
||||||
m_steer = buffer->getFloat();
|
|
||||||
m_accel = buffer->getFloat();
|
|
||||||
setButtonsCompressed(buffer->getUInt8());
|
|
||||||
} // setFromMemory
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Compresses all buttons into a single byte. */
|
/** Compresses all buttons into a single byte. */
|
||||||
char getButtonsCompressed() const
|
char getButtonsCompressed() const
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
#include "network/network_player_profile.hpp"
|
#include "network/network_player_profile.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
#include "network/protocols/lobby_protocol.hpp"
|
#include "network/protocols/lobby_protocol.hpp"
|
||||||
#include "race/history.hpp"
|
#include "race/history.hpp"
|
||||||
#include "states_screens/race_gui_base.hpp"
|
#include "states_screens/race_gui_base.hpp"
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
#include "modes/soccer_world.hpp"
|
#include "modes/soccer_world.hpp"
|
||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
#include "network/race_event_manager.hpp"
|
#include "network/race_event_manager.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "physics/btKart.hpp"
|
#include "physics/btKart.hpp"
|
||||||
#include "physics/btKartRaycast.hpp"
|
#include "physics/btKartRaycast.hpp"
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "items/powerup_manager.hpp" // For PowerupType
|
#include "items/powerup_manager.hpp" // For PowerupType
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
|
#include "utils/cpp2011.hpp"
|
||||||
#include "utils/no_copy.hpp"
|
#include "utils/no_copy.hpp"
|
||||||
|
|
||||||
#include <SColor.h>
|
#include <SColor.h>
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "config/stk_config.hpp"
|
#include "config/stk_config.hpp"
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
|
#include "network/network_string.hpp"
|
||||||
#include "physics/btKart.hpp"
|
#include "physics/btKart.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "karts/controller/kart_control.hpp"
|
#include "karts/controller/kart_control.hpp"
|
||||||
#include "utils/leak_check.hpp"
|
#include "utils/leak_check.hpp"
|
||||||
#include "utils/no_copy.hpp"
|
#include "utils/no_copy.hpp"
|
||||||
|
#include "utils/types.hpp"
|
||||||
|
|
||||||
class BareNetworkString;
|
class BareNetworkString;
|
||||||
class Kart;
|
class Kart;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
#include "network/network_string.hpp"
|
#include "network/network_string.hpp"
|
||||||
#include "network/protocols/game_events_protocol.hpp"
|
#include "network/protocols/game_events_protocol.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "network/stk_host.hpp"
|
#include "network/stk_host.hpp"
|
||||||
#include "physics/physics.hpp"
|
#include "physics/physics.hpp"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "network/network_config.hpp"
|
#include "network/network_config.hpp"
|
||||||
#include "network/network_string.hpp"
|
#include "network/network_string.hpp"
|
||||||
#include "network/protocol_manager.hpp"
|
#include "network/protocol_manager.hpp"
|
||||||
|
#include "network/rewind_info.hpp"
|
||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "network/stk_host.hpp"
|
#include "network/stk_host.hpp"
|
||||||
#include "network/stk_peer.hpp"
|
#include "network/stk_peer.hpp"
|
||||||
|
Loading…
Reference in New Issue
Block a user