Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompositorEffect should use GDVIRTUAL_CALL() so it works with GDExtension #99981

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scene/resources/compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ void CompositorEffect::_validate_property(PropertyInfo &p_property) const {
}
}

void CompositorEffect::_call_render_callback(int p_effect_callback_type, const RenderData *p_render_data) {
GDVIRTUAL_CALL(_render_callback, p_effect_callback_type, p_render_data);
}

void CompositorEffect::set_enabled(bool p_enabled) {
enabled = p_enabled;
if (rid.is_valid()) {
Expand All @@ -105,7 +109,7 @@ void CompositorEffect::set_effect_callback_type(EffectCallbackType p_callback_ty
if (rid.is_valid()) {
RenderingServer *rs = RenderingServer::get_singleton();
ERR_FAIL_NULL(rs);
rs->compositor_effect_set_callback(rid, RenderingServer::CompositorEffectCallbackType(effect_callback_type), Callable(this, "_render_callback"));
rs->compositor_effect_set_callback(rid, RenderingServer::CompositorEffectCallbackType(effect_callback_type), callable_mp(this, &CompositorEffect::_call_render_callback));
}
}

Expand Down
2 changes: 2 additions & 0 deletions scene/resources/compositor.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class CompositorEffect : public Resource {
static void _bind_methods();
void _validate_property(PropertyInfo &p_property) const;

void _call_render_callback(int p_effect_callback_type, const RenderData *p_render_data);

GDVIRTUAL2(_render_callback, int, const RenderData *)

public:
Expand Down
Loading