stream world data from pxl8d to pxl8
This commit is contained in:
parent
39ee0fefb7
commit
a71a9840b2
55 changed files with 5290 additions and 2131 deletions
|
|
@ -14,12 +14,14 @@ extern "C" {
|
|||
|
||||
typedef enum pxl8_msg_type {
|
||||
PXL8_MSG_NONE = 0,
|
||||
PXL8_MSG_CHUNK,
|
||||
PXL8_MSG_CHUNK_ENTER,
|
||||
PXL8_MSG_COMMAND,
|
||||
PXL8_MSG_CONNECT,
|
||||
PXL8_MSG_DISCONNECT,
|
||||
PXL8_MSG_EVENT,
|
||||
PXL8_MSG_INPUT,
|
||||
PXL8_MSG_COMMAND,
|
||||
PXL8_MSG_SNAPSHOT,
|
||||
PXL8_MSG_EVENT
|
||||
PXL8_MSG_SNAPSHOT
|
||||
} pxl8_msg_type;
|
||||
|
||||
typedef struct pxl8_msg_header {
|
||||
|
|
@ -70,6 +72,39 @@ typedef struct pxl8_snapshot_header {
|
|||
f32 time;
|
||||
} pxl8_snapshot_header;
|
||||
|
||||
#define PXL8_CHUNK_TYPE_VXL 0
|
||||
#define PXL8_CHUNK_TYPE_BSP 1
|
||||
|
||||
#define PXL8_CHUNK_FLAG_RLE 0x01
|
||||
#define PXL8_CHUNK_FLAG_FINAL 0x04
|
||||
#define PXL8_CHUNK_MAX_PAYLOAD 1400
|
||||
|
||||
typedef struct pxl8_chunk_msg_header {
|
||||
u8 chunk_type;
|
||||
u8 flags;
|
||||
u8 fragment_idx;
|
||||
u8 fragment_count;
|
||||
u32 id;
|
||||
i32 cx, cy, cz;
|
||||
u32 version;
|
||||
u16 payload_size;
|
||||
u16 reserved;
|
||||
} pxl8_chunk_msg_header;
|
||||
|
||||
typedef struct pxl8_bsp_wire_header {
|
||||
u32 num_vertices;
|
||||
u32 num_edges;
|
||||
u32 num_faces;
|
||||
u32 num_planes;
|
||||
u32 num_nodes;
|
||||
u32 num_leafs;
|
||||
u32 num_surfedges;
|
||||
u32 num_marksurfaces;
|
||||
u32 num_cell_portals;
|
||||
u32 visdata_size;
|
||||
u32 num_vertex_lights;
|
||||
} pxl8_bsp_wire_header;
|
||||
|
||||
usize pxl8_protocol_serialize_header(const pxl8_msg_header* msg, u8* buf, usize len);
|
||||
usize pxl8_protocol_deserialize_header(const u8* buf, usize len, pxl8_msg_header* msg);
|
||||
|
||||
|
|
@ -88,6 +123,20 @@ usize pxl8_protocol_deserialize_event(const u8* buf, usize len, pxl8_event_msg*
|
|||
usize pxl8_protocol_serialize_snapshot_header(const pxl8_snapshot_header* hdr, u8* buf, usize len);
|
||||
usize pxl8_protocol_deserialize_snapshot_header(const u8* buf, usize len, pxl8_snapshot_header* hdr);
|
||||
|
||||
usize pxl8_protocol_serialize_chunk_msg_header(const pxl8_chunk_msg_header* hdr, u8* buf, usize len);
|
||||
usize pxl8_protocol_deserialize_chunk_msg_header(const u8* buf, usize len, pxl8_chunk_msg_header* hdr);
|
||||
|
||||
usize pxl8_protocol_deserialize_bsp_wire_header(const u8* buf, usize len, pxl8_bsp_wire_header* hdr);
|
||||
|
||||
typedef struct pxl8_chunk_enter_msg {
|
||||
u32 chunk_id;
|
||||
u8 chunk_type;
|
||||
u8 reserved[3];
|
||||
} pxl8_chunk_enter_msg;
|
||||
|
||||
usize pxl8_protocol_serialize_chunk_enter(const pxl8_chunk_enter_msg* msg, u8* buf, usize len);
|
||||
usize pxl8_protocol_deserialize_chunk_enter(const u8* buf, usize len, pxl8_chunk_enter_msg* msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue