From 82bae1c21a8296e7a6a51987c4da2417021c6b90 Mon Sep 17 00:00:00 2001 From: mduval76 <9343789@etu.cegepsth.qc.ca> Date: Thu, 14 Dec 2023 20:34:59 -0500 Subject: [PATCH] Push background transparent pour menu options Graphics --- SQCSim2021/engine.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 62a439f..c91555d 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1019,7 +1019,6 @@ void Engine::DisplayOptionsMenu() { glPushMatrix(); m_textureOptionsMenu.Bind(); - glLoadIdentity(); glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2i(0, 0); glTexCoord2f(1, 0); glVertex2i(Width(), 0); @@ -1190,10 +1189,10 @@ void Engine::DisplayGraphicsMenu(float centerX, float centerY) { glColor4f(1.0f, 1.0f, 1.0f, 0.5f); glBindTexture(GL_TEXTURE_2D, 0); glBegin(GL_QUADS); - glTexCoord2f(0, 0); glVertex2i(centerX - Width() * 0.16, centerY + Height() * 0.165); - glTexCoord2f(1, 0); glVertex2i(centerX + Width() * 0.1, centerY + Height() * 0.165); - glTexCoord2f(1, 1); glVertex2i(centerX + Width() * 0.1, centerY - Height() * 0.04); - glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.16, centerY - Height() * 0.04); + glTexCoord2f(0, 0); glVertex2i(Width() * 0.34, Height() * 0.46); + glTexCoord2f(1, 0); glVertex2i(Width() * 0.6, Height() * 0.46); + glTexCoord2f(1, 1); glVertex2i(Width() * 0.6, Height() * 0.67); + glTexCoord2f(0, 1); glVertex2i(Width() * 0.34, Height() * 0.67); glEnd(); glColor4f(0.0f, 0.0f, 0.0f, 1.0f); @@ -2236,8 +2235,6 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) { m_selectedSinglePlayer = true; m_selectedMultiPlayer = false; m_settingUsername = true; - //m_gamestate = GameState::PLAY; - //m_audio.ToggleMusicState(m_gamestate); } else { m_selectedPlayOptions = true; @@ -2354,7 +2351,7 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) { float topChkUHD = centerY + Height() * 0.025f; float bottomChkUHD = centerY; - if (m_selectedOption == 1 && leftChk && x < rightChk && y > bottomChkHD && y < topChkHD) { + if (m_selectedOption == 1 && x > leftChk && x < rightChk && y > bottomChkHD && y < topChkHD) { m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume); m_resolution = HD; }