implements PLN-0055

This commit is contained in:
bQUARKz 2026-04-18 17:04:35 +01:00
parent a17dfde481
commit 1e99553d94
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8
2 changed files with 8 additions and 7 deletions

View File

@ -55,10 +55,10 @@ final class LspServiceImplTest {
"""; """;
private static final String SDK_IMPORT_SOURCE = """ private static final String SDK_IMPORT_SOURCE = """
import { Gfx } from @sdk:gfx; import { Composer } from @sdk:composer;
fn main() -> void { fn main() -> void {
Gfx.clear(); Composer.emit_sprite(1, 0, 0, 0, 0, 0, false, false, 0);
} }
"""; """;
@ -180,7 +180,7 @@ final class LspServiceImplTest {
final var analysis = service.analyzeDocument(new LspAnalyzeDocumentRequest(mainFile)); final var analysis = service.analyzeDocument(new LspAnalyzeDocumentRequest(mainFile));
assertEquals(List.of("pbs-service", "pbs-service"), semanticKeysForLexeme(analysis, SDK_IMPORT_SOURCE, "Gfx")); assertEquals(List.of("pbs-service", "pbs-service"), semanticKeysForLexeme(analysis, SDK_IMPORT_SOURCE, "Composer"));
} }
@Test @Test

View File

@ -2,6 +2,7 @@ import { Color } from @core:color;
import { Log } from @sdk:log; import { Log } from @sdk:log;
import { Input } from @sdk:input; import { Input } from @sdk:input;
import { Composer } from @sdk:composer;
import { Gfx } from @sdk:gfx; import { Gfx } from @sdk:gfx;
import { Assets } from @sdk:asset; import { Assets } from @sdk:asset;
@ -41,9 +42,9 @@ fn frame() -> void
Log.failure("commit failed"); Log.failure("commit failed");
} }
} else if (s == 3) { } else if (s == 3) {
let sprite_status : int = Gfx.set_sprite(3, 10, 150, 150, 0, 0, true, false, false, 1); let sprite_status : int = Composer.emit_sprite(0, 0, 150, 150, 1, 3, false, false, 1);
if (sprite_status != 0) { if (sprite_status != 0) {
Log.failure("set_sprite failed"); Log.failure("emit_sprite failed");
} }
} else { } else {
Log.info("state: waiting"); Log.info("state: waiting");
@ -74,8 +75,8 @@ fn frame() -> void
} }
} }
Gfx.set_sprite(0, 0, touch.x() - 16, touch.y() + 8, tile_id, 0, true, true, false, 0); Composer.emit_sprite(tile_id, 0, touch.x() - 16, touch.y() + 8, 0, 0, true, false, 0);
Gfx.set_sprite(0, 1, touch.x() + 16, touch.y() + 8, tile_id, 0, true, false, false, 0); Composer.emit_sprite(tile_id, 0, touch.x() + 16, touch.y() + 8, 0, 1, false, false, 0);
let a : int = 10; let a : int = 10;
let b : int = 15; let b : int = 15;