mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user