aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/ExperienceOrbRenderer.cpp
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/ExperienceOrbRenderer.cpp
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (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/ExperienceOrbRenderer.cpp')
-rw-r--r--Minecraft.Client/ExperienceOrbRenderer.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/Minecraft.Client/ExperienceOrbRenderer.cpp b/Minecraft.Client/ExperienceOrbRenderer.cpp
index 1771f833..c0eae756 100644
--- a/Minecraft.Client/ExperienceOrbRenderer.cpp
+++ b/Minecraft.Client/ExperienceOrbRenderer.cpp
@@ -8,17 +8,14 @@
#include "..\Minecraft.World\Mth.h"
#include "..\Minecraft.World\JavaMath.h"
+ResourceLocation ExperienceOrbRenderer::XP_ORB_LOCATION = ResourceLocation(TN_ITEM_EXPERIENCE_ORB);
+
ExperienceOrbRenderer::ExperienceOrbRenderer()
{
- // 4J In class Java initialisors
- tileRenderer = new TileRenderer();
- setColor = true;
-
- this->shadowRadius = 0.15f;
- this->shadowStrength = 0.75f;
+ shadowRadius = 0.15f;
+ shadowStrength = 0.75f;
}
-
void ExperienceOrbRenderer::render(shared_ptr<Entity> _orb, double x, double y, double z, float rot, float a)
{
shared_ptr<ExperienceOrb> orb = dynamic_pointer_cast<ExperienceOrb>(_orb);
@@ -26,8 +23,7 @@ void ExperienceOrbRenderer::render(shared_ptr<Entity> _orb, double x, double y,
glTranslatef((float) x, (float) y, (float) z);
int icon = orb->getIcon();
- bindTexture(TN_ITEM_EXPERIENCE_ORB); // 4J was L"/item/xporb.png"
- Tesselator *t = Tesselator::getInstance();
+ bindTexture(orb); // 4J was L"/item/xporb.png"
float u0 = ((icon % 4) * 16 + 0) / 64.0f;
float u1 = ((icon % 4) * 16 + 16) / 64.0f;
@@ -62,6 +58,7 @@ void ExperienceOrbRenderer::render(shared_ptr<Entity> _orb, double x, double y,
glRotatef(-entityRenderDispatcher->playerRotX, 1, 0, 0);
float s = 0.3f;
glScalef(s, s, s);
+ Tesselator *t = Tesselator::getInstance();
t->begin();
t->color(col, 128);
t->normal(0, 1, 0);
@@ -76,6 +73,11 @@ void ExperienceOrbRenderer::render(shared_ptr<Entity> _orb, double x, double y,
glPopMatrix();
}
+ResourceLocation *ExperienceOrbRenderer::getTextureLocation(shared_ptr<Entity> mob)
+{
+ return &XP_ORB_LOCATION;
+}
+
void ExperienceOrbRenderer::blit(int x, int y, int sx, int sy, int w, int h)
{
float blitOffset = 0;