clang-tidy: fix many warnings

This commit is contained in:
Er2
2023-12-02 21:04:21 +03:00
parent 0f9131c43a
commit bf78dd4bf1
28 changed files with 61 additions and 57 deletions

View File

@@ -134,8 +134,6 @@ void Gui::render(float f, bool bHaveScreen, int mouseX, int mouseY)
if (!m->m_pLevel || !m->m_pLocalPlayer)
return;
bool isTouchscreen = m->isTouchscreen();
field_4 = -90.0f;
#ifndef ENH_TRANSPARENT_HOTBAR
@@ -257,15 +255,15 @@ void Gui::render(float f, bool bHaveScreen, int mouseX, int mouseY)
emptyHeartX += 9 * b1;
}
#ifdef ORIGINAL_CODE
// @NOTE: At the default scale, this would go off screen.
int heartX = cenX - 191; // why?
int heartYStart = height - 10;
#else
//@NOTE: Alpha-style health UI. I'll probably remove this on release.
#ifndef ORIGINAL_CODE
heartX = cenX - 91;
heartYStart = height - 32;
int heartX = cenX - 91;
int heartYStart = height - 32;
#endif
int playerHealth = pLP->m_health;
@@ -301,12 +299,12 @@ void Gui::render(float f, bool bHaveScreen, int mouseX, int mouseY)
int breathFull = int(ceilf((float(breathRaw - 2) * 10.0f) / 300.0f));
int breathMeter = int(ceilf((float(breathRaw) * 10.0f) / 300.0f)) - breathFull;
#ifdef ORIGINAL_CODE
int bubbleX = cenX - 191;
int bubbleY = height - 19;
#ifndef ORIGINAL_CODE
bubbleX = cenX - 91;
bubbleY = height - 41;
#else
int bubbleX = cenX - 91;
int bubbleY = height - 41;
#endif
//@NOTE: Not sure this works as it should

View File

@@ -234,7 +234,6 @@ void OptionList::drawOnOffSwitch(int x, int y, bool state, bool disabled)
void OptionList::renderItem(int index, int x, int y, int height, Tesselator& t)
{
Font* f = m_pMinecraft->m_pFont;
OptionItem* pItem = m_items[index];
pItem->render(this, x, y);
@@ -347,6 +346,8 @@ void OptionList::initDefaultMenu()
#ifdef __EMSCRIPTEN
m_items[idxLM]->setDisabled(true);
#else
(void)idxLM;
#endif
if (!GetPatchManager()->IsGrassSidesTinted())

View File

@@ -97,7 +97,6 @@ void ScrolledSelectionList::renderScrollBackground()
void ScrolledSelectionList::checkInput(int mouseX, int mouseY)
{
int nItems = getNumberOfItems();
if (Mouse::isButtonDown(BUTTON_LEFT))
{
if (float(mouseY) >= field_C && float(mouseY) <= field_10 && abs(mouseY - field_28) > 5)

View File

@@ -47,9 +47,9 @@ void TextInputBox::keyPressed(Minecraft* minecraft, int key)
if (!m_bFocused)
return;
bool bShiftPressed = minecraft->platform()->shiftPressed();
#ifndef HANDLE_CHARS_SEPARATELY
bool bShiftPressed = minecraft->platform()->shiftPressed();
char chr = '\0';
if (key >= AKEYCODE_A && key <= AKEYCODE_Z)
{

View File

@@ -63,7 +63,7 @@ void PauseScreen::init()
m_btnOptions.m_yPos = currY;
m_btnOptions.m_xPos = m_btnBack.m_xPos;
#endif
currY += inc;
//currY += inc;
// add the buttons to the screen:
m_buttons.push_back(&m_btnBack);