(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64)
| 1107 | } |
| 1108 | #[no_mangle] |
| 1109 | pub extern "C" fn bloom_draw_model(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64) { |
| 1110 | let eng = engine(); |
| 1111 | if let Some(model) = eng.models.get(handle) { |
| 1112 | let tint = [(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32]; |
| 1113 | let position = [x as f32, y as f32, z as f32]; |
| 1114 | let handle_bits = handle.to_bits(); |
| 1115 | if eng.renderer.cache_model_if_static(handle_bits, &model.meshes) { |
| 1116 | eng.renderer.draw_model_cached(handle_bits, position, scale as f32, tint); |
| 1117 | } else { |
| 1118 | for mesh in &model.meshes { |
| 1119 | let tex_idx = mesh.texture_idx.unwrap_or(0); |
| 1120 | eng.renderer.draw_model_mesh_tinted(&mesh.vertices, &mesh.indices, position, scale as f32, tint, tex_idx); |
| 1121 | } |
| 1122 | } |
| 1123 | } |
| 1124 | } |
| 1125 | #[no_mangle] |
| 1126 | pub extern "C" fn bloom_draw_model_rotated( |
| 1127 | handle: f64, x: f64, y: f64, z: f64, |
nothing calls this directly
no test coverage detected