added fragments
This commit is contained in:
parent
7c9f7b58db
commit
19a0312753
@ -5,9 +5,11 @@ import p.studio.compiler.workspaces.BuilderPipelineService;
|
|||||||
import p.studio.utilities.logs.LogAggregator;
|
import p.studio.utilities.logs.LogAggregator;
|
||||||
|
|
||||||
public class Compile {
|
public class Compile {
|
||||||
|
private static final String PROJECT = "fragments";
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final var logAggregator = LogAggregator.stdout();
|
final var logAggregator = LogAggregator.stdout();
|
||||||
final var config = new BuilderPipelineConfig(false, "test-projects/main");
|
final var config = new BuilderPipelineConfig(false, "test-projects/%s".formatted(PROJECT));
|
||||||
BuilderPipelineService.INSTANCE.run(config, logAggregator);
|
BuilderPipelineService.INSTANCE.run(config, logAggregator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,12 +8,14 @@ import p.packer.messages.PackerProjectContext;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
public final class PackMain {
|
public final class PackMain {
|
||||||
|
private static final String PROJECT = "fragments";
|
||||||
|
|
||||||
private PackMain() {
|
private PackMain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final Path projectRoot = args.length == 0
|
final Path projectRoot = args.length == 0
|
||||||
? Path.of("test-projects/main")
|
? Path.of("test-projects/%s".formatted(PROJECT))
|
||||||
: Path.of(args[0]);
|
: Path.of(args[0]);
|
||||||
final String projectId = projectRoot.getFileName() == null
|
final String projectId = projectRoot.getFileName() == null
|
||||||
? "project"
|
? "project"
|
||||||
|
|||||||
11
test-projects/fragments/.studio/activities.json
Normal file
11
test-projects/fragments/.studio/activities.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[ {
|
||||||
|
"source" : "Assets",
|
||||||
|
"message" : "0 assets loaded",
|
||||||
|
"severity" : "SUCCESS",
|
||||||
|
"sticky" : false
|
||||||
|
}, {
|
||||||
|
"source" : "Assets",
|
||||||
|
"message" : "Asset scan started",
|
||||||
|
"severity" : "INFO",
|
||||||
|
"sticky" : false
|
||||||
|
} ]
|
||||||
4
test-projects/fragments/assets/.prometeu/cache.json
Normal file
4
test-projects/fragments/assets/.prometeu/cache.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"schema_version" : 1,
|
||||||
|
"assets" : [ ]
|
||||||
|
}
|
||||||
5
test-projects/fragments/assets/.prometeu/index.json
Normal file
5
test-projects/fragments/assets/.prometeu/index.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"schema_version" : 1,
|
||||||
|
"next_asset_id" : 1,
|
||||||
|
"assets" : [ ]
|
||||||
|
}
|
||||||
BIN
test-projects/fragments/cartridge/assets.pa
Normal file
BIN
test-projects/fragments/cartridge/assets.pa
Normal file
Binary file not shown.
10
test-projects/fragments/cartridge/manifest.json
Normal file
10
test-projects/fragments/cartridge/manifest.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"magic": "PMTU",
|
||||||
|
"cartridge_version": 1,
|
||||||
|
"app_id": 1,
|
||||||
|
"title": "Fragments",
|
||||||
|
"app_version": "0.1.0",
|
||||||
|
"app_mode": "Game",
|
||||||
|
"entrypoint": "0",
|
||||||
|
"capabilities": ["log", "gfx", "asset"]
|
||||||
|
}
|
||||||
BIN
test-projects/fragments/cartridge/program.pbx
Normal file
BIN
test-projects/fragments/cartridge/program.pbx
Normal file
Binary file not shown.
8
test-projects/fragments/prometeu.json
Normal file
8
test-projects/fragments/prometeu.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "fragments",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"language": "pbs",
|
||||||
|
"stdlib": "1",
|
||||||
|
"dependencies": [
|
||||||
|
]
|
||||||
|
}
|
||||||
7
test-projects/fragments/run.sh
Executable file
7
test-projects/fragments/run.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cp build/assets.pa cartridge
|
||||||
|
cp build/program.pbx cartridge
|
||||||
|
./runtime/prometeu run cartridge
|
||||||
1
test-projects/fragments/runtime
Symbolic link
1
test-projects/fragments/runtime
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../runtime/dist-staging/stable/prometeu-cli-aarch64-apple-darwin/
|
||||||
64
test-projects/fragments/src/main.pbs
Normal file
64
test-projects/fragments/src/main.pbs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import { Color } from @core:color;
|
||||||
|
import { Gfx } from @sdk:gfx;
|
||||||
|
|
||||||
|
declare global ticks: int = 0;
|
||||||
|
declare const SCREEN_W: int = 320;
|
||||||
|
declare const SCREEN_H: int = 180;
|
||||||
|
declare const CELL: int = 4;
|
||||||
|
|
||||||
|
[Init]
|
||||||
|
fn init() -> void
|
||||||
|
{
|
||||||
|
ticks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Frame]
|
||||||
|
fn frame() -> void
|
||||||
|
{
|
||||||
|
ticks += 1;
|
||||||
|
Gfx.fill_rect(0, 0, SCREEN_W, CELL, new Color((ticks * 97 + 500) % 65535));
|
||||||
|
Gfx.fill_rect(0, 4, SCREEN_W, CELL, new Color((ticks * 110 + 1200) % 65535));
|
||||||
|
Gfx.fill_rect(0, 8, SCREEN_W, CELL, new Color((ticks * 123 + 1900) % 65535));
|
||||||
|
Gfx.fill_rect(0, 12, SCREEN_W, CELL, new Color((ticks * 136 + 2600) % 65535));
|
||||||
|
Gfx.fill_rect(0, 16, SCREEN_W, CELL, new Color((ticks * 149 + 3300) % 65535));
|
||||||
|
Gfx.fill_rect(0, 20, SCREEN_W, CELL, new Color((ticks * 162 + 4000) % 65535));
|
||||||
|
Gfx.fill_rect(0, 24, SCREEN_W, CELL, new Color((ticks * 175 + 4700) % 65535));
|
||||||
|
Gfx.fill_rect(0, 28, SCREEN_W, CELL, new Color((ticks * 188 + 5400) % 65535));
|
||||||
|
Gfx.fill_rect(0, 32, SCREEN_W, CELL, new Color((ticks * 201 + 6100) % 65535));
|
||||||
|
Gfx.fill_rect(0, 36, SCREEN_W, CELL, new Color((ticks * 214 + 6800) % 65535));
|
||||||
|
Gfx.fill_rect(0, 40, SCREEN_W, CELL, new Color((ticks * 227 + 7500) % 65535));
|
||||||
|
Gfx.fill_rect(0, 44, SCREEN_W, CELL, new Color((ticks * 240 + 8200) % 65535));
|
||||||
|
Gfx.fill_rect(0, 48, SCREEN_W, CELL, new Color((ticks * 253 + 8900) % 65535));
|
||||||
|
Gfx.fill_rect(0, 52, SCREEN_W, CELL, new Color((ticks * 266 + 9600) % 65535));
|
||||||
|
Gfx.fill_rect(0, 56, SCREEN_W, CELL, new Color((ticks * 279 + 10300) % 65535));
|
||||||
|
Gfx.fill_rect(0, 60, SCREEN_W, CELL, new Color((ticks * 292 + 11000) % 65535));
|
||||||
|
Gfx.fill_rect(0, 64, SCREEN_W, CELL, new Color((ticks * 305 + 11700) % 65535));
|
||||||
|
Gfx.fill_rect(0, 68, SCREEN_W, CELL, new Color((ticks * 318 + 12400) % 65535));
|
||||||
|
Gfx.fill_rect(0, 72, SCREEN_W, CELL, new Color((ticks * 331 + 13100) % 65535));
|
||||||
|
Gfx.fill_rect(0, 76, SCREEN_W, CELL, new Color((ticks * 344 + 13800) % 65535));
|
||||||
|
Gfx.fill_rect(0, 80, SCREEN_W, CELL, new Color((ticks * 357 + 14500) % 65535));
|
||||||
|
Gfx.fill_rect(0, 84, SCREEN_W, CELL, new Color((ticks * 370 + 15200) % 65535));
|
||||||
|
Gfx.fill_rect(0, 88, SCREEN_W, CELL, new Color((ticks * 383 + 15900) % 65535));
|
||||||
|
Gfx.fill_rect(0, 92, SCREEN_W, CELL, new Color((ticks * 396 + 16600) % 65535));
|
||||||
|
Gfx.fill_rect(0, 96, SCREEN_W, CELL, new Color((ticks * 409 + 17300) % 65535));
|
||||||
|
Gfx.fill_rect(0, 100, SCREEN_W, CELL, new Color((ticks * 422 + 18000) % 65535));
|
||||||
|
Gfx.fill_rect(0, 104, SCREEN_W, CELL, new Color((ticks * 435 + 18700) % 65535));
|
||||||
|
Gfx.fill_rect(0, 108, SCREEN_W, CELL, new Color((ticks * 448 + 19400) % 65535));
|
||||||
|
Gfx.fill_rect(0, 112, SCREEN_W, CELL, new Color((ticks * 461 + 20100) % 65535));
|
||||||
|
Gfx.fill_rect(0, 116, SCREEN_W, CELL, new Color((ticks * 474 + 20800) % 65535));
|
||||||
|
Gfx.fill_rect(0, 120, SCREEN_W, CELL, new Color((ticks * 487 + 21500) % 65535));
|
||||||
|
Gfx.fill_rect(0, 124, SCREEN_W, CELL, new Color((ticks * 500 + 22200) % 65535));
|
||||||
|
Gfx.fill_rect(0, 128, SCREEN_W, CELL, new Color((ticks * 513 + 22900) % 65535));
|
||||||
|
Gfx.fill_rect(0, 132, SCREEN_W, CELL, new Color((ticks * 526 + 23600) % 65535));
|
||||||
|
Gfx.fill_rect(0, 136, SCREEN_W, CELL, new Color((ticks * 539 + 24300) % 65535));
|
||||||
|
Gfx.fill_rect(0, 140, SCREEN_W, CELL, new Color((ticks * 552 + 25000) % 65535));
|
||||||
|
Gfx.fill_rect(0, 144, SCREEN_W, CELL, new Color((ticks * 565 + 25700) % 65535));
|
||||||
|
Gfx.fill_rect(0, 148, SCREEN_W, CELL, new Color((ticks * 578 + 26400) % 65535));
|
||||||
|
Gfx.fill_rect(0, 152, SCREEN_W, CELL, new Color((ticks * 591 + 27100) % 65535));
|
||||||
|
Gfx.fill_rect(0, 156, SCREEN_W, CELL, new Color((ticks * 604 + 27800) % 65535));
|
||||||
|
Gfx.fill_rect(0, 160, SCREEN_W, CELL, new Color((ticks * 617 + 28500) % 65535));
|
||||||
|
Gfx.fill_rect(0, 164, SCREEN_W, CELL, new Color((ticks * 630 + 29200) % 65535));
|
||||||
|
Gfx.fill_rect(0, 168, SCREEN_W, CELL, new Color((ticks * 643 + 29900) % 65535));
|
||||||
|
Gfx.fill_rect(0, 172, SCREEN_W, CELL, new Color((ticks * 656 + 30600) % 65535));
|
||||||
|
Gfx.fill_rect(0, 176, SCREEN_W, CELL, new Color((ticks * 669 + 31300) % 65535));
|
||||||
|
}
|
||||||
1
test-projects/fragments/src/mod.barrel
Normal file
1
test-projects/fragments/src/mod.barrel
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub fn frame() -> void;
|
||||||
Loading…
x
Reference in New Issue
Block a user