Fixed up netowrk synchronizer's DataBuffer, and added it to the build.

This commit is contained in:
Relintai 2022-03-23 13:57:14 +01:00
parent d1587aaa6b
commit 75fbda2418
4 changed files with 12 additions and 10 deletions

View File

@ -8,5 +8,6 @@ env_network_synchronizer = env_modules.Clone()
#env_network_synchronizer.add_source_files(env.modules_sources, "*.cpp")
env_network_synchronizer.add_source_files(env.modules_sources, "bit_array.cpp")
env_network_synchronizer.add_source_files(env.modules_sources, "data_buffer.cpp")
env_network_synchronizer.add_source_files(env.modules_sources, "register_types.cpp")

View File

@ -579,7 +579,7 @@ Variant DataBuffer::add_variant(const Variant &p_input) {
const Error write_err = encode_variant(
p_input,
buffer.get_bytes_mut().ptrw() + (bit_offset / 8),
buffer.get_bytes_mut().write().ptr() + (bit_offset / 8),
len,
false);
@ -610,7 +610,7 @@ Variant DataBuffer::read_variant() {
const Error read_err = decode_variant(
ret,
buffer.get_bytes().ptr() + (bit_offset / 8),
buffer.get_bytes_mut().write().ptr() + (bit_offset / 8),
buffer.size_in_bytes() - (bit_offset / 8),
&len,
false);
@ -766,7 +766,7 @@ int DataBuffer::read_variant_size() {
const Error read_err = decode_variant(
ret,
buffer.get_bytes().ptr() + (bit_offset / 8),
buffer.get_bytes_mut().write().ptr() + (bit_offset / 8),
buffer.size_in_bytes() - (bit_offset / 8),
&len,
false);

View File

@ -1,3 +1,6 @@
#ifndef INPUT_BUFFER_H
#define INPUT_BUFFER_H
/*************************************************************************/
/* data_buffer.h */
/*************************************************************************/
@ -36,9 +39,6 @@
#include "bit_array.h"
#ifndef INPUT_BUFFER_H
#define INPUT_BUFFER_H
class DataBuffer : public Object {
GDCLASS(DataBuffer, Object);

View File

@ -34,8 +34,8 @@
#include "register_types.h"
/*
#include "data_buffer.h"
/*
#include "interpolator.h"
#include "networked_controller.h"
#include "scene_diff.h"
@ -43,15 +43,16 @@
*/
void register_network_synchronizer_types() {
ClassDB::register_class<DataBuffer>();
/*
GDREGISTER_CLASS(DataBuffer);
GDREGISTER_CLASS(SceneDiff);
GDREGISTER_CLASS(Interpolator);
GDREGISTER_CLASS(NetworkedController);
GDREGISTER_CLASS(SceneSynchronizer);
*/
// GLOBAL_DEF("NetworkSynchronizer/debug_server_speedup", false);
// GLOBAL_DEF("NetworkSynchronizer/debug_doll_speedup", false);
// GLOBAL_DEF("NetworkSynchronizer/debug_server_speedup", false);
// GLOBAL_DEF("NetworkSynchronizer/debug_doll_speedup", false);
}
void unregister_network_synchronizer_types() {