mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
use unsafe around creating new static sprites, no guarentee that it does it correctly though
This commit is contained in:
parent
b7448d714e
commit
7143621407
|
@ -257,62 +257,64 @@ fn handle_collision(
|
||||||
static CHICKEN_PALETTE: Palette16 =
|
static CHICKEN_PALETTE: Palette16 =
|
||||||
Palette16::new([0x7C1E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
Palette16::new([0x7C1E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||||
|
|
||||||
static CHICKEN_SPRITES: &[Sprite] = &[
|
static CHICKEN_SPRITES: &[Sprite] = unsafe {
|
||||||
Sprite::new(
|
&[
|
||||||
&CHICKEN_PALETTE,
|
Sprite::new(
|
||||||
&[
|
&CHICKEN_PALETTE,
|
||||||
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
&[
|
||||||
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
|
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
||||||
0x00, 0x10, 0x01, 0x00,
|
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
|
||||||
],
|
0x00, 0x10, 0x01, 0x00,
|
||||||
Size::S8x8,
|
],
|
||||||
),
|
Size::S8x8,
|
||||||
Sprite::new(
|
),
|
||||||
&CHICKEN_PALETTE,
|
Sprite::new(
|
||||||
&[
|
&CHICKEN_PALETTE,
|
||||||
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
&[
|
||||||
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x10, 0x00,
|
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
||||||
0x10, 0x00, 0x00, 0x00,
|
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x10, 0x00,
|
||||||
],
|
0x10, 0x00, 0x00, 0x00,
|
||||||
Size::S8x8,
|
],
|
||||||
),
|
Size::S8x8,
|
||||||
Sprite::new(
|
),
|
||||||
&CHICKEN_PALETTE,
|
Sprite::new(
|
||||||
&[
|
&CHICKEN_PALETTE,
|
||||||
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
&[
|
||||||
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x10, 0x01, 0x10, 0x00,
|
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
||||||
0x00, 0x00, 0x10, 0x00,
|
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x10, 0x01, 0x10, 0x00,
|
||||||
],
|
0x00, 0x00, 0x10, 0x00,
|
||||||
Size::S8x8,
|
],
|
||||||
),
|
Size::S8x8,
|
||||||
Sprite::new(
|
),
|
||||||
&CHICKEN_PALETTE,
|
Sprite::new(
|
||||||
&[
|
&CHICKEN_PALETTE,
|
||||||
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
&[
|
||||||
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00,
|
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x00, 0x10, 0x01, 0x10, 0x11,
|
||||||
0x00, 0x10, 0x00, 0x00,
|
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00,
|
||||||
],
|
0x00, 0x10, 0x00, 0x00,
|
||||||
Size::S8x8,
|
],
|
||||||
),
|
Size::S8x8,
|
||||||
Sprite::new(
|
),
|
||||||
&CHICKEN_PALETTE,
|
Sprite::new(
|
||||||
&[
|
&CHICKEN_PALETTE,
|
||||||
0x00, 0x00, 0x10, 0x01, 0x00, 0x11, 0x11, 0x11, 0x10, 0x10, 0x11, 0x01, 0x10, 0x11,
|
&[
|
||||||
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
|
0x00, 0x00, 0x10, 0x01, 0x00, 0x11, 0x11, 0x11, 0x10, 0x10, 0x11, 0x01, 0x10, 0x11,
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||||
],
|
0x00, 0x00, 0x00, 0x00,
|
||||||
Size::S8x8,
|
],
|
||||||
),
|
Size::S8x8,
|
||||||
Sprite::new(
|
),
|
||||||
&CHICKEN_PALETTE,
|
Sprite::new(
|
||||||
&[
|
&CHICKEN_PALETTE,
|
||||||
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x11, 0x11, 0x01, 0x10, 0x11,
|
&[
|
||||||
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
|
0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x11, 0x10, 0x11, 0x11, 0x01, 0x10, 0x11,
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x11, 0x01, 0x10, 0x11, 0x11, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||||
],
|
0x00, 0x00, 0x00, 0x00,
|
||||||
Size::S8x8,
|
],
|
||||||
),
|
Size::S8x8,
|
||||||
];
|
),
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
static MAP_TILES: [u8; 8 * 17 * 4] = [
|
static MAP_TILES: [u8; 8 * 17 * 4] = [
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
|
Loading…
Reference in a new issue