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/GhastRenderer.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/GhastRenderer.cpp')
| -rw-r--r-- | Minecraft.Client/GhastRenderer.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Minecraft.Client/GhastRenderer.cpp b/Minecraft.Client/GhastRenderer.cpp index 1d8a2833..cecb4eaf 100644 --- a/Minecraft.Client/GhastRenderer.cpp +++ b/Minecraft.Client/GhastRenderer.cpp @@ -3,11 +3,14 @@ #include "GhastModel.h" #include "..\Minecraft.World\net.minecraft.world.entity.monster.h" +ResourceLocation GhastRenderer::GHAST_LOCATION = ResourceLocation(TN_MOB_GHAST); +ResourceLocation GhastRenderer::GHAST_SHOOTING_LOCATION = ResourceLocation(TN_MOB_GHAST_FIRE); + GhastRenderer::GhastRenderer() : MobRenderer(new GhastModel(), 0.5f) { } -void GhastRenderer::scale(shared_ptr<Mob> mob, float a) +void GhastRenderer::scale(shared_ptr<LivingEntity> mob, float a) { shared_ptr<Ghast> ghast = dynamic_pointer_cast<Ghast>(mob); @@ -18,4 +21,16 @@ void GhastRenderer::scale(shared_ptr<Mob> mob, float a) float hs = (8+1/ss)/2; glScalef(hs, s, hs); glColor4f(1, 1, 1, 1); +} + +ResourceLocation *GhastRenderer::getTextureLocation(shared_ptr<Entity> mob) +{ + shared_ptr<Ghast> ghast = dynamic_pointer_cast<Ghast>(mob); + + if (ghast->isCharging()) + { + return &GHAST_SHOOTING_LOCATION; + } + + return &GHAST_LOCATION; }
\ No newline at end of file |
