From 9e9eac46763feec5334f50c55b5ffdd233ae6472 Mon Sep 17 00:00:00 2001 From: Raul Santos <raulsntos@gmail.com> Date: Sun, 15 Jan 2023 20:33:20 +0100 Subject: Use enum instead of int in virtual methods return type --- scene/resources/visual_shader.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scene/resources/visual_shader.cpp') diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index bfcf5cb137..c18cad48d5 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -427,7 +427,10 @@ void VisualShaderNodeCustom::update_ports() { if (!GDVIRTUAL_CALL(_get_input_port_name, i, port.name)) { port.name = "in" + itos(i); } - if (!GDVIRTUAL_CALL(_get_input_port_type, i, port.type)) { + PortType port_type; + if (GDVIRTUAL_CALL(_get_input_port_type, i, port_type)) { + port.type = (int)port_type; + } else { port.type = (int)PortType::PORT_TYPE_SCALAR; } @@ -445,7 +448,10 @@ void VisualShaderNodeCustom::update_ports() { if (!GDVIRTUAL_CALL(_get_output_port_name, i, port.name)) { port.name = "out" + itos(i); } - if (!GDVIRTUAL_CALL(_get_output_port_type, i, port.type)) { + PortType port_type; + if (GDVIRTUAL_CALL(_get_output_port_type, i, port_type)) { + port.type = (int)port_type; + } else { port.type = (int)PortType::PORT_TYPE_SCALAR; } -- cgit v1.2.3