feat: Java Crosshair Inversion

This commit is contained in:
str1k3r committed 2026-09-26 14:46:10 -04:00
1 parent 11a1c15292
commit 5b198d7b31
3 files changed
+41 -44

No files matched your search

+39 -42
View File
@@ -331,7 +331,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
glEnable(GL_BLEND);
RenderManager.StateSetBlendFactor(0xffffff |(((unsigned int)fVal)<<24));
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
//glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
// 4J Stu - We don't want to adjust the cursor by the safezone, we want it centred
if(bTwoPlayerSplitscreen)
{
@@ -341,7 +341,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
{
blit(screenWidth / 2 - 7, screenHeight / 2 - 7, 0, 0, 16, 16);
}
glDisable(GL_BLEND);
// if(bTwoPlayerSplitscreen)
// {
@@ -356,10 +355,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
int iLastHealth = minecraft->player->lastHealth;
random->setSeed(tickCount * 312871);
// if (false) //(true)
// {
// renderBossHealth();
// }
if (EnderDragonRenderer::bossInstance != NULL)
{
renderBossHealth();
}
/////////////////////////////////////////////////////////////////////////////////////
// Display the experience, food, armour, health and the air bubbles
@@ -473,8 +472,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
////////////////////////////
if(bDisplayGui)
{
// glDisable(GL_BLEND); 4J - removed - we want to be able to fade our gui
glEnable(GL_RESCALE_NORMAL);
Lighting::turnOnGui();
@@ -962,40 +959,40 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
glEnable(GL_ALPHA_TEST);
}
// Moved to the xui base scene
// void Gui::renderBossHealth(void)
// {
// if (EnderDragonRenderer::bossInstance == NULL) return;
//
// shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
// EnderDragonRenderer::bossInstance = NULL;
//
// Minecraft *pMinecraft=Minecraft::GetInstance();
//
// Font *font = pMinecraft->font;
//
// ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
// int screenWidth = ssc.getWidth();
//
// int w = 182;
// int xLeft = screenWidth / 2 - w / 2;
//
// int progress = (int) (boss->getSynchedHealth() / (float) boss->getMaxHealth() * (float) (w + 1));
//
// int yo = 12;
// blit(xLeft, yo, 0, 74, w, 5);
// blit(xLeft, yo, 0, 74, w, 5);
// if (progress > 0)
// {
// blit(xLeft, yo, 0, 79, progress, 5);
// }
//
// wstring msg = L"Boss health - NON LOCALISED";
// font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff);
// glColor4f(1, 1, 1, 1);
// glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png"));
//
// }
#if RENDER_HUD
void Gui::renderBossHealth(void)
{
if (EnderDragonRenderer::bossInstance == NULL) return;
shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
EnderDragonRenderer::bossInstance = NULL;
Minecraft *pMinecraft=Minecraft::GetInstance();
Font *font = pMinecraft->font;
ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
int screenWidth = ssc.getWidth();
int w = 182;
int xLeft = screenWidth / 2 - w / 2;
int progress = (int) (boss->getSynchedHealth() / (float) boss->getMaxHealth() * (float) (w + 1));
int yo = 12;
blit(xLeft, yo, 0, 74, w, 5);
blit(xLeft, yo, 0, 74, w, 5);
if (progress > 0)
{
blit(xLeft, yo, 0, 79, progress, 5);
}
wstring msg = app.GetString(IDS_BOSS_ENDERDRAGON_HEALTH);
font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff);
glColor4f(1, 1, 1, 1);
glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png"));
}
#endif
void Gui::renderPumpkin(int w, int h)
{