Push options resolution fonctionnels.
This commit is contained in:
@@ -2351,21 +2351,23 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) {
|
||||
float topChkUHD = centerY + Height() * 0.025f;
|
||||
float bottomChkUHD = centerY;
|
||||
|
||||
if (m_selectedOption == 1 && x > leftChk && x < rightChk && y > bottomChkHD && y < topChkHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
m_resolution = HD;
|
||||
}
|
||||
else if (m_selectedOption == 1 && x > leftChk && x < rightChk && y > bottomChkFHD && y < topChkFHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
m_resolution = FHD;
|
||||
}
|
||||
else if (m_selectedOption == 1 && x > leftChk && x < rightChk && y > bottomChkQHD && y < topChkQHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
m_resolution = QHD;
|
||||
}
|
||||
else if (m_selectedOption == 1 && x > leftChk && x < rightChk && y > bottomChkUHD && y < topChkUHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
m_resolution = UHD;
|
||||
if (m_selectedOption == 1) {
|
||||
if (x > leftChk && x < rightChk && y > bottomChkHD && y < topChkHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
ChangeResolution(HD);
|
||||
}
|
||||
else if (x > leftChk && x < rightChk && y > bottomChkFHD && y < topChkFHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
ChangeResolution(FHD);
|
||||
}
|
||||
else if (x > leftChk && x < rightChk && y > bottomChkQHD && y < topChkQHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
ChangeResolution(QHD);
|
||||
}
|
||||
else if (x > leftChk && x < rightChk && y > bottomChkUHD && y < topChkUHD) {
|
||||
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
|
||||
ChangeResolution(UHD);
|
||||
}
|
||||
}
|
||||
|
||||
if (normalizedPosition < 0.1f) {
|
||||
@@ -2503,4 +2505,29 @@ bool Engine::LoadTexture(Texture& texture, const std::string& filename, bool use
|
||||
return true;
|
||||
}
|
||||
|
||||
void Engine::ChangeResolution(Resolution resolution) {
|
||||
DeInit();
|
||||
|
||||
switch (resolution) {
|
||||
case HD:
|
||||
OpenglContext::InitWindow(1280, 720);
|
||||
m_resolution = HD;
|
||||
break;
|
||||
case FHD:
|
||||
OpenglContext::InitWindow(1920, 1080);
|
||||
m_resolution = FHD;
|
||||
break;
|
||||
case QHD:
|
||||
OpenglContext::InitWindow(2560, 1440);
|
||||
m_resolution = QHD;
|
||||
break;
|
||||
case UHD:
|
||||
OpenglContext::InitWindow(3840, 2160);
|
||||
m_resolution = UHD;
|
||||
break;
|
||||
}
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user