fp: Async load audio

This commit is contained in:
doyle 2023-11-26 23:45:50 +11:00
parent 13d356cbfd
commit 00986fa6a1
3 changed files with 23 additions and 22 deletions

2
External/tely vendored

@ -1 +1 @@
Subproject commit f44961368e19df96e9a8c350d22e9830d126554a
Subproject commit d9fcabd2e58f38051dd39bc52bd3ea7ef1681466

View File

@ -424,6 +424,7 @@ void TELY_OS_DLLInit(TELY_OS *os)
// NOTE: TELY Game =============================================================================
TELY_Assets *assets = &os->assets;
assets->chunk_pool = &os->chunk_pool;
FP_Game *game = Dqn_Arena_New(&os->arena, FP_Game, Dqn_ZeroMem_Yes);
Dqn_f32 font_scalar = FP_TARGET_VIEWPORT_SIZE.w / DQN_CAST(Dqn_f32)os->core.window_size.x;
@ -437,27 +438,27 @@ void TELY_OS_DLLInit(TELY_OS *os)
game->jetbrains_mono_font = TELY_Asset_LoadFont(assets, DQN_STR8("JetBrains Mono NL (Regular)"), DQN_STR8("Data/Fonts/JetBrainsMonoNL-Regular.ttf"));
game->talkco_font = TELY_Asset_LoadFont(assets, DQN_STR8("Talkco"), DQN_STR8("Data/Fonts/Talkco.otf"));
game->audio[FP_GameAudio_TerryHit] = os->funcs.load_audio(assets, DQN_STR8("Terry Hit"), DQN_STR8("Data/Audio/terry_hit.ogg"));
game->audio[FP_GameAudio_Ching] = os->funcs.load_audio(assets, DQN_STR8("Ching"), DQN_STR8("Data/Audio/ching.ogg"));
game->audio[FP_GameAudio_Church] = os->funcs.load_audio(assets, DQN_STR8("Church"), DQN_STR8("Data/Audio/church.ogg"));
game->audio[FP_GameAudio_Club] = os->funcs.load_audio(assets, DQN_STR8("Club"), DQN_STR8("Data/Audio/club_terry.ogg"));
game->audio[FP_GameAudio_Dog] = os->funcs.load_audio(assets, DQN_STR8("Dog"), DQN_STR8("Data/Audio/dog.ogg"));
game->audio[FP_GameAudio_MerchantGhost] = os->funcs.load_audio(assets, DQN_STR8("Ghost"), DQN_STR8("Data/Audio/merchant_ghost.ogg"));
game->audio[FP_GameAudio_MerchantGym] = os->funcs.load_audio(assets, DQN_STR8("Gym"), DQN_STR8("Data/Audio/merchant_gym.ogg"));
game->audio[FP_GameAudio_MerchantPhone] = os->funcs.load_audio(assets, DQN_STR8("Phone"), DQN_STR8("Data/Audio/merchant_tech.ogg"));
game->audio[FP_GameAudio_MerchantTerry] = os->funcs.load_audio(assets, DQN_STR8("Door"), DQN_STR8("Data/Audio/merchant_terry.ogg"));
game->audio[FP_GameAudio_Message] = os->funcs.load_audio(assets, DQN_STR8("Message"), DQN_STR8("Data/Audio/message.ogg"));
game->audio[FP_GameAudio_Monkey] = os->funcs.load_audio(assets, DQN_STR8("Monkey"), DQN_STR8("Data/Audio/monkey.ogg"));
game->audio[FP_GameAudio_Plane] = os->funcs.load_audio(assets, DQN_STR8("Plane"), DQN_STR8("Data/Audio/airport.ogg"));
game->audio[FP_GameAudio_PortalDestroy] = os->funcs.load_audio(assets, DQN_STR8("Portal Destroy"), DQN_STR8("Data/Audio/portal_destroy.ogg"));
game->audio[FP_GameAudio_Smooch] = os->funcs.load_audio(assets, DQN_STR8("Smooch"), DQN_STR8("Data/Audio/smooch.ogg"));
game->audio[FP_GameAudio_Woosh] = os->funcs.load_audio(assets, DQN_STR8("Woosh"), DQN_STR8("Data/Audio/woosh.ogg"));
game->audio[FP_GameAudio_GameStart] = os->funcs.load_audio(assets, DQN_STR8("Game Start"), DQN_STR8("Data/Audio/game_start.ogg"));
game->audio[FP_GameAudio_PerryStart] = os->funcs.load_audio(assets, DQN_STR8("Perry Start"), DQN_STR8("Data/Audio/perry_start.ogg"));
game->audio[FP_GameAudio_Ambience1] = os->funcs.load_audio(assets, DQN_STR8("Ambience one"), DQN_STR8("Data/Audio/ambience_1.ogg"));
game->audio[FP_GameAudio_Ambience2] = os->funcs.load_audio(assets, DQN_STR8("Ambience two"), DQN_STR8("Data/Audio/ambience_2.ogg"));
game->audio[FP_GameAudio_Music1] = os->funcs.load_audio(assets, DQN_STR8("Music one"), DQN_STR8("Data/Audio/music_1.ogg"));
game->audio[FP_GameAudio_Music2] = os->funcs.load_audio(assets, DQN_STR8("Music two"), DQN_STR8("Data/Audio/music_2.ogg"));
game->audio[FP_GameAudio_TerryHit] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Terry Hit"), DQN_STR8("Data/Audio/terry_hit.ogg"));
game->audio[FP_GameAudio_Ching] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Ching"), DQN_STR8("Data/Audio/ching.ogg"));
game->audio[FP_GameAudio_Church] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Church"), DQN_STR8("Data/Audio/church.ogg"));
game->audio[FP_GameAudio_Club] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Club"), DQN_STR8("Data/Audio/club_terry.ogg"));
game->audio[FP_GameAudio_Dog] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Dog"), DQN_STR8("Data/Audio/dog.ogg"));
game->audio[FP_GameAudio_MerchantGhost] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Ghost"), DQN_STR8("Data/Audio/merchant_ghost.ogg"));
game->audio[FP_GameAudio_MerchantGym] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Gym"), DQN_STR8("Data/Audio/merchant_gym.ogg"));
game->audio[FP_GameAudio_MerchantPhone] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Phone"), DQN_STR8("Data/Audio/merchant_tech.ogg"));
game->audio[FP_GameAudio_MerchantTerry] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Door"), DQN_STR8("Data/Audio/merchant_terry.ogg"));
game->audio[FP_GameAudio_Message] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Message"), DQN_STR8("Data/Audio/message.ogg"));
game->audio[FP_GameAudio_Monkey] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Monkey"), DQN_STR8("Data/Audio/monkey.ogg"));
game->audio[FP_GameAudio_Plane] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Plane"), DQN_STR8("Data/Audio/airport.ogg"));
game->audio[FP_GameAudio_PortalDestroy] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Portal Destroy"), DQN_STR8("Data/Audio/portal_destroy.ogg"));
game->audio[FP_GameAudio_Smooch] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Smooch"), DQN_STR8("Data/Audio/smooch.ogg"));
game->audio[FP_GameAudio_Woosh] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Woosh"), DQN_STR8("Data/Audio/woosh.ogg"));
game->audio[FP_GameAudio_GameStart] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Game Start"), DQN_STR8("Data/Audio/game_start.ogg"));
game->audio[FP_GameAudio_PerryStart] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Perry Start"), DQN_STR8("Data/Audio/perry_start.ogg"));
game->audio[FP_GameAudio_Ambience1] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Ambience one"), DQN_STR8("Data/Audio/ambience_1.ogg"));
game->audio[FP_GameAudio_Ambience2] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Ambience two"), DQN_STR8("Data/Audio/ambience_2.ogg"));
game->audio[FP_GameAudio_Music1] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Music one"), DQN_STR8("Data/Audio/music_1.ogg"));
game->audio[FP_GameAudio_Music2] = TELY_Asset_LoadAudio(assets, os, DQN_STR8("Music two"), DQN_STR8("Data/Audio/music_2.ogg"));
// NOTE: Load sprite sheets ====================================================================
os->user_data = game;

Binary file not shown.