feat: grass (#11)

* feat: add grass texture and update grass_block texture

* feat: add block data

* feat: add blocks_tool

* feat: add sync info and change function in blocks_tools

* feat: add check and new function

* refactor: make block texture loading data-driven

* feat: add rendering for grass

* feat: passable grass

* feat: random grass place

* fix: memory leak in TextureManager::load_cross_plane_texture
This commit is contained in:
zhenyan121
2026-05-28 21:34:36 +08:00
committed by GitHub
parent bbf8b4e969
commit 5901ab7cd9
47 changed files with 1193 additions and 210 deletions

View File

@@ -1,11 +1,7 @@
#include "Cubed/map_table.hpp"
#include "Cubed/gameplay/block.hpp"
#include "Cubed/tools/cubed_assert.hpp"
#include "Cubed/tools/cubed_hash.hpp"
namespace Cubed {
/*
std::string_view MapTable::get_name_from_id(unsigned id) {
auto it = id_to_name_map.find(id);
ASSERT_MSG(it != id_to_name_map.end(),
@@ -25,8 +21,9 @@ std::string_view MapTable::item_name(unsigned id) {
}
const std::vector<std::string>& MapTable::item_map() { return item_id_to_name; }
*/
void MapTable::init_map() {
/*
id_to_name_map.reserve(MAX_BLOCK_NUM);
name_to_id_map.reserve(MAX_BLOCK_NUM);
@@ -37,6 +34,7 @@ void MapTable::init_map() {
for (auto s : BLOCK_REISTER) {
item_id_to_name.emplace_back(s);
}
*/
}
} // namespace Cubed