[Orxonox-commit 3628] r8313 - code/branches/kicklib2/src/libraries/network
rgrieder at orxonox.net
rgrieder at orxonox.net
Sat Apr 23 04:52:30 CEST 2011
Author: rgrieder
Date: 2011-04-23 04:52:30 +0200 (Sat, 23 Apr 2011)
New Revision: 8313
Modified:
code/branches/kicklib2/src/libraries/network/ClientInformation.cc
code/branches/kicklib2/src/libraries/network/ClientInformation.h
code/branches/kicklib2/src/libraries/network/Server.cc
code/branches/kicklib2/src/libraries/network/Server.h
Log:
Not using doubles at all in Orxonox because the Renderer (DirectX in particular) might set to single precision. So the general strategy would be not to use doubles at all.
Modified: code/branches/kicklib2/src/libraries/network/ClientInformation.cc
===================================================================
--- code/branches/kicklib2/src/libraries/network/ClientInformation.cc 2011-04-23 00:28:24 UTC (rev 8312)
+++ code/branches/kicklib2/src/libraries/network/ClientInformation.cc 2011-04-23 02:52:30 UTC (rev 8313)
@@ -149,8 +149,8 @@
return this->peer_->roundTripTime;
}
- double ClientInformation::getPacketLoss(){
- return static_cast<double>(this->peer_->packetLoss)/ENET_PEER_PACKET_LOSS_SCALE;
+ float ClientInformation::getPacketLoss(){
+ return static_cast<float>(this->peer_->packetLoss)/ENET_PEER_PACKET_LOSS_SCALE;
}
unsigned int ClientInformation::getGamestateID() {
Modified: code/branches/kicklib2/src/libraries/network/ClientInformation.h
===================================================================
--- code/branches/kicklib2/src/libraries/network/ClientInformation.h 2011-04-23 00:28:24 UTC (rev 8312)
+++ code/branches/kicklib2/src/libraries/network/ClientInformation.h 2011-04-23 02:52:30 UTC (rev 8313)
@@ -74,7 +74,7 @@
ENetPeer *getPeer();
uint32_t getRTT();
- double getPacketLoss();
+ float getPacketLoss();
static bool removeClient(unsigned int clientID);
static bool removeClient(ENetPeer *peer);
Modified: code/branches/kicklib2/src/libraries/network/Server.cc
===================================================================
--- code/branches/kicklib2/src/libraries/network/Server.cc 2011-04-23 00:28:24 UTC (rev 8312)
+++ code/branches/kicklib2/src/libraries/network/Server.cc 2011-04-23 02:52:30 UTC (rev 8313)
@@ -249,7 +249,7 @@
/**
* @brief: return packet loss ratio to client (scales from 0 to 1)
*/
- double Server::getPacketLoss(unsigned int clientID)
+ float Server::getPacketLoss(unsigned int clientID)
{
assert(ClientInformation::findClient(clientID));
return ClientInformation::findClient(clientID)->getPacketLoss();
Modified: code/branches/kicklib2/src/libraries/network/Server.h
===================================================================
--- code/branches/kicklib2/src/libraries/network/Server.h 2011-04-23 00:28:24 UTC (rev 8312)
+++ code/branches/kicklib2/src/libraries/network/Server.h 2011-04-23 02:52:30 UTC (rev 8313)
@@ -72,7 +72,7 @@
void update(const Clock& time);
unsigned int getRTT(unsigned int clientID);
virtual void printRTT();
- double getPacketLoss(unsigned int clientID);
+ float getPacketLoss(unsigned int clientID);
protected:
void updateGamestate();
private:
More information about the Orxonox-commit
mailing list