1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Move drawing of wield tool into a dedicated step of the pipeline (#13338)

This commit is contained in:
x2048 2023-03-19 21:31:15 +01:00 committed by GitHub
parent 09342c0811
commit 6cd2eea487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 9 deletions

View file

@ -39,6 +39,13 @@ void Draw3D::run(PipelineContext &context)
return;
context.hud->drawBlockBounds();
context.hud->drawSelectionMesh();
}
void DrawWield::run(PipelineContext &context)
{
if (m_target)
m_target->activate(context);
if (context.draw_wield_tool)
context.client->getCamera()->drawWieldedTool();
}
@ -144,6 +151,7 @@ void populatePlainPipeline(RenderPipeline *pipeline, Client *client)
auto downscale_factor = getDownscaleFactor();
auto step3D = pipeline->own(create3DStage(client, downscale_factor));
pipeline->addStep(step3D);
pipeline->addStep<DrawWield>();
pipeline->addStep<MapPostFxStep>();
step3D = addUpscaling(pipeline, step3D, downscale_factor);