Merge branch 'main' of https://github.com/MihailRis/VoxelEngine-Cpp
This commit is contained in:
@@ -44,6 +44,8 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
||||
def.rt.hitboxes[i].push_back(aabb);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
def.rt.hitboxes->emplace_back(AABB(glm::vec3(1.0f)));
|
||||
}
|
||||
|
||||
blockDefsIndices.push_back(&def);
|
||||
|
||||
@@ -326,6 +326,7 @@ void ContentLoader::loadBlock(
|
||||
root.at("ui-layout").get(def.uiLayout);
|
||||
root.at("inventory-size").get(def.inventorySize);
|
||||
root.at("tick-interval").get(def.tickInterval);
|
||||
root.at("overlay-texture").get(def.overlayTexture);
|
||||
|
||||
if (root.has("fields")) {
|
||||
def.dataStruct = std::make_unique<StructLayout>();
|
||||
@@ -418,17 +419,18 @@ void ContentLoader::loadItem(
|
||||
std::string iconTypeStr = "";
|
||||
root.at("icon-type").get(iconTypeStr);
|
||||
if (iconTypeStr == "none") {
|
||||
def.iconType = item_icon_type::none;
|
||||
def.iconType = ItemIconType::NONE;
|
||||
} else if (iconTypeStr == "block") {
|
||||
def.iconType = item_icon_type::block;
|
||||
def.iconType = ItemIconType::BLOCK;
|
||||
} else if (iconTypeStr == "sprite") {
|
||||
def.iconType = item_icon_type::sprite;
|
||||
def.iconType = ItemIconType::SPRITE;
|
||||
} else if (iconTypeStr.length()) {
|
||||
logger.error() << name << ": unknown icon type" << iconTypeStr;
|
||||
}
|
||||
root.at("icon").get(def.icon);
|
||||
root.at("placing-block").get(def.placingBlock);
|
||||
root.at("script-name").get(def.scriptName);
|
||||
root.at("model-name").get(def.modelName);
|
||||
root.at("stack-size").get(def.stackSize);
|
||||
|
||||
// item light emission [r, g, b] where r,g,b in range [0..15]
|
||||
@@ -532,7 +534,7 @@ void ContentLoader::loadBlock(
|
||||
auto& item = builder.items.create(full + BLOCK_ITEM_SUFFIX);
|
||||
item.generated = true;
|
||||
item.caption = def.caption;
|
||||
item.iconType = item_icon_type::block;
|
||||
item.iconType = ItemIconType::BLOCK;
|
||||
item.icon = full;
|
||||
item.placingBlock = full;
|
||||
|
||||
|
||||
@@ -202,6 +202,16 @@ void ContentLoader::loadGenerator(
|
||||
map.at("biome-parameters").get(def.biomeParameters);
|
||||
map.at("biome-bpd").get(def.biomesBPD);
|
||||
map.at("heights-bpd").get(def.heightsBPD);
|
||||
std::string interpName;
|
||||
map.at("heights-interpolation").get(interpName);
|
||||
if (auto interp = InterpolationType_from(interpName)) {
|
||||
def.heightsInterpolation = *interp;
|
||||
}
|
||||
map.at("biomes-interpolation").get(interpName);
|
||||
if (auto interp = InterpolationType_from(interpName)) {
|
||||
def.biomesInterpolation = *interp;
|
||||
}
|
||||
|
||||
map.at("sea-level").get(def.seaLevel);
|
||||
map.at("wide-structs-chunks-radius").get(def.wideStructsChunksRadius);
|
||||
if (map.has("heightmap-inputs")) {
|
||||
|
||||
Reference in New Issue
Block a user