Load spritesheet
This commit is contained in:
20
game/BUILD
20
game/BUILD
@ -1,7 +1,23 @@
|
||||
load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
|
||||
|
||||
cc_library(
|
||||
name = "game",
|
||||
srcs = glob(["*.c"]),
|
||||
hdrs = glob(["*.h"]),
|
||||
srcs = glob(["*.c"]) + [":art/game_demo_sprites.c"],
|
||||
hdrs = glob(["*.h"]) + [":art/game_demo_sprites.h"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//device:device", "//sys:sys"]
|
||||
)
|
||||
|
||||
run_binary(
|
||||
name = "game_demo_sprites",
|
||||
args = [
|
||||
"game_demo_sprites",
|
||||
"256", # n sprites
|
||||
"0", # key color
|
||||
"$(location :art/game_demo_sprites.png)",
|
||||
"$(location :art/game_demo_sprites.c)"
|
||||
],
|
||||
srcs = [":art/game_demo_sprites.png"],
|
||||
outs = [":art/game_demo_sprites.c"],
|
||||
tool = "//pytools:spritesheet",
|
||||
)
|
8
game/art/game_demo_sprites.h
Normal file
8
game/art/game_demo_sprites.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef CROCPARTY_GAME_DEMO_SPRITES_H
|
||||
#define CROCPARTY_GAME_DEMO_SPRITES_H
|
||||
|
||||
#include "sys/sys.h"
|
||||
|
||||
sys_sprite game_demo_sprites[256];
|
||||
|
||||
#endif // CROCPARTY_GAME_DEMO_SPRITES_H
|
BIN
game/art/game_demo_sprites.png
Normal file
BIN
game/art/game_demo_sprites.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Reference in New Issue
Block a user