tileset: initial GPU texture atlas w/ procedural sprite painting
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7b6991f7342362033ad72ab4700fdb9f6a6a6964
This commit is contained in:
parent
e00424a918
commit
ceb657add8
5 changed files with 1171 additions and 0 deletions
23
build.zig
23
build.zig
|
|
@ -49,6 +49,28 @@ pub fn build(b: *std.Build) void {
|
|||
// utils.h is co-located with map.c
|
||||
map_lib.addIncludePath(b.path("libs/map"));
|
||||
|
||||
// Tileset library
|
||||
const tileset_obj = b.addObject(.{
|
||||
.name = "tileset",
|
||||
.root_module = b.createModule(.{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.link_libc = true,
|
||||
}),
|
||||
});
|
||||
tileset_obj.addCSourceFiles(.{
|
||||
.files = &[_][]const u8{
|
||||
"libs/tileset/tileset.c",
|
||||
"libs/tileset/tileset_paint.c",
|
||||
},
|
||||
.flags = &c_flags,
|
||||
});
|
||||
// tileset.h includes settings.h which lives in src/
|
||||
tileset_obj.addIncludePath(b.path("src"));
|
||||
// tileset.c includes tileset.h which is co-located
|
||||
tileset_obj.addIncludePath(b.path("libs/tileset"));
|
||||
tileset_obj.linkSystemLibrary("raylib");
|
||||
|
||||
// Zig combat library. This must be compiled as an object and linked
|
||||
// directly to bypassing the archive step, or it yields a corrupt
|
||||
// archive that forces the user to clear the cache each time.
|
||||
|
|
@ -98,6 +120,7 @@ pub fn build(b: *std.Build) void {
|
|||
|
||||
exe.linkLibrary(rng_lib);
|
||||
exe.linkLibrary(map_lib);
|
||||
exe.addObject(tileset_obj);
|
||||
exe.addObject(combat_obj);
|
||||
exe.linkSystemLibrary("raylib");
|
||||
exe.linkSystemLibrary("m");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue