From 83cac2afa1d43ec5aee23e6eb4bd831be5d83b32 Mon Sep 17 00:00:00 2001 From: doyle Date: Sun, 15 Oct 2023 23:12:41 +1100 Subject: [PATCH] fp: Remove old hero loading code --- feely_pona.cpp | 38 +------------------------------------- feely_pona_game.h | 2 -- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/feely_pona.cpp b/feely_pona.cpp index 060c9e4..f484e50 100644 --- a/feely_pona.cpp +++ b/feely_pona.cpp @@ -527,44 +527,8 @@ void TELY_DLL_Init(void *user_data) game->audio[FP_GameAudio_Monkey] = platform->func_load_audio(assets, DQN_STRING8("Monkey"), DQN_STRING8("Data/Audio/monkey.ogg")); game->audio[FP_GameAudio_PortalDestroy] = platform->func_load_audio(assets, DQN_STRING8("Portal Destroy"), DQN_STRING8("Data/Audio/portal_destroy.ogg")); - platform->user_data = game; - { - TELY_AssetSpriteSheet *sheet = &game->hero_sprite_sheet; - Dqn_ThreadScratch scratch = Dqn_Thread_GetScratch(nullptr); - Dqn_String8 sheet_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/adventurer-v1.5-sheet.png", DQN_STRING_FMT(assets->textures_dir)); - sheet->tex_handle = platform->func_load_texture(assets, DQN_STRING8("Hero"), sheet_path); - sheet->sprite_count = 109; - sheet->sprites_per_row = 7; - sheet->sprite_size = Dqn_V2I_InitNx2(50, 37); - - TELY_AssetSpriteAnimation hero_anims[] = { - {DQN_STRING8("Everything"), /*index*/ 0, /*count*/ sheet->sprite_count, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Idle"), /*index*/ 0, /*count*/ 3, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 4.f)}, - {DQN_STRING8("Run"), /*index*/ 8, /*count*/ 6, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 8.f)}, - {DQN_STRING8("Jump"), /*index*/ 14, /*count*/ 10, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Floor slide"), /*index*/ 24, /*count*/ 5, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Unknown"), /*index*/ 29, /*count*/ 9, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Attack A"), /*index*/ 42, /*count*/ 7, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Attack B"), /*index*/ 49, /*count*/ 4, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 8.f)}, - {DQN_STRING8("Attack C"), /*index*/ 53, /*count*/ 6, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Hurt A"), /*index*/ 59, /*count*/ 5, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Hurt B"), /*index*/ 64, /*count*/ 5, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Unsheath sword"), /*index*/ 69, /*count*/ 4, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Sheath sword"), /*index*/ 73, /*count*/ 4, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Air drift"), /*index*/ 77, /*count*/ 2, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Air drop"), /*index*/ 79, /*count*/ 2, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Ladder climb"), /*index*/ 81, /*count*/ 4, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Chi push"), /*index*/ 85, /*count*/ 8, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Leap slice A"), /*index*/ 93, /*count*/ 7, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Leap slice B"), /*index*/ 100, /*count*/ 3, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - {DQN_STRING8("Leap slice C"), /*index*/ 103, /*count*/ 6, /*ms_per_frame*/ DQN_CAST(uint32_t)(1000.f / 12.f)}, - }; - - game->hero_sprite_anims = Dqn_Slice_Alloc(&platform->arena, DQN_ARRAY_UCOUNT(hero_anims), Dqn_ZeroMem_No); - DQN_MEMCPY(game->hero_sprite_anims.data, &hero_anims, sizeof(hero_anims[0]) * DQN_ARRAY_UCOUNT(hero_anims)); - } - // NOTE: Load sprite sheets ==================================================================== + platform->user_data = game; game->atlas_sprite_sheet = FP_LoadSpriteSheetFromSpec(platform, assets, &platform->arena, DQN_STRING8("atlas")); FP_PlayReset(game, platform); } diff --git a/feely_pona_game.h b/feely_pona_game.h index cd5375c..67d0c7a 100644 --- a/feely_pona_game.h +++ b/feely_pona_game.h @@ -361,8 +361,6 @@ struct FP_Game TELY_AssetFontHandle talkco_font; TELY_AssetFontHandle talkco_font_large; TELY_AssetAudioHandle audio[FP_GameAudio_Count]; - Dqn_Slice hero_sprite_anims; - TELY_AssetSpriteSheet hero_sprite_sheet; TELY_AssetSpriteSheet atlas_sprite_sheet; TELY_RFui rfui; FP_GamePlay play;