tirbofish/dropbear · diff
fix: fix up native since i remove collidercollisionsarray.
Signature present but could not be verified.
Unverified
@@ -14,10 +14,28 @@ pub fn generate_c_header() -> anyhow::Result<()> { let mut functions = Vec::new(); let mut structs = std::collections::HashMap::new(); let mut enums = Vec::new(); + + seed_well_known_extern_types(&mut structs); + + // Scan sibling crates for additional type definitions (not function exports) + let crates_dir = workspace_root.join("crates"); + if let Ok(entries) = std::fs::read_dir(&crates_dir) { + let mut sorted: Vec<_> = entries.filter_map(Result::ok).collect(); + sorted.sort_by_key(|e| e.path()); + for entry in sorted { + let crate_src = entry.path().join("src"); + // Only scan other crates, not the current one + if crate_src.exists() && crate_src != src_dir { + let _ = collect_type_definitions_only(&crate_src, &mut structs, &mut enums); + } + } + } + collect_exported_functions(&src_dir, &mut functions, &mut structs, &mut enums)?; functions.sort_by(|a, b| a.name.cmp(&b.name)); enums.sort_by(|a, b| a.name.cmp(&b.name)); + enums.dedup_by(|a, b| a.name == b.name); let header = render_header(&functions, &structs, &enums); if let Ok(existing) = std::fs::read_to_string(&output_path) { @@ -31,6 +49,66 @@ pub fn generate_c_header() -> anyhow::Result<()> { Ok(()) } +fn seed_well_known_extern_types(structs: &mut std::collections::HashMap<String, StructDef>) { + // glam::Vec3 - #[repr(C)] with f32 x/y/z fields + structs.entry("Vec3".to_string()).or_insert(StructDef { + name: "Vec3".to_string(), + fields: vec![ + ExportParam { name: "x".to_string(), ty: "float".to_string() }, + ExportParam { name: "y".to_string(), ty: "float".to_string() }, + ExportParam { name: "z".to_string(), ty: "float".to_string() }, + ], + is_repr_c: true, + }); + // glam::Vec4 - #[repr(C)] with f32 x/y/z/w fields + structs.entry("Vec4".to_string()).or_insert(StructDef {
Large diffs are not rendered by default. Showing the first 50 of 831 lines. Show full diff