mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-04 23:32:54 +01:00
auto crop scratched flags
This commit is contained in:
1 file changed
+7
-5
@@ -1,5 +1,9 @@
|
|||||||
import type { APIContext, GetStaticPathsItem } from "astro";
|
import type { APIContext, GetStaticPathsItem } from "astro";
|
||||||
import { mixStaticPaths } from "../../../../../astro/mixStaticPaths";
|
import { mixStaticPaths } from "../../../../../astro/mixStaticPaths";
|
||||||
|
import {
|
||||||
|
readPackedSprite,
|
||||||
|
type PackedSpriteProps,
|
||||||
|
} from "../../../../../core/blitz/readSprite";
|
||||||
import { vfs } from "../../../../../core/blitzkit/vfs";
|
import { vfs } from "../../../../../core/blitzkit/vfs";
|
||||||
import { getStaticPaths as _getStaticPaths } from "../../../_index";
|
import { getStaticPaths as _getStaticPaths } from "../../../_index";
|
||||||
|
|
||||||
@@ -22,15 +26,13 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
|||||||
|
|
||||||
paths.push({
|
paths.push({
|
||||||
params: { nation },
|
params: { nation },
|
||||||
props: { path },
|
props: { packed: path },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function GET({ props }: APIContext<{ path: string }>) {
|
export async function GET({ props }: APIContext<PackedSpriteProps>) {
|
||||||
const bytes = new Uint8Array(await vfs.file(props.path));
|
return new Response(await readPackedSprite(props.packed));
|
||||||
|
|
||||||
return new Response(bytes);
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user