Skip to content

Commit

Permalink
feat(CutsceneLibrary): add block index accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Jan 4, 2024
1 parent bd95ac9 commit 54e83fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/zenkit-capi/CutsceneLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ ZKC_API ZkCutsceneLibrary* ZkCutsceneLibrary_loadPath(ZkString path);
ZKC_API ZkCutsceneLibrary* ZkCutsceneLibrary_loadVfs(ZkVfs const* vfs, ZkString string);
ZKC_API void ZkCutsceneLibrary_del(ZkCutsceneLibrary* slf);

ZKC_API ZkSize ZkCutsceneLibrary_getBlockCount(ZkCutsceneLibrary const* slf);
ZKC_API ZkCutsceneBlock const* ZkCutsceneLibrary_getBlock(ZkCutsceneLibrary const* slf, ZkString name);
ZKC_API ZkCutsceneBlock const* ZkCutsceneLibrary_getBlockByIndex(ZkCutsceneLibrary const* slf, ZkSize i);
ZKC_API void ZkCutsceneLibrary_enumerateBlocks(ZkCutsceneLibrary const* slf, ZkCutsceneBlockEnumerator cb, void* ctx);

ZKC_API ZkString ZkCutsceneBlock_getName(ZkCutsceneBlock const* slf);
Expand Down
13 changes: 13 additions & 0 deletions src/CutsceneLibrary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ ZKC_PATH_LOADER(ZkCutsceneLibrary);
ZKC_VFS_LOADER(ZkCutsceneLibrary);
ZKC_DELETER(ZkCutsceneLibrary);

ZkSize ZkCutsceneLibrary_getBlockCount(ZkCutsceneLibrary const* slf) {
ZKC_TRACE_FN();
ZKC_CHECK_NULL(slf);
return slf->blocks.size();
}

ZkCutsceneBlock const* ZkCutsceneLibrary_getBlockByIndex(ZkCutsceneLibrary const* slf, ZkSize i) {
ZKC_TRACE_FN();
ZKC_CHECK_NULL(slf);
ZKC_CHECK_LEN(slf->blocks, i);
return &slf->blocks[i];
}

ZkCutsceneBlock const* ZkCutsceneLibrary_getBlock(ZkCutsceneLibrary const* slf, ZkString name) {
ZKC_TRACE_FN();
ZKC_CHECK_NULL(slf);
Expand Down

0 comments on commit 54e83fe

Please sign in to comment.