MinecraftConsoles/Minecraft.Client/PigRenderer.cpp
Riley M. c0da06e4ee
major: Switch to forward slashes(+more) to fix compilation on Linux (#1403)
Notably also adds some metadata files for NixOS 

* add support for linux clang cross compiles

* add linux clang instructions

* un-capitalize Mob.horse.*

* update the description in flake.nix

---------

Co-authored-by: Loki <lokirautio@gmail.com>
2026-04-14 16:47:37 -05:00

38 lines
1,022 B
C++

#include "stdafx.h"
#include "PigRenderer.h"
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
ResourceLocation PigRenderer::PIG_LOCATION = ResourceLocation(TN_MOB_PIG);
ResourceLocation PigRenderer::SADDLE_LOCATION = ResourceLocation(TN_MOB_SADDLE);
PigRenderer::PigRenderer(Model *model, Model *armor, float shadow) : MobRenderer(model,shadow)
{
setArmor(armor);
}
int PigRenderer::prepareArmor(shared_ptr<LivingEntity> _pig, int layer, float a)
{
// 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Pig> pig = dynamic_pointer_cast<Pig>(_pig);
if (layer == 0 && pig->hasSaddle())
{
MemSect(31);
bindTexture(&SADDLE_LOCATION);
MemSect(0);
return 1;
}
return -1;
}
void PigRenderer::render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a)
{
MobRenderer::render(mob, x, y, z, rot, a);
}
ResourceLocation *PigRenderer::getTextureLocation(shared_ptr<Entity> mob)
{
return &PIG_LOCATION;
}