Update EvupulRenderer.cpp

This commit is contained in:
DeadVoxelx
2026-04-30 10:10:20 -04:00
committed by GitHub
parent 07b2af55d1
commit d61c2e557b

View File

@@ -2,9 +2,14 @@
#include "EvupulRenderer.h"
#include "EvupulModel.h"
#include "..\Minecraft.World\net.minecraft.world.entity.monster.h"
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
ResourceLocation EvupulRenderer::EVUPUL_LOCATION = ResourceLocation(TN_MOB_EVUPUL);
ResourceLocation EvupulRenderer::EVUPUL_OVERLAY_LOCATION = ResourceLocation(TN_MOB_EVUPULOVERLAY);
ResourceLocation EvupulRenderer::EVUPULDARK_LOCATION = ResourceLocation(TN_MOB_EVUPULDARK);
ResourceLocation EvupulRenderer::EVUPULDARK_OVERLAY_LOCATION = ResourceLocation(TN_MOB_EVUPULDARKOVERLAY);
ResourceLocation EvupulRenderer::EVUPULGOLD_LOCATION = ResourceLocation(TN_MOB_EVUPULGOLD);
ResourceLocation EvupulRenderer::EVUPULGOLD_OVERLAY_LOCATION = ResourceLocation(TN_MOB_EVUPULGOLDOVERLAY);
EvupulRenderer::EvupulRenderer() : MobRenderer(new EvupulModel(), 0.6f)
{
@@ -16,18 +21,48 @@ void EvupulRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
MobRenderer::render(_mob, x, y, z, rot, a);
}
ResourceLocation *EvupulRenderer::getTextureLocation(shared_ptr<Entity> mob)
ResourceLocation *EvupulRenderer::getTextureLocation(shared_ptr<Entity> entity)
{
return &EVUPULDARK_LOCATION;
shared_ptr<EvupulDark> evupulDark = dynamic_pointer_cast<EvupulDark>(entity);
shared_ptr<Evupul> evupul = dynamic_pointer_cast<Evupul>(entity);
if (entity->instanceof(eTYPE_EVUPULDARK))
{
return &EVUPULDARK_LOCATION;
}
if (evupul->getEvupulType() == Evupul::TYPE_DEFAULT)
{
return &EVUPUL_LOCATION;
}
if (evupul->getEvupulType() == Evupul::TYPE_GOLD)
{
return &EVUPULGOLD_LOCATION;
}
}
int EvupulRenderer::prepareArmor(shared_ptr<LivingEntity> _evupulDark, int layer, float a)
int EvupulRenderer::prepareArmor(shared_ptr<LivingEntity> _mob, int layer, float a)
{
shared_ptr<EvupulDark> evupulDark = dynamic_pointer_cast<EvupulDark>(_evupulDark);
shared_ptr<EvupulDark> evupulDark = dynamic_pointer_cast<EvupulDark>(_mob);
shared_ptr<Evupul> evupul = dynamic_pointer_cast<Evupul>(_mob);
if (layer!=0) return -1;
MemSect(31);
bindTexture(&EVUPULDARK_OVERLAY_LOCATION);
if (shared_ptr<LivingEntity>(evupulDark))
{
bindTexture(&EVUPULDARK_OVERLAY_LOCATION);
}
else
{
if (evupul->getEvupulType() == Evupul::TYPE_DEFAULT)
{
bindTexture(&EVUPUL_OVERLAY_LOCATION);
}
else if (evupul->getEvupulType() == Evupul::TYPE_GOLD)
{
bindTexture(&EVUPULGOLD_OVERLAY_LOCATION);
}
}
MemSect(0);
float br = 1.0f;
glEnable(GL_BLEND);
@@ -35,8 +70,8 @@ int EvupulRenderer::prepareArmor(shared_ptr<LivingEntity> _evupulDark, int layer
glDisable(GL_ALPHA_TEST);
#endif
glBlendFunc(GL_ONE, GL_ONE);
if (evupulDark->isInvisible()) glDepthMask(false);
else glDepthMask(true);
//if (evupulDark->isInvisible()) glDepthMask(false);
//else glDepthMask(true);
if (SharedConstants::TEXTURE_LIGHTING)
{
@@ -49,4 +84,4 @@ int EvupulRenderer::prepareArmor(shared_ptr<LivingEntity> _evupulDark, int layer
}
glColor4f(1, 1, 1, br);
return 1;
}
}