Merge pull request #239 from realffqq/feat/iggy-dev

(IGGY) fix(gui): resolve transparency, lighting, and culling issues in item rendering
This commit is contained in:
Tropical 2026-03-14 21:03:22 -05:00 committed by GitHub
commit 2a71525b5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -720,10 +720,21 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, std::shar
float scaleX = bwidth / 16.0f;
float scaleY = bheight / 16.0f;
// 4jcraft: make sure we cull the back to not make transparent blocks (like
// leaves) look weird
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
// 4jcraft: needed for transparency in the item renders (like in the
// crafting menu)
if (fAlpha < 1) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
glEnable(GL_RESCALE_NORMAL);
glPushMatrix();
Lighting::turnOnGui();
glRotatef(120, 1, 0, 0);
Lighting::turnOn();
glPopMatrix();
float pop = item->popTime;
@ -770,6 +781,10 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, std::shar
Lighting::turnOff();
glDisable(GL_RESCALE_NORMAL);
glDisable(GL_CULL_FACE);
if (fAlpha < 1) {
glDisable(GL_BLEND);
}
}
// 4J Stu - Not threadsafe