mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
Merge branch 'MihailRis:main' into main
This commit is contained in:
commit
bd56be04dd
11 changed files with 343 additions and 72 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue