mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-16 02:02:53 +00:00
Merge pull request #201 from realffqq/feat/restore-java-gui
(feat/restore-java-gui)fix: reorder and correct lighting for blocks in container screens
This commit is contained in:
commit
316577484f
|
|
@ -342,9 +342,11 @@ void ItemRenderer::renderGuiItem(Font *font, Textures *textures, std::shared_ptr
|
|||
Tile *tile = Tile::tiles[itemId];
|
||||
glPushMatrix();
|
||||
// 4J - original code left here for reference
|
||||
#if 0
|
||||
// 4jcraft: re-enable said original code to fix hotbar block rendering
|
||||
#if 1
|
||||
glTranslatef((float)(x), (float)(y), 0.0f);
|
||||
glScalef(fScale, fScale, fScale);
|
||||
//glScalef(fScale, fScale, fScale);
|
||||
glScalef(fScaleX, fScaleY, 1.0f); // 4jcraft: tweaked to use the new variables
|
||||
glTranslatef(-2.0f,3.0f, -3.0f + blitOffset);
|
||||
glScalef(10.0f, 10.0f, 10.0f);
|
||||
glTranslatef(1.0f, 0.5f, 8.0f);
|
||||
|
|
|
|||
|
|
@ -1763,7 +1763,8 @@ void GameRenderer::renderSnowAndRain(float a)
|
|||
t->color(br, br, br, ((1 - dd * dd) * 0.5f + 0.5f) * rainLevel);
|
||||
t->vertexUV(x - xa + 0.5, yy0, z - za + 0.5, 0 * s, yy0 * s / 4.0f + ra * s);
|
||||
t->vertexUV(x + xa + 0.5, yy0, z + za + 0.5, 1 * s, yy0 * s / 4.0f + ra * s);
|
||||
t->color(br, br, br, 0.0f); // 4J - added to soften the top visible edge of the rain
|
||||
// 4jcraft: this color call made rain invisible
|
||||
// t->color(br, br, br, 0.0f); // 4J - added to soften the top visible edge of the rain
|
||||
t->vertexUV(x + xa + 0.5, yy1, z + za + 0.5, 1 * s, yy1 * s / 4.0f + ra * s);
|
||||
t->vertexUV(x - xa + 0.5, yy1, z - za + 0.5, 0 * s, yy1 * s / 4.0f + ra * s);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
|
|||
|
||||
glPushMatrix();
|
||||
glRotatef(120, 1, 0, 0);
|
||||
Lighting::turnOn();
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
|
|
@ -50,6 +49,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
|
|||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
Lighting::turnOnGui();
|
||||
|
||||
Slot *hoveredSlot = NULL;
|
||||
|
||||
|
|
@ -85,8 +85,8 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
|
|||
itemRenderer->renderGuiItemDecorations(font, minecraft->textures, inventory->getCarried(), xm - xo - 8, ym - yo - 8);
|
||||
// carriedSlot = old;
|
||||
}
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
Lighting::turnOff();
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
|
|
|||
Loading…
Reference in a new issue