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 { mixStaticPaths } from "../../../../../astro/mixStaticPaths";
|
||||
import {
|
||||
readPackedSprite,
|
||||
type PackedSpriteProps,
|
||||
} from "../../../../../core/blitz/readSprite";
|
||||
import { vfs } from "../../../../../core/blitzkit/vfs";
|
||||
import { getStaticPaths as _getStaticPaths } from "../../../_index";
|
||||
|
||||
@@ -22,15 +26,13 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
|
||||
paths.push({
|
||||
params: { nation },
|
||||
props: { path },
|
||||
props: { packed: path },
|
||||
});
|
||||
}
|
||||
|
||||
return paths;
|
||||
});
|
||||
|
||||
export async function GET({ props }: APIContext<{ path: string }>) {
|
||||
const bytes = new Uint8Array(await vfs.file(props.path));
|
||||
|
||||
return new Response(bytes);
|
||||
export async function GET({ props }: APIContext<PackedSpriteProps>) {
|
||||
return new Response(await readPackedSprite(props.packed));
|
||||
}
|
||||
Reference in new issue
Block a user