diff --git a/platforms/windows/AppPlatform_windows.cpp b/platforms/windows/AppPlatform_windows.cpp index 95777a8..c61bc41 100644 --- a/platforms/windows/AppPlatform_windows.cpp +++ b/platforms/windows/AppPlatform_windows.cpp @@ -238,10 +238,6 @@ void AppPlatform_windows::recenterMouse() void AppPlatform_windows::setMouseGrabbed(bool b) { - // only if stuff has changed do we update - if (m_bGrabbedMouse == b) - return; - m_bGrabbedMouse = b; if (m_bActuallyGrabbedMouse == (b && m_bIsFocused)) diff --git a/platforms/windows/SoundSystem_windows.cpp b/platforms/windows/SoundSystem_windows.cpp index 226ff82..f545dc5 100644 --- a/platforms/windows/SoundSystem_windows.cpp +++ b/platforms/windows/SoundSystem_windows.cpp @@ -179,6 +179,30 @@ void SoundSystemWindows::playAt(const SoundDesc& sound, float x, float y, float return; } + // references: + // https://gamedev.net/forums/topic/337397-sound-volume-question-directsound/3243306/ + // https://learn.microsoft.com/en-us/previous-versions/windows/desktop/mt708939(v=vs.85) + // Conversion from 0-1 linear volume to directsound logarithmic volume.. + // This seems to work for the most part, but accuracy testing should be done for actual MCPE, water splashing is pretty quiet. + float attenuation = volume;//Lerp(DSBVOLUME_MIN, DSBVOLUME_MAX, volume); + + // clamp the attenuation value + if (attenuation < 0.0f) + attenuation = 0.0f; + else if (attenuation > 1.0f) + attenuation = 1.0f; + + if (attenuation == 0) + { + // no sound would come out, maybe skip playing this sound? + attenuation = DSBVOLUME_MIN; + } + else + { + attenuation = floorf(2000.0f * log10f(attenuation) + 0.5f); + } + (*soundbuffer)->SetVolume(LONG(attenuation)); + (*soundbuffer)->Play(0, 0, 0); m_buffers.push_back(soundbuffer); } diff --git a/source/GUI/Screen/PauseScreen.cpp b/source/GUI/Screen/PauseScreen.cpp index 0cb596b..5a90466 100644 --- a/source/GUI/Screen/PauseScreen.cpp +++ b/source/GUI/Screen/PauseScreen.cpp @@ -41,7 +41,7 @@ void PauseScreen::init() #ifdef ENH_ADD_OPTIONS_PAUSE // TODO: when visible or quit© are on, lower this m_btnOptions.m_width = 160; - m_btnOptions.m_yPos = 144; + m_btnOptions.m_yPos = 112; m_btnOptions.m_xPos = m_btnBack.m_xPos; #endif @@ -55,10 +55,13 @@ void PauseScreen::init() //m_buttons.push_back(&m_btnQuitAndCopy); - if (m_pMinecraft->m_pRakNetInstance) + if (m_pMinecraft->m_pRakNetInstance && m_pMinecraft->m_pRakNetInstance->m_bIsHost) { updateServerVisibilityText(); m_buttons.push_back(&m_btnVisible); +#ifdef ENH_ADD_OPTIONS_PAUSE + m_btnOptions.m_yPos += 32; +#endif } for (auto thing : m_buttons) diff --git a/source/Renderer/GameRenderer.cpp b/source/Renderer/GameRenderer.cpp index 58a3a95..15cadd5 100644 --- a/source/Renderer/GameRenderer.cpp +++ b/source/Renderer/GameRenderer.cpp @@ -432,6 +432,10 @@ void GameRenderer::renderLevel(float f) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); setupFog(0); +#ifndef ORIGINAL_CODE + glShadeModel(GL_SMOOTH); +#endif + glEnable(GL_BLEND); glDisable(GL_CULL_FACE); // glDepthMask(false); -- added in 0.1.1j. Introduces more issues than fixes @@ -441,7 +445,11 @@ void GameRenderer::renderLevel(float f) pLR->render(pMob, 1, f); glDepthMask(true); - + + +#ifndef ORIGINAL_CODE + glShadeModel(GL_FLAT); +#endif glEnable(GL_CULL_FACE); glDisable(GL_BLEND);