From fbbd3950c82195e4d1b7d681aea0a9bd2fa67f4b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 1 Sep 2022 05:09:07 +0200 Subject: Simplify network GDExtension bindings using EXBIND macros. Simplify StreamPeer, PacketPeer, MultiplayerPeer extension. Simplify and update WebRTC*Extension with newly supported types. --- core/io/packet_peer.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'core/io/packet_peer.h') diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index ec9d33aa5a..07045e62a6 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -35,6 +35,7 @@ #include "core/object/class_db.h" #include "core/templates/ring_buffer.h" +#include "core/extension/ext_wrappers.gen.inc" #include "core/object/gdvirtual.gen.inc" #include "core/object/script_language.h" #include "core/variant/native_ptr.h" @@ -84,16 +85,14 @@ protected: static void _bind_methods(); public: - virtual int get_available_packet_count() const override; virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) override; ///< buffer is GONE after next get_packet + GDVIRTUAL2R(Error, _get_packet, GDNativeConstPtr, GDNativePtr); + virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size) override; - virtual int get_max_packet_size() const override; + GDVIRTUAL2R(Error, _put_packet, GDNativeConstPtr, int); - /* GDExtension */ - GDVIRTUAL0RC(int, _get_available_packet_count); - GDVIRTUAL2R(int, _get_packet, GDNativeConstPtr, GDNativePtr); - GDVIRTUAL2R(int, _put_packet, GDNativeConstPtr, int); - GDVIRTUAL0RC(int, _get_max_packet_size); + EXBIND0RC(int, get_available_packet_count); + EXBIND0RC(int, get_max_packet_size); }; class PacketPeerStream : public PacketPeer { -- cgit v1.2.3