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

Re-enable ThemeDb + impl GodotConvert for *mut c_void #461

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

aekobear
Copy link
Contributor

@aekobear aekobear commented Oct 23, 2023

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-461

Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Two minor comments, could you amend your previous commit with them?

Comment on lines 206 to 210
if cfg!(before_api = "4.2") && class.name == "ThemeDB" {
// registered in C++ register_scene_singletons(), after MODULE_INITIALIZATION_LEVEL_EDITOR happens.
// fixed since 4.2 (https://github.com/godotengine/godot/pull/81305)
ClassCodegenLevel::Lazy
} else if class.name.ends_with("Server") {
Copy link
Member

@Bromeon Bromeon Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is still necessary now...

  • before 4.2, ThemeDB class is absent -> so the API level shouldn't be queried
  • since 4.2, ThemeDB has Scene level

Could you try to entirely remove this branch, as well as the ClassCodegenLevel::Lazy variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, I was able to remove it without a problem 👍

@@ -240,3 +240,21 @@ impl FromGodot for *const std::ffi::c_void {
Some(via as Self)
}
}

// mut void* is used by ScriptExtension::instance_create()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In C, it's just void*, not mut void*.

You could move this up to line 226, before // Other impls..., then it should be clearer.
Also please end with a full stop 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: engine Godot classes (nodes, resources, ...) labels Oct 24, 2023
@Bromeon Bromeon changed the title Reenable ThemeDb & impl GodotConvert *mut c_void Re-enable ThemeDb + impl GodotConvert for *mut c_void Oct 24, 2023
@aekobear aekobear force-pushed the mut-cvoid-and-themedb branch from c5d5350 to 4650b82 Compare October 24, 2023 18:46
@Bromeon Bromeon enabled auto-merge October 24, 2023 19:14
@Bromeon Bromeon added this pull request to the merge queue Oct 24, 2023
Merged via the queue into godot-rust:master with commit 0028a86 Oct 24, 2023
15 checks passed
@Bromeon
Copy link
Member

Bromeon commented Oct 24, 2023

Thank you! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: engine Godot classes (nodes, resources, ...) quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants