From 9a3960daa59a728f2620f64ad182aa332059489c Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 30 Nov 2022 16:40:50 +0100 Subject: Simplify GDVIRTUAL_REQUIRED_CALL calls --- scene/resources/material.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'scene/resources/material.cpp') diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 10d193f950..e457b2d377 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -92,18 +92,13 @@ void Material::inspect_native_shader_code() { RID Material::get_shader_rid() const { RID ret; - if (GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret)) { - return ret; - } - return RID(); + GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret); + return ret; } Shader::Mode Material::get_shader_mode() const { - Shader::Mode ret; - if (GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret)) { - return ret; - } - - return Shader::MODE_MAX; + Shader::Mode ret = Shader::MODE_MAX; + GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret); + return ret; } bool Material::_can_do_next_pass() const { -- cgit v1.2.3