Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add imageIndex/levelIndex to getHasAlpha #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions webgl/transcoder/basis_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ struct basis_file
m_file.clear();
}

uint32_t getHasAlpha() {
uint32_t getHasAlpha(uint32_t imageIndex, uint32_t levelIndex) {
assert(m_magic == MAGIC);
if (m_magic != MAGIC)
return 0;

basisu_image_level_info li;
if (!m_transcoder.get_image_level_info(m_file.data(), m_file.size(), li, 0, 0))
if (!m_transcoder.get_image_level_info(m_file.data(), m_file.size(), li, imageIndex, levelIndex))
return 0;

return li.m_alpha_flag;
Expand Down Expand Up @@ -236,8 +236,8 @@ EMSCRIPTEN_BINDINGS(basis_transcoder) {
.function("close", optional_override([](basis_file& self) {
return self.close();
}))
.function("getHasAlpha", optional_override([](basis_file& self) {
return self.getHasAlpha();
.function("getHasAlpha", optional_override([](basis_file& self, uint32_t imageIndex, uint32_t levelIndex) {
return self.getHasAlpha(imageIndex, levelIndex);
}))
.function("getNumImages", optional_override([](basis_file& self) {
return self.getNumImages();
Expand Down
Binary file modified webgl/transcoder/build/basis_transcoder.wasm
Binary file not shown.