Skip to content

Commit

Permalink
Call AudioManager::init/deinit when ES starts/ends and game ends
Browse files Browse the repository at this point in the history
  • Loading branch information
o-p-a committed Aug 28, 2024
1 parent 81c62c9 commit 2acbcc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions es-app/src/FileData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ void FileData::launchGame(Window* window)
window->init();
InputManager::getInstance()->init();
VolumeControl::getInstance()->init();
AudioManager::getInstance()->init();
window->normalizeNextUpdate();

//update number of times the game has been launched
Expand Down
3 changes: 3 additions & 0 deletions es-app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "Settings.h"
#include "SystemData.h"
#include "SystemScreenSaver.h"
#include "AudioManager.h"
#include <SDL_events.h>
#include <SDL_main.h>
#include <SDL_timer.h>
Expand Down Expand Up @@ -395,6 +396,7 @@ int main(int argc, char* argv[])
window.renderLoadingScreen("Done.");

InputManager::getInstance()->init();
AudioManager::getInstance()->init();

//choose which GUI to open depending on if an input configuration already exists
if(errorMsg == NULL)
Expand Down Expand Up @@ -467,6 +469,7 @@ int main(int argc, char* argv[])
while(window.peekGui() != ViewController::get())
delete window.peekGui();

AudioManager::getInstance()->deinit();
InputManager::getInstance()->deinit();
window.deinit();

Expand Down

0 comments on commit 2acbcc2

Please sign in to comment.