Compare commits

..

No commits in common. "7e9ad29be327012486b9744f59a62a13263f1060" and "eb90d7dbfa12813d2df010bdb9faa72c68f5191e" have entirely different histories.

5 changed files with 11 additions and 53 deletions

BIN
Data/Audio/terry_hit.ogg (Stored with Git LFS)

Binary file not shown.

2
External/tely vendored

@ -1 +1 @@
Subproject commit 63cd4aa4a04ec3adadf9778bd01d7e2a2ba04794
Subproject commit f4390f0a385345efc07297317539d5eb6e8c9c09

View File

@ -370,8 +370,7 @@ void TELY_DLL_Init(void *user_data)
game->inter_regular_font = platform->func_load_font(assets, DQN_STRING8("Inter (Regular)"), DQN_STRING8("Data/Inter-Regular.otf"), font_size);
game->inter_italic_font = platform->func_load_font(assets, DQN_STRING8("Inter (Italic)"), DQN_STRING8("Data/Inter-Italic.otf"), font_size);
game->jetbrains_mono_font = platform->func_load_font(assets, DQN_STRING8("JetBrains Mono NL (Regular)"), DQN_STRING8("Data/JetBrainsMonoNL-Regular.ttf"), font_size);
game->audio[FP_GameAudio_TestAudio] = platform->func_load_audio(assets, DQN_STRING8("Test Audio"), DQN_STRING8("Data/Audio/Purrple Cat - Moonwinds.qoa"));
game->audio[FP_GameAudio_TerryHit] = platform->func_load_audio(assets, DQN_STRING8("Terry Hit"), DQN_STRING8("Data/Audio/terry_hit.ogg"));
game->test_audio = platform->func_load_audio(assets, DQN_STRING8("Test Audio"), DQN_STRING8("Data/Audio/Purrple Cat - Moonwinds.qoa"));
}
void FP_EntityActionStateMachine(FP_Game *game, TELY_PlatformInput *input, FP_GameEntity *entity, Dqn_V2 dir_vector)
@ -506,7 +505,6 @@ void FP_EntityActionStateMachine(FP_Game *game, TELY_PlatformInput *input, FP_Ga
if (!entity->attack_processed && game->clock_ms >= midpoint_clock_ms) {
entity->attack_box_size = entity->local_hit_box_size;
FP_EnqueueSound(game, game->audio[FP_GameAudio_TerryHit], 1.0f);
// NOTE: Position the attack box
switch (entity->direction) {
case FP_GameDirection_Left: {
@ -1366,6 +1364,7 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
}
}
Dqn_Profiler_EndZone(update_zone);
}
void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer)
@ -1629,22 +1628,9 @@ void TELY_DLL_FrameUpdate(void *user_data)
// =============================================================================================
TELY_Audio *audio = &platform->audio;
// NOTE: Process the sound command queue
for (uint32_t i = 0; i < game->sound_command_count; i++)
{
FP_SoundCommand *sound_command = &game->sound_commands[i];
TELY_Audio_Play(audio, sound_command->audio_handle, sound_command->volume);
}
// NOTE: Clear the sound command queue for the next frame
game->sound_command_count = 0;
#if 0
if (audio->playback_size == 0) {
TELY_Audio_Play(audio, game->audio[FP_GameAudio_TestAudio], 1.f /*volume*/);
TELY_Audio_Play(audio, game->test_audio, 1.f /*volume*/);
}
#endif
// =============================================================================================
@ -1761,5 +1747,5 @@ void TELY_DLL_FrameUpdate(void *user_data)
}
TELY_RFui_Flush(rfui, renderer, input, assets);
TELY_Audio_MixPlaybackSamples(audio, assets);
//TELY_Audio_MixPlaybackSamples(audio, assets);
}

View File

@ -716,10 +716,3 @@ FP_GameFindClosestEntityResult FP_Game_FindClosestEntityWithType(FP_Game *game,
return result;
}
static void FP_EnqueueSound(FP_Game *game, TELY_AssetAudioHandle audio_handle, Dqn_f32 volume)
{
DQN_ASSERT(game->sound_command_count < MAX_SOUNDS);
FP_SoundCommand *sound_command = &game->sound_commands[game->sound_command_count++];
sound_command->audio_handle = audio_handle;
sound_command->volume = volume;
}

View File

@ -201,20 +201,6 @@ struct FP_GameCamera
Dqn_V2 scale;
};
enum FP_GameAudio
{
FP_GameAudio_TestAudio,
FP_GameAudio_TerryHit,
FP_GameAudio_Count,
};
struct FP_SoundCommand
{
TELY_AssetAudioHandle audio_handle;
float volume;
};
const uint32_t MAX_SOUNDS = 128;
struct FP_Game
{
Dqn_f32 delta_s_accumulator;
@ -223,11 +209,7 @@ struct FP_Game
TELY_AssetFontHandle inter_regular_font;
TELY_AssetFontHandle inter_italic_font;
TELY_AssetFontHandle jetbrains_mono_font;
TELY_AssetAudioHandle audio[FP_GameAudio_Count];
FP_SoundCommand sound_commands[MAX_SOUNDS];
uint32_t sound_command_count;
TELY_AssetAudioHandle test_audio;
Dqn_Slice<TELY_AssetSpriteAnimation> hero_sprite_anims;
TELY_AssetSpriteSheet hero_sprite_sheet;
Dqn_FArray<FP_GameEntityHandle, 8> parent_entity_stack;