afegit resource::cache
normalitzat Audio
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
|
||||
#include "core/audio/audio.hpp"
|
||||
#include "core/input/key_config.hpp"
|
||||
#include "core/jail/jail_audio.hpp"
|
||||
#include "core/jail/jdraw8.hpp"
|
||||
#include "core/jail/jfile.hpp"
|
||||
#include "core/jail/jgame.hpp"
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "core/rendering/menu.hpp"
|
||||
#include "core/rendering/overlay.hpp"
|
||||
#include "core/rendering/screen.hpp"
|
||||
#include "core/resources/resource_cache.hpp"
|
||||
#include "core/resources/resource_helper.hpp"
|
||||
#include "core/resources/resource_list.hpp"
|
||||
#include "core/system/director.hpp"
|
||||
#include "game/options.hpp"
|
||||
|
||||
@@ -90,10 +92,17 @@ SDL_AppResult SDL_AppInit(void** /*appstate*/, int /*argc*/, char* /*argv*/[]) {
|
||||
JG_Init();
|
||||
Screen::init();
|
||||
JD8_Init();
|
||||
JA_Init(48000, SDL_AUDIO_S16, 2);
|
||||
Options::applyAudio();
|
||||
Audio::init(); // crida internament JA_Init i aplica Options::audio
|
||||
Overlay::init();
|
||||
Menu::init();
|
||||
|
||||
// Manifest d'assets (data/config/assets.yaml) + Cache. La precarga
|
||||
// real es fa al BootLoaderScene, que el Director arrenca automàticament
|
||||
// mentre `Resource::Cache::isLoadDone()` siga fals.
|
||||
Resource::List::init("config/assets.yaml");
|
||||
Resource::Cache::init();
|
||||
Resource::Cache::get()->beginLoad();
|
||||
|
||||
Director::init();
|
||||
Director::get()->setup();
|
||||
|
||||
@@ -133,7 +142,9 @@ void SDL_AppQuit(void* /*appstate*/, SDL_AppResult /*result*/) {
|
||||
KeyConfig::destroy();
|
||||
Menu::destroy();
|
||||
Overlay::destroy();
|
||||
JA_Quit();
|
||||
Resource::Cache::destroy();
|
||||
Resource::List::destroy();
|
||||
Audio::destroy(); // el destructor del singleton crida JA_Quit
|
||||
JD8_Quit();
|
||||
Screen::destroy();
|
||||
JG_Finalize();
|
||||
|
||||
Reference in New Issue
Block a user