mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Use slices and Odin string where possible due to struct field ordering
This commit is contained in:
Vendored
+45
-93
@@ -397,53 +397,44 @@ material :: struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
material_mapping :: struct {
|
material_mapping :: struct {
|
||||||
variant: uint,
|
variant: uint,
|
||||||
material: ^material,
|
material: ^material,
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
morph_target :: struct {
|
morph_target :: struct {
|
||||||
attributes: [^]attribute,
|
attributes: []attribute,
|
||||||
attributes_count: uint,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
draco_mesh_compression :: struct {
|
draco_mesh_compression :: struct {
|
||||||
buffer_view: ^buffer_view,
|
buffer_view: ^buffer_view,
|
||||||
attributes: [^]attribute,
|
attributes: []attribute,
|
||||||
attributes_count: uint,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh_gpu_instancing :: struct {
|
mesh_gpu_instancing :: struct {
|
||||||
buffer_view: ^buffer_view,
|
buffer_view: ^buffer_view,
|
||||||
attributes: [^]attribute,
|
attributes: []attribute,
|
||||||
attributes_count: uint,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
primitive :: struct {
|
primitive :: struct {
|
||||||
type: primitive_type,
|
type: primitive_type,
|
||||||
indices: ^accessor,
|
indices: ^accessor,
|
||||||
material: ^material,
|
material: ^material,
|
||||||
attributes: [^]attribute,
|
attributes: []attribute,
|
||||||
attributes_count: uint,
|
targets: []morph_target,
|
||||||
targets: [^]morph_target,
|
|
||||||
targets_count: uint,
|
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
has_draco_mesh_compression: b32,
|
has_draco_mesh_compression: b32,
|
||||||
draco_mesh_compression: draco_mesh_compression,
|
draco_mesh_compression: draco_mesh_compression,
|
||||||
mappings: [^]material_mapping,
|
mappings: []material_mapping,
|
||||||
mappings_count: uint,
|
|
||||||
extensions_count: uint,
|
extensions_count: uint,
|
||||||
extensions: [^]extension,
|
extensions: [^]extension,
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh :: struct {
|
mesh :: struct {
|
||||||
name: cstring,
|
name: cstring,
|
||||||
primitives: [^]primitive,
|
primitives: []primitive,
|
||||||
primitives_count: uint,
|
weights: []f32,
|
||||||
weights: [^]f32,
|
target_names: []cstring,
|
||||||
weights_count: uint,
|
|
||||||
target_names: [^]cstring,
|
|
||||||
target_names_count: uint,
|
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
extensions_count: uint,
|
extensions_count: uint,
|
||||||
extensions: [^]extension,
|
extensions: [^]extension,
|
||||||
@@ -451,8 +442,7 @@ mesh :: struct {
|
|||||||
|
|
||||||
skin :: struct {
|
skin :: struct {
|
||||||
name: cstring,
|
name: cstring,
|
||||||
joints: [^]^node,
|
joints: []^node,
|
||||||
joints_count: uint,
|
|
||||||
skeleton: ^node,
|
skeleton: ^node,
|
||||||
inverse_bind_matrices: ^accessor,
|
inverse_bind_matrices: ^accessor,
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
@@ -504,14 +494,12 @@ light :: struct {
|
|||||||
node :: struct {
|
node :: struct {
|
||||||
name: cstring,
|
name: cstring,
|
||||||
parent: ^node,
|
parent: ^node,
|
||||||
children: [^]^node,
|
children: []^node,
|
||||||
children_count: uint,
|
|
||||||
skin: ^skin,
|
skin: ^skin,
|
||||||
mesh: ^mesh,
|
mesh: ^mesh,
|
||||||
camera: ^camera,
|
camera: ^camera,
|
||||||
light: ^light,
|
light: ^light,
|
||||||
weights: [^]f32,
|
weights: []f32,
|
||||||
weights_count: uint,
|
|
||||||
has_translation: b32,
|
has_translation: b32,
|
||||||
has_rotation: b32,
|
has_rotation: b32,
|
||||||
has_scale: b32,
|
has_scale: b32,
|
||||||
@@ -529,8 +517,7 @@ node :: struct {
|
|||||||
|
|
||||||
scene :: struct {
|
scene :: struct {
|
||||||
name: cstring,
|
name: cstring,
|
||||||
nodes: [^]^node,
|
nodes: []^node,
|
||||||
nodes_count: uint,
|
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
extensions_count: uint,
|
extensions_count: uint,
|
||||||
extensions: [^]extension,
|
extensions: [^]extension,
|
||||||
@@ -556,10 +543,8 @@ animation_channel :: struct {
|
|||||||
|
|
||||||
animation :: struct {
|
animation :: struct {
|
||||||
name: cstring,
|
name: cstring,
|
||||||
samplers: [^]animation_sampler,
|
samplers: []animation_sampler,
|
||||||
samplers_count: uint,
|
channels: []animation_channel,
|
||||||
channels: [^]animation_channel,
|
|
||||||
channels_count: uint,
|
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
extensions_count: uint,
|
extensions_count: uint,
|
||||||
extensions: [^]extension,
|
extensions: [^]extension,
|
||||||
@@ -586,79 +571,46 @@ data :: struct {
|
|||||||
|
|
||||||
asset: asset,
|
asset: asset,
|
||||||
|
|
||||||
meshes: [^]mesh,
|
meshes: []mesh,
|
||||||
meshes_count: uint,
|
materials: []material,
|
||||||
|
accessors: []accessor,
|
||||||
materials: [^]material,
|
buffer_views: []buffer_view,
|
||||||
materials_count: uint,
|
buffers: []buffer,
|
||||||
|
images: []image,
|
||||||
accessors: [^]accessor,
|
textures: []texture,
|
||||||
accessors_count: uint,
|
samplers: []sampler,
|
||||||
|
skins: []skin,
|
||||||
buffer_views: [^]buffer_view,
|
cameras: []camera,
|
||||||
buffer_views_count: uint,
|
lights: []light,
|
||||||
|
nodes: []node,
|
||||||
buffers: [^]buffer,
|
scenes: []scene,
|
||||||
buffers_count: uint,
|
|
||||||
|
|
||||||
images: [^]image,
|
|
||||||
images_count: uint,
|
|
||||||
|
|
||||||
textures: [^]texture,
|
|
||||||
textures_count: uint,
|
|
||||||
|
|
||||||
samplers: [^]sampler,
|
|
||||||
samplers_count: uint,
|
|
||||||
|
|
||||||
skins: [^]skin,
|
|
||||||
skins_count: uint,
|
|
||||||
|
|
||||||
cameras: [^]camera,
|
|
||||||
cameras_count: uint,
|
|
||||||
|
|
||||||
lights: [^]light,
|
|
||||||
lights_count: uint,
|
|
||||||
|
|
||||||
nodes: [^]node,
|
|
||||||
nodes_count: uint,
|
|
||||||
|
|
||||||
scenes: [^]scene,
|
|
||||||
scenes_count: uint,
|
|
||||||
|
|
||||||
scene: ^scene,
|
scene: ^scene,
|
||||||
|
|
||||||
animations: [^]animation,
|
animations: []animation,
|
||||||
animations_count: uint,
|
|
||||||
|
|
||||||
variants: [^]material_variant,
|
variants: []material_variant,
|
||||||
variants_count: uint,
|
|
||||||
|
|
||||||
extras: extras_t,
|
extras: extras_t,
|
||||||
|
|
||||||
data_extensions_count: uint,
|
data_extensions_count: uint,
|
||||||
data_extensions: [^]extension,
|
data_extensions: [^]extension,
|
||||||
|
|
||||||
extensions_used: [^]cstring,
|
extensions_used: []cstring,
|
||||||
extensions_used_count: uint,
|
extensions_required: []cstring,
|
||||||
|
|
||||||
extensions_required: [^]cstring,
|
json: string,
|
||||||
extensions_required_count: uint,
|
|
||||||
|
|
||||||
json: cstring,
|
bin: []byte,
|
||||||
json_size: uint,
|
|
||||||
|
|
||||||
bin: rawptr,
|
|
||||||
bin_size: uint,
|
|
||||||
|
|
||||||
memory: memory_options,
|
memory: memory_options,
|
||||||
file: file_options,
|
file: file_options,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@(default_calling_convention="c")
|
@(default_calling_convention="c")
|
||||||
@(link_prefix="cgltf_")
|
@(link_prefix="cgltf_")
|
||||||
foreign lib {
|
foreign lib {
|
||||||
|
|
||||||
cgltf_parse :: proc(
|
cgltf_parse :: proc(
|
||||||
options: ^/*const*/options,
|
options: ^/*const*/options,
|
||||||
data_ptr: rawptr,
|
data_ptr: rawptr,
|
||||||
@@ -678,7 +630,7 @@ foreign lib {
|
|||||||
load_buffer_base64 :: proc(options: ^/*const*/options, size: uint, base64: cstring, out_data: ^rawptr) -> result ---
|
load_buffer_base64 :: proc(options: ^/*const*/options, size: uint, base64: cstring, out_data: ^rawptr) -> result ---
|
||||||
|
|
||||||
decode_string :: proc(string: [^]byte) -> uint ---
|
decode_string :: proc(string: [^]byte) -> uint ---
|
||||||
decode_uri :: proc(uri: [^]byte) -> uint ---
|
decode_uri :: proc(uri: [^]byte) -> uint ---
|
||||||
|
|
||||||
validate :: proc(data: ^data) -> result ---
|
validate :: proc(data: ^data) -> result ---
|
||||||
|
|
||||||
@@ -687,8 +639,8 @@ foreign lib {
|
|||||||
node_transform_local :: proc(node: ^node, out_matrix: [^]f32) ---
|
node_transform_local :: proc(node: ^node, out_matrix: [^]f32) ---
|
||||||
node_transform_world :: proc(node: ^node, out_matrix: [^]f32) ---
|
node_transform_world :: proc(node: ^node, out_matrix: [^]f32) ---
|
||||||
|
|
||||||
accessor_read_float :: proc(accessor: ^/*const*/accessor, index: uint, out: ^f32, element_size: uint) -> b32 ---
|
accessor_read_float :: proc(accessor: ^/*const*/accessor, index: uint, out: [^]f32, element_size: uint) -> b32 ---
|
||||||
accessor_read_uint :: proc(accessor: ^/*const*/accessor, index: uint, out: ^c.uint, element_size: uint) -> b32 ---
|
accessor_read_uint :: proc(accessor: ^/*const*/accessor, index: uint, out: [^]c.uint, element_size: uint) -> b32 ---
|
||||||
accessor_read_index :: proc(accessor: ^/*const*/accessor, index: uint) -> uint ---
|
accessor_read_index :: proc(accessor: ^/*const*/accessor, index: uint) -> uint ---
|
||||||
|
|
||||||
num_components :: proc(type: type) -> uint ---
|
num_components :: proc(type: type) -> uint ---
|
||||||
@@ -699,7 +651,7 @@ foreign lib {
|
|||||||
copy_extras_json :: proc(data: ^data, extras: ^extras_t, dest: [^]byte, dest_size: ^uint) -> result ---
|
copy_extras_json :: proc(data: ^data, extras: ^extras_t, dest: [^]byte, dest_size: ^uint) -> result ---
|
||||||
|
|
||||||
|
|
||||||
write_file :: proc(options: ^/*const*/options, path: cstring, data: ^data) -> result ---
|
write_file :: proc(options: ^/*const*/options, path: cstring, data: ^data) -> result ---
|
||||||
write :: proc(options: ^/*const*/options, buffer: [^]byte, size: uint, data: ^data) -> uint ---
|
write :: proc(options: ^/*const*/options, buffer: [^]byte, size: uint, data: ^data) -> uint ---
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user