Grass rendering behing water fix

This commit is contained in:
@clasher113
2023-11-28 22:07:37 +02:00
parent 805f203f22
commit ff0e617732
4 changed files with 18 additions and 10 deletions
+7 -2
View File
@@ -18,22 +18,27 @@ void ContentBuilder::add(Block* def) {
Content* ContentBuilder::build() {
vector<Block*> blockDefsIndices;
DrawGroups* groups = new DrawGroups;
for (const string& name : blockIds) {
Block* def = blockDefs[name];
def->id = blockDefsIndices.size();
blockDefsIndices.push_back(def);
if (groups->find(def->drawGroup) == groups->end()) {
groups->insert(def->drawGroup);
}
}
ContentIndices* indices = new ContentIndices(blockDefsIndices);
return new Content(indices, blockDefs);
return new Content(indices, groups, blockDefs);
}
ContentIndices::ContentIndices(vector<Block*> blockDefs)
: blockDefs(blockDefs) {
}
Content::Content(ContentIndices* indices,
Content::Content(ContentIndices* indices, DrawGroups* drawGroups,
unordered_map<string, Block*> blockDefs)
: blockDefs(blockDefs),
drawGroups(drawGroups),
indices(indices) {
}