refactor
This commit is contained in:
+8
-8
@@ -11,9 +11,9 @@
|
||||
#include "voxels/Block.hpp"
|
||||
|
||||
// All in-game definitions (blocks, items, etc..)
|
||||
void corecontent::setup(EnginePaths* paths, ContentBuilder* builder) {
|
||||
void corecontent::setup(const EnginePaths& paths, ContentBuilder& builder) {
|
||||
{
|
||||
Block& block = builder->blocks.create(CORE_AIR);
|
||||
Block& block = builder.blocks.create(CORE_AIR);
|
||||
block.replaceable = true;
|
||||
block.drawGroup = 1;
|
||||
block.lightPassing = true;
|
||||
@@ -24,11 +24,11 @@ void corecontent::setup(EnginePaths* paths, ContentBuilder* builder) {
|
||||
block.pickingItem = CORE_EMPTY;
|
||||
}
|
||||
{
|
||||
ItemDef& item = builder->items.create(CORE_EMPTY);
|
||||
ItemDef& item = builder.items.create(CORE_EMPTY);
|
||||
item.iconType = ItemIconType::NONE;
|
||||
}
|
||||
|
||||
auto bindsFile = paths->getResourcesFolder()/fs::path("bindings.toml");
|
||||
auto bindsFile = paths.getResourcesFolder()/fs::path("bindings.toml");
|
||||
if (fs::is_regular_file(bindsFile)) {
|
||||
Events::loadBindings(
|
||||
bindsFile.u8string(), files::read_string(bindsFile), BindType::BIND
|
||||
@@ -36,20 +36,20 @@ void corecontent::setup(EnginePaths* paths, ContentBuilder* builder) {
|
||||
}
|
||||
|
||||
{
|
||||
Block& block = builder->blocks.create(CORE_OBSTACLE);
|
||||
Block& block = builder.blocks.create(CORE_OBSTACLE);
|
||||
for (uint i = 0; i < 6; i++) {
|
||||
block.textureFaces[i] = "obstacle";
|
||||
}
|
||||
block.hitboxes = {AABB()};
|
||||
block.breakable = false;
|
||||
ItemDef& item = builder->items.create(CORE_OBSTACLE+".item");
|
||||
ItemDef& item = builder.items.create(CORE_OBSTACLE+".item");
|
||||
item.iconType = ItemIconType::BLOCK;
|
||||
item.icon = CORE_OBSTACLE;
|
||||
item.placingBlock = CORE_OBSTACLE;
|
||||
item.caption = block.caption;
|
||||
}
|
||||
{
|
||||
Block& block = builder->blocks.create(CORE_STRUCT_AIR);
|
||||
Block& block = builder.blocks.create(CORE_STRUCT_AIR);
|
||||
for (uint i = 0; i < 6; i++) {
|
||||
block.textureFaces[i] = "struct_air";
|
||||
}
|
||||
@@ -58,7 +58,7 @@ void corecontent::setup(EnginePaths* paths, ContentBuilder* builder) {
|
||||
block.lightPassing = true;
|
||||
block.hitboxes = {AABB()};
|
||||
block.obstacle = false;
|
||||
ItemDef& item = builder->items.create(CORE_STRUCT_AIR+".item");
|
||||
ItemDef& item = builder.items.create(CORE_STRUCT_AIR+".item");
|
||||
item.iconType = ItemIconType::BLOCK;
|
||||
item.icon = CORE_STRUCT_AIR;
|
||||
item.placingBlock = CORE_STRUCT_AIR;
|
||||
|
||||
Reference in New Issue
Block a user