the big refactor + extracted data classes from coders/json to data/dynamic

This commit is contained in:
MihailRis
2024-01-17 16:32:53 +03:00
parent 34d4500e24
commit 377c8e5029
36 changed files with 908 additions and 875 deletions
+4 -4
View File
@@ -8,12 +8,12 @@
#include "../voxels/Block.h"
ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) {
const ContentIndices* contentIds = content->indices;
sideregions = new UVRegion[contentIds->countBlockDefs() * 6];
auto indices = content->getIndices();
sideregions = new UVRegion[indices->countBlockDefs() * 6];
Atlas* atlas = assets->getAtlas("blocks");
for (uint i = 0; i < contentIds->countBlockDefs(); i++) {
Block* def = contentIds->getBlockDef(i);
for (uint i = 0; i < indices->countBlockDefs(); i++) {
Block* def = indices->getBlockDef(i);
for (uint side = 0; side < 6; side++) {
std::string tex = def->textureFaces[side];
if (atlas->has(tex)) {