mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
refactor Content
This commit is contained in:
parent
f3c5afa1ab
commit
ee9f1639e9
25 changed files with 180 additions and 209 deletions
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) : content(content) {
|
||||
auto indices = content->getIndices();
|
||||
sideregions = std::make_unique<UVRegion[]>(indices->countBlockDefs() * 6);
|
||||
sideregions = std::make_unique<UVRegion[]>(indices->blocks.count() * 6);
|
||||
auto atlas = assets->get<Atlas>("blocks");
|
||||
|
||||
for (uint i = 0; i < indices->countBlockDefs(); i++) {
|
||||
Block* def = indices->getBlockDef(i);
|
||||
for (uint i = 0; i < indices->blocks.count(); i++) {
|
||||
Block* def = indices->blocks.get(i);
|
||||
for (uint side = 0; side < 6; side++) {
|
||||
const std::string& tex = def->textureFaces[side];
|
||||
if (atlas->has(tex)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue