Merge branch 'MihailRis:main' into main

This commit is contained in:
Astazium 2026-06-06 12:20:12 +03:00 • committed by GitHub
commit 80585c441e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 44 additions and 32 deletions

View file

@ -711,7 +711,7 @@ std::unique_ptr<ALAudio> ALAudio::create(const AudioSettings& settings) {
return nullptr; return nullptr;
} }
bool effects = true; bool effects = true;
ALint attribs[4] {}; [[maybe_unused]] ALint attribs[4] {};
if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_TRUE) { if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_TRUE) {
logger.info() << "AL effects extension present"; logger.info() << "AL effects extension present";
attribs[0] = ALC_MAX_AUXILIARY_SENDS; attribs[0] = ALC_MAX_AUXILIARY_SENDS;

View file

@ -55,12 +55,12 @@ model::Model VcmModel::squashed() const {
} }
static const std::unordered_map<std::string, int> side_indices { static const std::unordered_map<std::string, int> side_indices {
{"north", 0}, {"east", 0},
{"south", 1}, {"west", 1},
{"top", 2}, {"bottom", 2},
{"bottom", 3}, {"top", 3},
{"west", 4}, {"south", 4},
{"east", 5}, {"north", 5},
}; };
static bool to_boolean(const xml::Attribute& attr) { static bool to_boolean(const xml::Attribute& attr) {

View file

@ -136,18 +136,18 @@ void Mesh::addBox(
const bool enabledSides[6], const bool enabledSides[6],
const glm::mat4& transform const glm::mat4& transform
) { ) {
if (enabledSides[0]) // north if (enabledSides[0]) // east
addPlane(pos+Z*size, X*size, Y*size, Z, uvs[0], transform); addPlane(pos-X*size, Z*size, Y*size, -X, uvs[0], transform);
if (enabledSides[1]) // south if (enabledSides[1]) // west
addPlane(pos-Z*size, -X*size, Y*size, -Z, uvs[1], transform); addPlane(pos+X*size, -Z*size, Y*size, X, uvs[1] * glm::vec2(-1, 1), transform);
if (enabledSides[2]) // top if (enabledSides[2]) // bottom
addPlane(pos+Y*size, X*size, -Z*size, Y, uvs[2] * glm::vec2(-1), transform); addPlane(pos-Y*size, X*size, Z*size, -Y, uvs[2], transform);
if (enabledSides[3]) // bottom if (enabledSides[3]) // top
addPlane(pos-Y*size, X*size, Z*size, -Y, uvs[3] * glm::vec2(-1, 1), transform); addPlane(pos+Y*size, X*size, -Z*size, Y, uvs[3] * glm::vec2(-1, 1), transform);
if (enabledSides[4]) // west if (enabledSides[4]) // south
addPlane(pos+X*size, -Z*size, Y*size, X, uvs[4], transform); addPlane(pos-Z*size, -X*size, Y*size, -Z, uvs[4], transform);
if (enabledSides[5]) // east if (enabledSides[5]) // north
addPlane(pos-X*size, Z*size, Y*size, -X, uvs[5] * glm::vec2(-1, 1), transform); addPlane(pos+Z*size, X*size, Y*size, Z, uvs[5] * glm::vec2(-1, 1), transform);
} }
void Mesh::scale(const glm::vec3& size) { void Mesh::scale(const glm::vec3& size) {

View file

@ -73,7 +73,7 @@ Mesh<VertexStructure>::~Mesh() {
MeshStats::meshesCount--; MeshStats::meshesCount--;
glDeleteVertexArrays(1, &vao); glDeleteVertexArrays(1, &vao);
glDeleteBuffers(1, &vbo); glDeleteBuffers(1, &vbo);
for (int i = ibos.size() - 1; i >= 0; i--) { for (int i = 0; i < ibos.size(); i++) {
glDeleteBuffers(1, &ibos[i].ibo); glDeleteBuffers(1, &ibos[i].ibo);
} }
} }
@ -98,7 +98,7 @@ void Mesh<VertexStructure>::reload(
glBufferData(GL_ARRAY_BUFFER, 0, {}, GL_STREAM_DRAW); glBufferData(GL_ARRAY_BUFFER, 0, {}, GL_STREAM_DRAW);
} }
for (int i = indices.size(); i < ibos.size(); i++) { for (int i = 0; i < ibos.size(); i++) {
glDeleteBuffers(1, &ibos[i].ibo); glDeleteBuffers(1, &ibos[i].ibo);
} }
ibos.clear(); ibos.clear();

View file

@ -83,12 +83,12 @@ static util::TextureRegion determine_texture_region(
const Assets& assets, const std::string& texture const Assets& assets, const std::string& texture
) { ) {
static std::array<std::string, 6> faces { static std::array<std::string, 6> faces {
"blocks:dbg_north",
"blocks:dbg_south",
"blocks:dbg_top",
"blocks:dbg_bottom",
"blocks:dbg_west",
"blocks:dbg_east", "blocks:dbg_east",
"blocks:dbg_west",
"blocks:dbg_bottom",
"blocks:dbg_top",
"blocks:dbg_south",
"blocks:dbg_north",
}; };
if (texture.length() < 2 || texture.at(0) != '$') { if (texture.length() < 2 || texture.at(0) != '$') {

View file

@ -378,8 +378,11 @@ void EngineController::reconfigPacks(
auto& manager = contentControl.scan(); auto& manager = contentControl.scan();
reconfig_packs_inside(manager, names, packsToAdd, packsToRemove); reconfig_packs_inside(manager, names, packsToAdd, packsToRemove);
const auto& settings = engine.getSettings();
auto& wfile = *world->wfile; auto& wfile = *world->wfile;
wfile.removeIndices(packsToRemove); if (!settings.debug.generatorTestMode.get()) {
wfile.removeIndices(packsToRemove);
}
wfile.writePacks(manager.getAll(names)); wfile.writePacks(manager.getAll(names));
reopenWorld(world); reopenWorld(world);
} }

View file

@ -80,6 +80,10 @@ int lua::pushwstring(State* L, const std::wstring& str) {
return pushstring(L, util::wstr2str_utf8(str)); return pushstring(L, util::wstr2str_utf8(str));
} }
static std::string to_ptr_string(State* L, int idx) {
return std::to_string(reinterpret_cast<ptrdiff_t>(lua_topointer(L, idx)));
}
dv::value lua::tovalue(State* L, int idx) { dv::value lua::tovalue(State* L, int idx) {
using dv::value_type; using dv::value_type;
auto type = lua::type(L, idx); auto type = lua::type(L, idx);
@ -99,11 +103,16 @@ dv::value lua::tovalue(State* L, int idx) {
} }
} }
case LUA_TFUNCTION: case LUA_TFUNCTION:
return "<function " + return "<function " + to_ptr_string(L, idx) + ">";
std::to_string( case LUA_TTHREAD:
reinterpret_cast<ptrdiff_t>(lua_topointer(L, idx)) return "<thread " + to_ptr_string(L, idx) + ">";
) + case LUA_TUSERDATA:
">"; if (auto userdata = touserdata<Userdata>(L, idx)) {
return "<userdata:" + userdata->getTypeName() + " " + to_ptr_string(L, idx) + ">";
}
return "<userdata " + to_ptr_string(L, idx) + ">";
case LUA_TLIGHTUSERDATA:
return "<lightuserdata " + to_ptr_string(L, idx) + ">";
case LUA_TSTRING: case LUA_TSTRING:
return std::string(tostring(L, idx)); return std::string(tostring(L, idx));
case LUA_TTABLE: { case LUA_TTABLE: {