Added clearing of the audio stream at some appropriate places.

Also made a constant explicitly floating point.
This commit is contained in:
Leon Styhre 2021-05-12 23:03:29 +02:00
parent 4465342724
commit c108387257
4 changed files with 8 additions and 2 deletions

View file

@ -652,6 +652,6 @@ void SystemScreensaver::generateOverlayInfo()
mGameOverlayRectangleCoords.clear();
mGameOverlayRectangleCoords.push_back(posX - marginX);
mGameOverlayRectangleCoords.push_back(posY);
mGameOverlayRectangleCoords.push_back(textSizeX + marginX * 2);
mGameOverlayRectangleCoords.push_back(textSizeX + marginX * 2.0f);
mGameOverlayRectangleCoords.push_back(textSizeY);
}

View file

@ -818,6 +818,7 @@ bool ViewController::input(InputConfig* config, Input input)
mCurrentView->stopListScrolling();
// Finally, if the camera is currently moving, reset its position.
cancelViewTransitions();
AudioManager::getInstance()->clearStream();
mWindow->pushGui(new GuiMenu(mWindow));
return true;
@ -841,6 +842,7 @@ void ViewController::update(int deltaTime)
updateSelf(deltaTime);
if (mGameToLaunch) {
AudioManager::getInstance()->clearStream();
launch(mGameToLaunch);
mGameToLaunch = nullptr;
}

View file

@ -11,6 +11,7 @@
#include "guis/GuiGamelistOptions.h"
#include "views/UIModeController.h"
#include "views/ViewController.h"
#include "AudioManager.h"
#include "Sound.h"
#include "Window.h"
@ -21,6 +22,7 @@ bool IGameListView::input(InputConfig* config, Input input)
config->isMappedTo("select", input) && input.value) {
ViewController::get()->cancelViewTransitions();
stopListScrolling();
AudioManager::getInstance()->clearStream();
mWindow->pushGui(new GuiGamelistOptions(mWindow, this->mRoot->getSystem()));
return true;
}

View file

@ -13,10 +13,11 @@
#include "components/ImageComponent.h"
#include "components/VideoVlcComponent.h"
#include "resources/Font.h"
#include "Sound.h"
#include "AudioManager.h"
#include "InputManager.h"
#include "Log.h"
#include "Scripting.h"
#include "Sound.h"
#include <algorithm>
#include <iomanip>
@ -679,6 +680,7 @@ void Window::startScreensaver()
(*it)->onScreensaverActivate();
stopInfoPopup();
AudioManager::getInstance()->clearStream();
mScreensaver->startScreensaver(true);
mRenderScreensaver = true;
}