diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/SpiderRenderer.cpp | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
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 <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/SpiderRenderer.cpp')
| -rw-r--r-- | Minecraft.Client/SpiderRenderer.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Minecraft.Client/SpiderRenderer.cpp b/Minecraft.Client/SpiderRenderer.cpp index 9c31eb9e..617cce90 100644 --- a/Minecraft.Client/SpiderRenderer.cpp +++ b/Minecraft.Client/SpiderRenderer.cpp @@ -3,59 +3,59 @@ #include "SpiderModel.h" #include "..\Minecraft.World\net.minecraft.world.entity.monster.h" +ResourceLocation SpiderRenderer::SPIDER_LOCATION = ResourceLocation(TN_MOB_SPIDER); +ResourceLocation SpiderRenderer::SPIDER_EYES_LOCATION = ResourceLocation(TN_MOB_SPIDER_EYES); + SpiderRenderer::SpiderRenderer() : MobRenderer(new SpiderModel(), 1.0f) { this->setArmor(new SpiderModel()); } -float SpiderRenderer::getFlipDegrees(shared_ptr<Mob> spider) +float SpiderRenderer::getFlipDegrees(shared_ptr<LivingEntity> spider) { return 180; } -int SpiderRenderer::prepareArmor(shared_ptr<Mob> _spider, int layer, float a) +int SpiderRenderer::prepareArmor(shared_ptr<LivingEntity> _spider, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version shared_ptr<Spider> spider = dynamic_pointer_cast<Spider>(_spider); - if (layer!=0) return -1; + if (layer!=0) return -1; MemSect(31); - bindTexture(TN_MOB_SPIDER_EYES); // 4J was L"/mob/spider_eyes.png" + bindTexture(&SPIDER_EYES_LOCATION); MemSect(0); // 4J - changes brought forward from 1.8.2 - float br = 1.0f; // was (1-spider->getBrightness(1))*0.5f; - glEnable(GL_BLEND); + float br = 1.0f; // was (1-spider->getBrightness(1))*0.5f; + glEnable(GL_BLEND); // 4J Stu - We probably don't need to do this on 360 either (as we force it back on the renderer) // However we do want it off for other platforms that don't force it on in the render lib CBuff handling // Several texture packs have fully transparent bits that break if this is off #ifdef _XBOX - glDisable(GL_ALPHA_TEST); + glDisable(GL_ALPHA_TEST); #endif // 4J - changes brought forward from 1.8.2 glBlendFunc(GL_ONE, GL_ONE); if (spider->isInvisible()) glDepthMask(false); else glDepthMask(true); - if (SharedConstants::TEXTURE_LIGHTING) + if (SharedConstants::TEXTURE_LIGHTING) { // 4J - was 0xf0f0 but that looks like it is a mistake - maybe meant to be 0xf000f0 to enable both sky & block lighting? choosing 0x00f0 here instead // as most likely replicates what the java game does, without breaking our lighting (which doesn't like UVs out of the 0 to 255 range) - int col = 0x00f0; - int u = col % 65536; - int v = col / 65536; + int col = 0x00f0; + int u = col % 65536; + int v = col / 65536; - glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f); - glColor4f(1, 1, 1, 1); - } + glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f); + glColor4f(1, 1, 1, 1); + } // 4J - this doesn't seem right - surely there should be an else in here? - glColor4f(1, 1, 1, br); - return 1; + glColor4f(1, 1, 1, br); + return 1; } -void SpiderRenderer::scale(shared_ptr<Mob> _mob, float a) +ResourceLocation *SpiderRenderer::getTextureLocation(shared_ptr<Entity> mob) { - // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr<Spider> mob = dynamic_pointer_cast<Spider>(_mob); - float scale = mob->getModelScale(); - glScalef(scale, scale, scale); + return &SPIDER_LOCATION; }
\ No newline at end of file |
