diff options
Diffstat (limited to 'Minecraft.Client/FishingHookRenderer.cpp')
| -rw-r--r-- | Minecraft.Client/FishingHookRenderer.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Minecraft.Client/FishingHookRenderer.cpp b/Minecraft.Client/FishingHookRenderer.cpp index 0408e96e..9d60a9ac 100644 --- a/Minecraft.Client/FishingHookRenderer.cpp +++ b/Minecraft.Client/FishingHookRenderer.cpp @@ -8,6 +8,8 @@ #include "..\Minecraft.World\Mth.h" #include "MultiPlayerLocalPlayer.h" +ResourceLocation FishingHookRenderer::PARTICLE_LOCATION = ResourceLocation(TN_PARTICLES); + void FishingHookRenderer::render(shared_ptr<Entity> _hook, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version @@ -20,13 +22,13 @@ void FishingHookRenderer::render(shared_ptr<Entity> _hook, double x, double y, d glScalef(1 / 2.0f, 1 / 2.0f, 1 / 2.0f); int xi = 1; int yi = 2; - bindTexture(TN_PARTICLES); // 4J was L"/particles.png" + bindTexture(hook); // 4J was L"/particles.png" Tesselator *t = Tesselator::getInstance(); - float u0 = ((xi) * 8 + 0) / 128.0f; - float u1 = ((xi) * 8 + 8) / 128.0f; - float v0 = ((yi) * 8 + 0) / 128.0f; - float v1 = ((yi) * 8 + 8) / 128.0f; + float u0 = (xi * 8 + 0) / 128.0f; + float u1 = (xi * 8 + 8) / 128.0f; + float v0 = (yi * 8 + 0) / 128.0f; + float v1 = (yi * 8 + 8) / 128.0f; float r = 1.0f; @@ -50,7 +52,7 @@ void FishingHookRenderer::render(shared_ptr<Entity> _hook, double x, double y, d if (hook->owner != NULL) { float swing = hook->owner->getAttackAnim(a); - float swing2 = (float) Mth::sin((sqrt(swing)) * PI); + float swing2 = (float) Mth::sin(sqrt(swing) * PI); Vec3 *vv = Vec3::newTemp(-0.5, 0.03, 0.8); @@ -62,7 +64,7 @@ void FishingHookRenderer::render(shared_ptr<Entity> _hook, double x, double y, d double xp = hook->owner->xo + (hook->owner->x - hook->owner->xo) * a + vv->x; double yp = hook->owner->yo + (hook->owner->y - hook->owner->yo) * a + vv->y; double zp = hook->owner->zo + (hook->owner->z - hook->owner->zo) * a + vv->z; - double yOffset = hook->owner != dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player) ? hook->owner->getHeadHeight() : 0; + double yOffset = hook->owner == dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player) ? 0 : hook->owner->getHeadHeight(); // 4J-PB - changing this to be per player //if (this->entityRenderDispatcher->options->thirdPersonView) @@ -99,3 +101,8 @@ void FishingHookRenderer::render(shared_ptr<Entity> _hook, double x, double y, d glEnable(GL_TEXTURE_2D); } } + +ResourceLocation *FishingHookRenderer::getTextureLocation(shared_ptr<Entity> mob) +{ + return &PARTICLE_LOCATION; +} |
