Merge branch 'MihailRis:main' into main

This commit is contained in:
Astazium 2026-08-05 23:11:12 +03:00 • committed by GitHub
commit bd56be04dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 343 additions and 72 deletions

View file

@ -471,8 +471,11 @@ void WorldRenderer::renderFrame(
setupWorldShader(entityShader, hudcam, engine.getSettings(), 0.0f);
hands->render(camera);
}
renderBlockOverlay(pctx);
{
auto bctx = pctx.sub();
bctx.useTexture(advanced_pipeline::TARGET_COLOR, nullptr);
renderBlockOverlay(pctx);
}
glActiveTexture(GL_TEXTURE0);
}

View file

@ -161,17 +161,13 @@ static LuaCanvas& require_canvas(State* L, int idx) {
static int l_clear(State* L) {
auto& canvas = require_canvas(L, 1);
auto& image = canvas.getData();
ubyte* data = image.getData();
RGBA rgba {};
size_t pixelscount = image.getWidth() * image.getHeight();
uint32_t* data = reinterpret_cast<uint32_t*>(image.getData());
if (gettop(L) == 1) {
std::fill(data, data + image.getDataSize(), 0);
return 0;
}
rgba = get_rgba(L, 2);
size_t pixels = image.getWidth() * image.getHeight();
const size_t channels = 4;
for (size_t i = 0; i < pixels * channels; i++) {
data[i] = rgba.arr[i % channels];
std::fill(data, data + pixelscount, 0);
} else {
std::fill(data, data + pixelscount, get_rgba(L, 2).rgba);
}
return 0;
}