chore: realign hud & x360 stuff

This commit is contained in:
str1k3r committed 2026-10-04 01:32:30 -04:00
1 parent 8f7ad6f080
commit dc73daee70
45 files changed
+957 -2623

No files matched your search

+12 -20
View File
@@ -28,11 +28,7 @@
#include "..\Minecraft.World\LevelChunk.h"
#include "..\Minecraft.World\Biome.h"
#define RENDER_HUD 0
#ifndef _XBOX
#undef RENDER_HUD
#define RENDER_HUD 1
#endif
float Gui::currentGuiBlendFactor = 1.0f; // 4J added
float Gui::currentGuiScaleFactor = 1.0f; // 4J added
@@ -307,21 +303,17 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
shared_ptr<Inventory> inventory = minecraft->player->inventory;
if(bTwoPlayerSplitscreen)
{
// need to apply scale factors depending on the mode
{
const int splitscreenQuickSelectX = iWidthOffset + screenWidth / 2 - quickSelectWidth / 2 - 1;
// 4J Stu - Moved this push and scale further up as we still need to do it for the few HUD components not replaced by xui
//glPushMatrix();
//glScalef(fScaleFactorWidth, fScaleFactorHeight, fScaleFactorWidth);
// 4J-PB - move into the safe zone, and account for 2 player splitscreen
blit(iWidthOffset + (screenWidth - quickSelectWidth)/2, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset , 0, 0, 182, 22);
blit(iWidthOffset + (screenWidth - quickSelectWidth)/2 - 1 + inventory->selected * 20, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset - 1, 0, 22, 24, 22);
blit(splitscreenQuickSelectX, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset , 0, 0, 182, 22);
blit(splitscreenQuickSelectX - 1 + inventory->selected * 20, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset - 1, 0, 22, 24, 22);
}
else
{
blit(iWidthOffset + screenWidth / 2 - quickSelectWidth / 2, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset , 0, 0, 182, 22);
blit(iWidthOffset + screenWidth / 2 - quickSelectWidth / 2 - 1 + inventory->selected * 20, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset - 1, 0, 22, 24, 22);
blit(iWidthOffset + screenWidth / 2 - quickSelectWidth / 2 - 1 + inventory->selected * 20, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset - 1, 0, 22, 24, 22);
}
@@ -335,11 +327,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
// 4J Stu - We don't want to adjust the cursor by the safezone, we want it centred
if(bTwoPlayerSplitscreen)
{
blit(iWidthOffset + screenWidth / 2 - 7, (iHeightOffset + screenHeight) / 2 - 7, 0, 0, 16, 16);
blit(iWidthOffset + screenWidth / 2 - 8, (iHeightOffset + screenHeight) / 2 - 8, 0, 0, 16, 16);
}
else
{
blit(screenWidth / 2 - 7, screenHeight / 2 - 7, 0, 0, 16, 16);
blit(screenWidth / 2 - 8, screenHeight / 2 - 8, 0, 0, 16, 16);
}
// if(bTwoPlayerSplitscreen)
@@ -375,12 +367,12 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
// 4J Stu - TODO Work out proper positioning for splitscreen
if(bTwoPlayerSplitscreen)
{
xLeft = iWidthOffset + (screenWidth - quickSelectWidth)/2;
xRight = iWidthOffset + (screenWidth + quickSelectWidth)/2;
xLeft = iWidthOffset + (screenWidth - quickSelectWidth) / 2 - 1;
xRight = iWidthOffset + (screenWidth + quickSelectWidth) / 2;
}
else
{
xLeft = (screenWidth - quickSelectWidth)/2;
xLeft = (screenWidth - quickSelectWidth) / 2;
xRight = (screenWidth + quickSelectWidth) / 2;
}
@@ -500,7 +492,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
// 4J - do render of crouched player. This code is largely taken from the inventory render of the player, with some special hard-coded positions
// worked out by hand from the xui implementation of the crouch icon
if(app.GetGameSettings(iPad,eGameSetting_AnimatedCharacter) && !minecraft->options->renderDebug) //str1k3r - disable paperdoll if "F3" is on screen
if(!minecraft->options->renderDebug) //str1k3r - disable paperdoll if "F3" is on screen
{
//int playerIdx = minecraft->player->GetXboxPad();
@@ -756,7 +748,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_ALPHA_TEST);
#if RENDER_HUD
#ifndef _XBOX //#if RENDER_HUD
glPushMatrix();
// 4J-PB we need to move this up a bit because we've moved the quick select
//glTranslatef(0, ((float)screenHeight) - 48, 0);