From e8c0e94b790653bea90db1875fcc6056455df674 Mon Sep 17 00:00:00 2001 From: qweasdd136963 Date: Sun, 20 May 2018 20:19:31 +0500 Subject: [PATCH] Fixed text disappear on x64 (uninitialized variables) Fixed visibility indicator OpenAL: fixed sound stopping when game freezes/pauses --- src/xrGame/ui/UILines.cpp | 2 ++ src/xrGame/ui/UIProgressShape.cpp | 1 + src/xrSound/SoundRender_TargetA.cpp | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/src/xrGame/ui/UILines.cpp b/src/xrGame/ui/UILines.cpp index 53e76936bae..5b52886ca51 100644 --- a/src/xrGame/ui/UILines.cpp +++ b/src/xrGame/ui/UILines.cpp @@ -21,6 +21,8 @@ CUILines::CUILines() m_eVTextAlign = valTop; m_dwTextColor = 0xffffffff; m_TextOffset.set(0.0f, 0.0f); + m_wndSize.set(0.f, 0.f); + m_wndPos.set(0.f, 0.f); m_text = ""; uFlags.zero(); uFlags.set(flNeedReparse, FALSE); diff --git a/src/xrGame/ui/UIProgressShape.cpp b/src/xrGame/ui/UIProgressShape.cpp index 3eb74808d63..cb35f4129c2 100644 --- a/src/xrGame/ui/UIProgressShape.cpp +++ b/src/xrGame/ui/UIProgressShape.cpp @@ -13,6 +13,7 @@ CUIProgressShape::CUIProgressShape() m_blend = true; m_angle_begin = 0.0f; m_angle_end = PI_MUL_2; + m_stage = 0.f; }; CUIProgressShape::~CUIProgressShape() diff --git a/src/xrSound/SoundRender_TargetA.cpp b/src/xrSound/SoundRender_TargetA.cpp index 7d7eeca91c2..607c7606474 100644 --- a/src/xrSound/SoundRender_TargetA.cpp +++ b/src/xrSound/SoundRender_TargetA.cpp @@ -111,6 +111,17 @@ void CSoundRender_TargetA::update() A_CHK(alSourceQueueBuffers(pSource, 1, &BufferID)); --processed; } + + // kcat: If there's a long enough freeze and the sources underrun, they go to an AL_STOPPED state. + // That update function will correctly see this and remove/refill/requeue the buffers, but doesn't restart the source + // (that's in the separate else block that didn't run this time).Because the source remains AL_STOPPED, + // the next update will still see all the buffers marked as processed and remove / refill / requeue them again. + // It keeps doing this and never actually restarts the source after an underrun. + ALint state; + A_CHK(alGetSourcei(pSource, AL_SOURCE_STATE, &state)); + if (state == AL_STOPPED) + A_CHK(alSourcePlay(pSource)); + // } else {