diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-04 03:56:03 -0600 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-04 03:56:03 -0600 |
| commit | 42aec6dac53dffa6afe072560a7e1d4986112538 (patch) | |
| tree | 0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.Client/LeashKnotRenderer.cpp | |
| parent | c9d58eeac7c72f0b3038e084667b4d89a6249fce (diff) | |
| parent | ef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff) | |
Merge branch 'main' into pr/win64-world-saves
# Conflicts:
# Minecraft.Client/MinecraftServer.cpp
# README.md
Diffstat (limited to 'Minecraft.Client/LeashKnotRenderer.cpp')
| -rw-r--r-- | Minecraft.Client/LeashKnotRenderer.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Minecraft.Client/LeashKnotRenderer.cpp b/Minecraft.Client/LeashKnotRenderer.cpp new file mode 100644 index 00000000..b210379f --- /dev/null +++ b/Minecraft.Client/LeashKnotRenderer.cpp @@ -0,0 +1,39 @@ +#include "stdafx.h" +#include "LeashKnotRenderer.h" +#include "LeashKnotModel.h" + +ResourceLocation LeashKnotRenderer::KNOT_LOCATION = ResourceLocation(TN_ITEM_LEASHKNOT); + +LeashKnotRenderer::LeashKnotRenderer() : EntityRenderer() +{ + model = new LeashKnotModel(); +} + +LeashKnotRenderer::~LeashKnotRenderer() +{ + delete model; +} + +void LeashKnotRenderer::render(shared_ptr<Entity> entity, double x, double y, double z, float rot, float a) +{ + glPushMatrix(); + glDisable(GL_CULL_FACE); + + glTranslatef((float) x, (float) y, (float) z); + + float scale = 1 / 16.0f; + glEnable(GL_RESCALE_NORMAL); + glScalef(-1, -1, 1); + + glEnable(GL_ALPHA_TEST); + + bindTexture(entity); + model->render(entity, 0, 0, 0, 0, 0, scale, true); + + glPopMatrix(); +} + +ResourceLocation *LeashKnotRenderer::getTextureLocation(shared_ptr<Entity> entity) +{ + return &KNOT_LOCATION; +}
\ No newline at end of file |
