[ServerWorld] Sending Scene state more often.
This commit is contained in:
parent
419fc8b46c
commit
4909d1dbc2
@ -34,7 +34,7 @@
|
||||
|
||||
#include "Registry.hpp"
|
||||
|
||||
void RenderingController::update(entt::DefaultRegistry ®istry) {
|
||||
void RenderingController::draw(entt::DefaultRegistry ®istry, gk::RenderTarget &target, gk::RenderStates states) {
|
||||
registry.view<DrawableDef>().each([&](auto entity, auto &drawableDef) {
|
||||
const InventoryCubeDef &cubeDef = drawableDef.getInventoryCubeDef();
|
||||
|
||||
@ -48,9 +48,7 @@ void RenderingController::update(entt::DefaultRegistry ®istry) {
|
||||
|
||||
registry.remove<DrawableDef>(entity);
|
||||
});
|
||||
}
|
||||
|
||||
void RenderingController::draw(entt::DefaultRegistry ®istry, gk::RenderTarget &target, gk::RenderStates states) {
|
||||
registry.view<DrawableComponent, gk::Transformable>().each([&](auto, auto &drawable, auto &transformable) {
|
||||
gk::RenderStates drawStates = states;
|
||||
drawStates.transform *= transformable.getTransform();
|
||||
|
@ -31,8 +31,6 @@
|
||||
|
||||
class RenderingController : public AbstractController {
|
||||
public:
|
||||
void update(entt::DefaultRegistry ®istry) override;
|
||||
|
||||
void draw(entt::DefaultRegistry ®istry, gk::RenderTarget &target, gk::RenderStates states) override;
|
||||
};
|
||||
|
||||
|
@ -57,9 +57,10 @@ void ServerWorld::update() {
|
||||
m_scene.update();
|
||||
|
||||
// FIXME: Should be placed somewhere else
|
||||
// FIXME: Shouldn't be sent that often
|
||||
static int lastTime = m_clock.getTicks(true);
|
||||
int now = m_clock.getTicks(true);
|
||||
if (now - lastTime > 100) {
|
||||
if (now - lastTime > 10) {
|
||||
lastTime = now;
|
||||
|
||||
sf::Packet packet;
|
||||
|
Loading…
x
Reference in New Issue
Block a user