diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 2384ca2..39f3b72 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -147,6 +147,7 @@ void Engine::LoadResource() { LoadTexture(m_textureSoloMultiMenu, TEXTURE_PATH "single_multi.png", false); LoadTexture(m_textureTitle, TEXTURE_PATH "title.png", false); LoadTexture(m_textureOptions, TEXTURE_PATH "Buttons/options.png", false); + LoadTexture(m_textureRetour, TEXTURE_PATH "Buttons/retour.png", false); LoadTexture(m_textureVolume, TEXTURE_PATH "Buttons/volume.png", false); LoadTexture(m_textureMusique, TEXTURE_PATH "Buttons/musique.png", false); LoadTexture(m_textureGraphiques, TEXTURE_PATH "Buttons/graphiques.png", false); @@ -538,6 +539,7 @@ void Engine::DrawOption() glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.375, centerY - Height() * 0.05); glEnd(); + // Séparateur glColor4f(0.0f, 0.0f, 0.0f, 1.0f); glBindTexture(GL_TEXTURE_2D, 0); glBegin(GL_QUADS); @@ -547,6 +549,15 @@ void Engine::DrawOption() glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.175, centerY + Height() * 0.25); glEnd(); + glColor4f(0.85f, 0.95f, 0.0f, 1.0f); + m_textureRetour.Bind(); + glBegin(GL_QUADS); + glTexCoord2f(0, 0); glVertex2i(centerX - Width() * 0.075, centerY - Height() * 0.25); + glTexCoord2f(1, 0); glVertex2i(centerX + Width() * 0.075, centerY - Height() * 0.25); + glTexCoord2f(1, 1); glVertex2i(centerX + Width() * 0.075, centerY - Height() * 0.2); + glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.075, centerY - Height() * 0.2); + glEnd(); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); if (m_selectedOption == 0) { @@ -1813,6 +1824,11 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) { float topGameplay = centerY + Height() * 0.1f; float bottomGameplay = centerY + Height() * 0.05f; + float leftRetour = centerX - Width() * 0.075f; + float rightRetour = centerX + Width() * 0.075f; + float topRetour = centerY + Height() * 0.25f; + float bottomRetour = centerY + Height() * 0.2f; + if (x > leftVol && x < rightVol && y > bottomVol && y < topVol) { m_selectedOption = 0; // Volume } @@ -1822,6 +1838,9 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) { else if (x > leftGameplay && x < rightGameplay && y > bottomGameplay && y < topGameplay) { m_selectedOption = 2; // Gameplay } + else if (x > leftRetour && x < rightRetour && y > bottomRetour && y < topRetour) { + m_gamestate = GameState::MAIN_MENU; + } // Volume float leftBar = centerX - Width() * 0.15f; diff --git a/SQCSim2021/engine.h b/SQCSim2021/engine.h index b80cd64..093c4cb 100644 --- a/SQCSim2021/engine.h +++ b/SQCSim2021/engine.h @@ -92,6 +92,7 @@ private: Texture m_textureMultiText; Texture m_textureTitle; Texture m_textureOptions; + Texture m_textureRetour; Texture m_textureVolume; Texture m_textureMusique; Texture m_textureGraphiques; diff --git a/SQCSim2021/media/textures/Buttons/effets.png b/SQCSim2021/media/textures/Buttons/effets.png index 13d8166..30c8be6 100644 Binary files a/SQCSim2021/media/textures/Buttons/effets.png and b/SQCSim2021/media/textures/Buttons/effets.png differ diff --git a/SQCSim2021/media/textures/Buttons/gameplay.png b/SQCSim2021/media/textures/Buttons/gameplay.png index 7d5033a..687c857 100644 Binary files a/SQCSim2021/media/textures/Buttons/gameplay.png and b/SQCSim2021/media/textures/Buttons/gameplay.png differ diff --git a/SQCSim2021/media/textures/Buttons/graphiques.png b/SQCSim2021/media/textures/Buttons/graphiques.png index 0c69556..860179f 100644 Binary files a/SQCSim2021/media/textures/Buttons/graphiques.png and b/SQCSim2021/media/textures/Buttons/graphiques.png differ diff --git a/SQCSim2021/media/textures/Buttons/musique.png b/SQCSim2021/media/textures/Buttons/musique.png index 6624e59..37707b2 100644 Binary files a/SQCSim2021/media/textures/Buttons/musique.png and b/SQCSim2021/media/textures/Buttons/musique.png differ diff --git a/SQCSim2021/media/textures/Buttons/options.png b/SQCSim2021/media/textures/Buttons/options.png index 3055ff5..5c15729 100644 Binary files a/SQCSim2021/media/textures/Buttons/options.png and b/SQCSim2021/media/textures/Buttons/options.png differ diff --git a/SQCSim2021/media/textures/Buttons/principal.png b/SQCSim2021/media/textures/Buttons/principal.png index f1ecde7..ad06d7d 100644 Binary files a/SQCSim2021/media/textures/Buttons/principal.png and b/SQCSim2021/media/textures/Buttons/principal.png differ diff --git a/SQCSim2021/media/textures/Buttons/resolution.png b/SQCSim2021/media/textures/Buttons/resolution.png index 36739dc..8003a75 100644 Binary files a/SQCSim2021/media/textures/Buttons/resolution.png and b/SQCSim2021/media/textures/Buttons/resolution.png differ diff --git a/SQCSim2021/media/textures/Buttons/retour.png b/SQCSim2021/media/textures/Buttons/retour.png new file mode 100644 index 0000000..8f676d5 Binary files /dev/null and b/SQCSim2021/media/textures/Buttons/retour.png differ diff --git a/SQCSim2021/media/textures/Buttons/sensibilite.png b/SQCSim2021/media/textures/Buttons/sensibilite.png index a2da5b5..47208b6 100644 Binary files a/SQCSim2021/media/textures/Buttons/sensibilite.png and b/SQCSim2021/media/textures/Buttons/sensibilite.png differ diff --git a/SQCSim2021/media/textures/Buttons/volume.png b/SQCSim2021/media/textures/Buttons/volume.png index 30e03b0..043432c 100644 Binary files a/SQCSim2021/media/textures/Buttons/volume.png and b/SQCSim2021/media/textures/Buttons/volume.png differ