From cc0a4412a4ac7f1f78ef7e644a0c06c6dd6dd129 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 26 Aug 2008 17:42:30 +0000 Subject: improved dust rendering --- src/core/entity.cc | 5 +++++ src/core/entity.h | 5 +++++ src/core/gameserver.cc | 2 +- src/core/net.h | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/entity.cc b/src/core/entity.cc index 99462b8..0a6a201 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -371,6 +371,7 @@ EntityControlable::EntityControlable(Player *owner, unsigned int flags) : EntityDynamic(flags) { entity_thrust = 0; + entity_movement = 0; target_direction = 0.0f; target_thrust = 0.0f; @@ -388,6 +389,7 @@ EntityControlable::EntityControlable(std::istream & is) : EntityDynamic(is) { entity_thrust = 0; + entity_movement = 0; target_direction = 0.0f; target_thrust = 0.0f; @@ -452,6 +454,7 @@ void EntityControlable::serialize_server_update(std::ostream & os) const { EntityDynamic::serialize_server_update(os); os << roundf(entity_thrust*100.0f) << " "; + os << roundf(entity_movement * 100.0f) << " "; } void EntityControlable::receive_server_update(std::istream &is) @@ -459,6 +462,8 @@ void EntityControlable::receive_server_update(std::istream &is) EntityDynamic::receive_server_update(is); is >> entity_thrust; entity_thrust /= 100.0f; + is >> entity_movement; + entity_movement /= 100.0f; } void EntityControlable::frame(float seconds) diff --git a/src/core/entity.h b/src/core/entity.h index 6214d50..180d535 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -311,6 +311,9 @@ public: /// thrust inline float thrust() const { return entity_thrust; } + /// movement indicator + inline float movement() const { return entity_movement; } + /*----- serializers ----------------------------------------------- */ /// serialize the entity to a stream @@ -382,6 +385,8 @@ protected: float target_strafe; + float entity_movement; + private: // owner of the entity Player *entity_owner; diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index ea97eaf..5e1165d 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -121,7 +121,7 @@ GameServer::GameServer() : GameInterface() return; } - load_config(); + //load_config(); //FIXME interferes with command line because of cmd.exec // set the name of the game core::Cvar::set("g_name", server_module->name().c_str(), core::Cvar::Game | core::Cvar::ReadOnly); diff --git a/src/core/net.h b/src/core/net.h index c96ec7e..f3f976b 100644 --- a/src/core/net.h +++ b/src/core/net.h @@ -11,7 +11,7 @@ namespace core { /// network protocol version -const unsigned int PROTOCOLVERSION = 8; +const unsigned int PROTOCOLVERSION = 9; /// maximum lenght of a (compressed) network message block const unsigned int FRAMESIZE = 1152; -- cgit v1.2.3