dev/studio-frame-composer-syscall-and-sprite-alignment #5
@ -55,10 +55,10 @@ final class LspServiceImplTest {
|
||||
""";
|
||||
|
||||
private static final String SDK_IMPORT_SOURCE = """
|
||||
import { Gfx } from @sdk:gfx;
|
||||
import { Composer } from @sdk:composer;
|
||||
|
||||
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));
|
||||
|
||||
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
|
||||
|
||||
@ -2,6 +2,7 @@ import { Color } from @core:color;
|
||||
|
||||
import { Log } from @sdk:log;
|
||||
import { Input } from @sdk:input;
|
||||
import { Composer } from @sdk:composer;
|
||||
import { Gfx } from @sdk:gfx;
|
||||
import { Assets } from @sdk:asset;
|
||||
|
||||
@ -41,9 +42,9 @@ fn frame() -> void
|
||||
Log.failure("commit failed");
|
||||
}
|
||||
} 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) {
|
||||
Log.failure("set_sprite failed");
|
||||
Log.failure("emit_sprite failed");
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
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, 0, true, false, 0);
|
||||
Composer.emit_sprite(tile_id, 0, touch.x() + 16, touch.y() + 8, 0, 1, false, false, 0);
|
||||
|
||||
let a : int = 10;
|
||||
let b : int = 15;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user