From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.Client/EndermanRenderer.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'Minecraft.Client/EndermanRenderer.cpp') diff --git a/Minecraft.Client/EndermanRenderer.cpp b/Minecraft.Client/EndermanRenderer.cpp index 8802376a..f6e5220a 100644 --- a/Minecraft.Client/EndermanRenderer.cpp +++ b/Minecraft.Client/EndermanRenderer.cpp @@ -1,9 +1,13 @@ #include "stdafx.h" #include "EndermanRenderer.h" #include "EndermanModel.h" +#include "TextureAtlas.h" #include "..\Minecraft.World\net.minecraft.world.entity.monster.h" #include "..\Minecraft.World\net.minecraft.world.level.tile.h" +ResourceLocation EndermanRenderer::ENDERMAN_EYES_LOCATION = ResourceLocation(TN_MOB_ENDERMAN_EYES); +ResourceLocation EndermanRenderer::ENDERMAN_LOCATION = ResourceLocation(TN_MOB_ENDERMAN); + EndermanRenderer::EndermanRenderer() : MobRenderer(new EndermanModel(), 0.5f) { model = (EndermanModel *) MobRenderer::model; @@ -29,7 +33,12 @@ void EndermanRenderer::render(shared_ptr _mob, double x, double y, doubl MobRenderer::render(mob, x, y, z, rot, a); } -void EndermanRenderer::additionalRendering(shared_ptr _mob, float a) +ResourceLocation *EndermanRenderer::getTextureLocation(shared_ptr mob) +{ + return &ENDERMAN_LOCATION; +} + +void EndermanRenderer::additionalRendering(shared_ptr _mob, float a) { // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr we have here - // do some casting around instead @@ -47,7 +56,7 @@ void EndermanRenderer::additionalRendering(shared_ptr _mob, float a) s *= 1.00f; glRotatef(20, 1, 0, 0); glRotatef(45, 0, 1, 0); - glScalef(s, -s, s); + glScalef(-s, -s, s); if (SharedConstants::TEXTURE_LIGHTING) @@ -61,14 +70,14 @@ void EndermanRenderer::additionalRendering(shared_ptr _mob, float a) } glColor4f(1, 1, 1, 1); - bindTexture(TN_TERRAIN); // 4J was L"/terrain.png" + bindTexture(&TextureAtlas::LOCATION_BLOCKS); // TODO: bind by icon tileRenderer->renderTile(Tile::tiles[mob->getCarryingTile()], mob->getCarryingData(), 1); glPopMatrix(); glDisable(GL_RESCALE_NORMAL); } } -int EndermanRenderer::prepareArmor(shared_ptr _mob, int layer, float a) +int EndermanRenderer::prepareArmor(shared_ptr _mob, int layer, float a) { // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr we have here - // do some casting around instead @@ -76,7 +85,7 @@ int EndermanRenderer::prepareArmor(shared_ptr _mob, int layer, float a) if (layer != 0) return -1; - bindTexture(TN_MOB_ENDERMAN_EYES); // 4J was L"/mob/enderman_eyes.png" + bindTexture(&ENDERMAN_EYES_LOCATION); // 4J was L"/mob/enderman_eyes.png" float br = 1; glEnable(GL_BLEND); // 4J Stu - We probably don't need to do this on 360 either (as we force it back on the renderer) @@ -88,8 +97,14 @@ int EndermanRenderer::prepareArmor(shared_ptr _mob, int layer, float a) glBlendFunc(GL_ONE, GL_ONE); glDisable(GL_LIGHTING); - if (mob->isInvisible()) glDepthMask(false); - else glDepthMask(true); + if (mob->isInvisible()) + { + glDepthMask(false); + } + else + { + glDepthMask(true); + } if (SharedConstants::TEXTURE_LIGHTING) { -- cgit v1.2.3