INNER CODE UNIT · Rust

sprite

elringus/sprite-dicing · crates/abi/src/lib.rs:297

    fn sprite(id: &CStr, pixels: &[sd_pixel], width: u32, height: u32) -> sd_source_sprite {
        sd_source_sprite {
            id: id.as_ptr(),
            texture: sd_texture {
                width,
                height,
                pixels: pixels.as_ptr(),
            },
            has_pivot: false,
            pivot: sd_pivot { x: 0.0, y: 0.0 },
        }
    }

    fn dice(sprites: &[sd_source_sprite], prefs: &sd_prefs) -> sd_result {
        unsafe { sd_dice(sprites.as_ptr(), sprites.len(), prefs) }
    }

    fn error(result: &sd_result) -> Option<String> {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…