DITZRHVHIYQHZ3HV3VWSRZLAAK4S6NJG33VPHNQ62WCHU46R7RTQC
KE43WJL7CXLEZN2PR4IYFP3DURRUSIHDMSRSYKS2PYF2QLKOLXKQC
3AJMKZ7CFKK7S6H3I6LCFRSTGCBNJJGOYFIT2WHQKZRI6CMEHSTQC
E742MTJAS6KZGXIFVCZMKREGQK34LA45VBIT4E7ODBL7J64FKJFAC
6AXPZL5PQMW5P6BPRTGWO3AOWAU5OC33UYBY3TVOHUVQXCRVVTPQC
5AMZXFS5GBD6DS64Q5RTY55U7LQDMDW776UHZK4HQPPXWSMO3MAQC
ABITXOUUKIF3XVFXVOQ5YI7N43TS5OEVNEFUQ5Q7J4QEILFG3IPAC
fn c_sdl_create_rgb_surface(flags: u32, width: u32, height: u32, depth: u32, r_mask: u32, g_mask: u32, b_mask: u32, a_mask: u32) -> *mut SDLSurface;
fn c_sdl_create_rgb_surface(
flags: u32,
width: u32,
height: u32,
depth: u32,
r_mask: u32,
g_mask: u32,
b_mask: u32,
a_mask: u32,
) -> *mut SDLSurface;
let pitch = unsafe {
(*surface).pitch as usize / 4
};
let data = unsafe {
std::slice::from_raw_parts(data, width * height * channels)
};
let pixels: &mut [u32] = unsafe {
std::slice::from_raw_parts_mut((*surface).pixels.cast(), height * pitch)
};
let format = unsafe {
(*surface).format.as_ref().unwrap()
};
for y in 0 .. height {
let pitch = unsafe { (*surface).pitch as usize / 4 };
let data = unsafe { std::slice::from_raw_parts(data, width * height * channels) };
let pixels: &mut [u32] =
unsafe { std::slice::from_raw_parts_mut((*surface).pixels.cast(), height * pitch) };
let format = unsafe { (*surface).format.as_ref().unwrap() };
for y in 0..height {
let target = unsafe {
std::slice::from_raw_parts_mut(target, (width as usize) * (height as usize) * 3)
};
for y in 0 .. (height as usize) {
let target =
unsafe { std::slice::from_raw_parts_mut(target, (width as usize) * (height as usize) * 3) };
for y in 0..(height as usize) {
pub extern "C" fn colourize_heightmap(target: *mut f64, source: *const f64, width: u32, height: u32) {
let target = unsafe {
std::slice::from_raw_parts_mut(target, (width as usize) * (height as usize) * 3)
};
let source = unsafe {
std::slice::from_raw_parts(source, (width as usize) * (height as usize))
};
for y in 0 .. (height as usize) {
pub extern "C" fn colourize_heightmap(
target: *mut f64,
source: *const f64,
width: u32,
height: u32,
) {
let target =
unsafe { std::slice::from_raw_parts_mut(target, (width as usize) * (height as usize) * 3) };
let source =
unsafe { std::slice::from_raw_parts(source, (width as usize) * (height as usize)) };
for y in 0..(height as usize) {
for (x, y) in [(x - 1, y - 1), (x, y - 1), (x + 1, y - 1), (x + 1, y), (x + 1, y + 1), (x, y + 1), (x - 1, y + 1), (x - 1, y)].iter() {
for (x, y) in [
(x - 1, y - 1),
(x, y - 1),
(x + 1, y - 1),
(x + 1, y),
(x + 1, y + 1),
(x, y + 1),
(x - 1, y + 1),
(x - 1, y),
]
.iter()
{