Trying to create a fixed time slice system
This commit is contained in:
@@ -13,7 +13,7 @@ struct ClientData {
|
||||
handle = h;
|
||||
avatar = a;
|
||||
}
|
||||
void Update(int delta) {
|
||||
void Update(double delta) {
|
||||
position += motion * delta;
|
||||
}
|
||||
|
||||
|
||||
@@ -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...
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user