mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
feat: different textures/atlases support
This commit is contained in:
parent
27dd8f6375
commit
b0ecfd5add
3 changed files with 110 additions and 44 deletions
|
|
@ -40,11 +40,17 @@ static int l_set_faces(lua::State* L) {
|
|||
if (auto wrapper = renderer->blockWraps->get(lua::tointeger(L, 1))) {
|
||||
for (int i = 0; i < wrapper->textureFaces.size(); i++) {
|
||||
if (lua::isnil(L, 2 + i)) {
|
||||
wrapper->cullingBits &= ~(1 << i);
|
||||
wrapper->textureFaces[i] = "";
|
||||
if (wrapper->cullingBits & (1 << i)) {
|
||||
wrapper->cullingBits &= ~(1 << i);
|
||||
wrapper->textureFaces[i] = "";
|
||||
wrapper->dirtySides |= (1 << i);
|
||||
}
|
||||
} else {
|
||||
wrapper->cullingBits |= (1 << i);
|
||||
wrapper->textureFaces[i] = lua::require_string(L, 2 + i);
|
||||
auto texture = lua::require_string(L, 2 + i);;
|
||||
if ((wrapper->cullingBits & (1 << i)) == 0x0 || wrapper->textureFaces[i] != texture) {
|
||||
wrapper->cullingBits |= (1 << i);
|
||||
wrapper->textureFaces[i] = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue