Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions function.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn blit(
height : Int,
flags : BlitFlag,
) -> Unit {
blit_ffi(get_addr(self.inner()), x, y, width, height, flags.to_int())
blit_ffi(get_addr(self.0), x, y, width, height, flags.to_int())
ignore(self)
}

Expand All @@ -77,7 +77,7 @@ pub fn blit_sub(
flags : BlitFlag,
) -> Unit {
blit_sub_ffi(
get_addr(self.inner()),
get_addr(self.0),
x,
y,
width,
Expand Down
5 changes: 2 additions & 3 deletions memory.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct Color(UInt)

///|
pub fn rgb(color : UInt) -> Color {
color
Color(color)
}

///| Sets the color of the palette at the given index.
Expand All @@ -26,12 +26,11 @@ pub fn rgb(color : UInt) -> Color {
/// @param color the color to set
pub fn set_palette(index : UInt, color : Color) -> Unit {
if index == 0 || index > 4 {
trace("Palette index out of range")
panic()
}
store_i32(
address_PALETTE + (index.reinterpret_as_int() - 1) * 4,
color.inner().reinterpret_as_int(),
color.0.reinterpret_as_int(),
)
}

Expand Down