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

@@ -3,7 +3,6 @@
#include "Cubed/app.hpp"
#include "Cubed/config.hpp"
#include "Cubed/gameplay/player.hpp"
#include "Cubed/map_table.hpp"
#include "Cubed/tools/log.hpp"
#include <imgui.h>
@@ -551,7 +550,7 @@ void DevPanel::show_player_tab_item() {
void DevPanel::show_items_tab_item() {
auto& textures = m_app.texture_manager().item_textures();
auto& names = MapTable::item_map();
// auto& names = MapTable::item_map();
if (ImGui::BeginTabItem("item")) {
ImGui::Text("Place Block ");
ImGui::SameLine();
@@ -567,7 +566,7 @@ void DevPanel::show_items_tab_item() {
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("%s", names[i].c_str());
ImGui::Text("%s", BlockManager::name_form_id(i).c_str());
ImGui::EndTooltip();
}
if (i % 10 != 0) {