Trying to create a fixed time slice system

This commit is contained in:
Kayne Ruse
2013-06-02 04:00:26 +10:00
parent 4c670c3a22
commit 6a16e341ec
9 changed files with 31 additions and 63 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ struct ClientData {
handle = h;
avatar = a;
}
void Update(int delta) {
void Update(double delta) {
position += motion * delta;
}
+4 -4
View File
@@ -54,10 +54,10 @@ void ServerApplication::Proc() {
}
}
//update the world
delta.Calculate();
for (auto it : clientMap) {
it.second.Update(delta.GetDelta());
}
//TODO Delta::Calculate();
// for (auto it : clientMap) {
// it.second.Update(Delta::GetTime());
// }
//handle output...
//TODO...
-2
View File
@@ -3,7 +3,6 @@
#include "client_data.hpp"
#include "delta.hpp"
#include "packet_list.hpp"
#include "config_utility.hpp"
#include "udp_network_utility.hpp"
@@ -37,7 +36,6 @@ private:
//members
bool running = false;
Delta delta;
std::map<int, ClientData> clientMap;
int maxClients = SDLNET_MAX_UDPCHANNELS;
int uniqueIndex = 0;