We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e23b1da commit 43aac14Copy full SHA for 43aac14
src/aero_kernel/src/rendy.rs
@@ -371,13 +371,9 @@ impl<'a> Inner<'a> {
371
let mut img_x = ratio * xstart;
372
373
for x in xstart..xend {
374
- let img_pixel = unsafe {
375
- (image.image.as_ptr())
376
- .add(fixedp6_to_int(img_x) * col_size + off)
377
- .cast::<u32>()
378
- };
379
-
380
- let i = blender(x, y, unsafe { *img_pixel });
+ let offset = fixedp6_to_int(img_x) * col_size + off;
+ let img_pixel: [u8; 4] = unsafe { *image.image.as_ptr().add(offset).cast() };
+ let i = blender(x, y, u32::from_le_bytes(img_pixel));
381
382
unsafe {
383
*self.buffer.as_mut_ptr().add(fb_off + x) = i as u32;
0 commit comments