Skip to content

Commit

Permalink
refactor(libs.w4): use sr instead of str
Browse files Browse the repository at this point in the history
  • Loading branch information
JaDogg committed Apr 27, 2024
1 parent 2aca641 commit b95cb3a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions compiler/libs/w4.yaka
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ def rect(x: int, y: int, width: u32, height: u32) -> None:
pass

@native
def text(text_data: str, x: int, y: int) -> None:
def text(text_data: sr, x: int, y: int) -> None:
# Draws text using the built-in system font
ccode """text(nn__text_data, nn__x, nn__y);
yk__sdsfree(nn__text_data)"""
ccode """text(yk__bstr_get_reference(nn__text_data), nn__x, nn__y)"""

@native
def text_u8(text_data: Ptr[Const[u8]], x: int, y: int) -> None:
Expand Down Expand Up @@ -175,10 +174,9 @@ def diskw(src: AnyPtrToConst, size: u32) -> u32:
pass

@native
def trace(text_data: str) -> None:
def trace(text_data: sr) -> None:
# Prints a message to the debug console
ccode """trace(nn__text_data);
yk__sdsfree(nn__text_data)"""
ccode """trace(yk__bstr_get_reference(nn__text_data))"""

@native
def trace_u8(text_data: Ptr[Const[u8]]) -> None:
Expand Down

0 comments on commit b95cb3a

Please sign in to comment.