tely/asset: Update naming convention

This commit is contained in:
doyle 2023-09-24 11:38:46 +10:00
parent 3f33b015ab
commit ca6abb7684
41 changed files with 11 additions and 9 deletions

BIN
Data/Textures/sprite_spec.txt (Stored with Git LFS)

Binary file not shown.

BIN
Data/Textures/terry_movement.txt (Stored with Git LFS)

Binary file not shown.

BIN
Data/Textures/terry_walk.txt (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -407,7 +407,9 @@ void TELY_DLL_Init(void *user_data)
sheet->type = TELY_AssetSpriteSheetType_Rects; sheet->type = TELY_AssetSpriteSheetType_Rects;
// NOTE: Load the sprite meta file ========================================================= // NOTE: Load the sprite meta file =========================================================
Dqn_String8 sprite_spec_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/terry_movement.txt", DQN_STRING_FMT(assets->textures_dir)); Dqn_String8 sheet_name = DQN_STRING8("terry_walk");
Dqn_String8 sprite_spec_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/%.*s.txt", DQN_STRING_FMT(assets->textures_dir), DQN_STRING_FMT(sheet_name));
Dqn_String8 sprite_spec_buffer = platform->func_load_file(scratch.arena, sprite_spec_path); Dqn_String8 sprite_spec_buffer = platform->func_load_file(scratch.arena, sprite_spec_path);
Dqn_String8SplitAllocResult lines = Dqn_String8_SplitAlloc(scratch.allocator, sprite_spec_buffer, DQN_STRING8("\n")); Dqn_String8SplitAllocResult lines = Dqn_String8_SplitAlloc(scratch.allocator, sprite_spec_buffer, DQN_STRING8("\n"));
Dqn_usize sprite_rect_index = 0; Dqn_usize sprite_rect_index = 0;
@ -423,7 +425,7 @@ void TELY_DLL_Init(void *user_data)
// NOTE: Sprite sheet path // NOTE: Sprite sheet path
Dqn_String8 sprite_sheet_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/%.*s", DQN_STRING_FMT(assets->textures_dir), DQN_STRING_FMT(line_splits.data[1])); Dqn_String8 sprite_sheet_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/%.*s", DQN_STRING_FMT(assets->textures_dir), DQN_STRING_FMT(line_splits.data[1]));
sheet->tex_handle = platform->func_load_texture(assets, DQN_STRING8("Terry Movement"), sprite_sheet_path); sheet->tex_handle = platform->func_load_texture(assets, sheet_name, sprite_sheet_path);
DQN_ASSERTF(Dqn_Fs_Exists(sprite_sheet_path), "Required file does not exist '%.*s'", DQN_STRING_FMT(sprite_sheet_path)); DQN_ASSERTF(Dqn_Fs_Exists(sprite_sheet_path), "Required file does not exist '%.*s'", DQN_STRING_FMT(sprite_sheet_path));
// NOTE: Total sprite frame count // NOTE: Total sprite frame count
@ -871,7 +873,7 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_Renderer *renderer,
if (action->state == FP_GameEntityState_Idle) { if (action->state == FP_GameEntityState_Idle) {
if (action->flags & FP_GameEntityActionFlag_StateTransition) { if (action->flags & FP_GameEntityActionFlag_StateTransition) {
TELY_AssetSpriteAnimation *anim = entity->sprite_anims.data + TELY_Asset_GetSpriteAnimation(entity->sprite_anims, DQN_STRING8("Walk_idle")).index; TELY_AssetSpriteAnimation *anim = entity->sprite_anims.data + TELY_Asset_GetSpriteAnimation(entity->sprite_anims, DQN_STRING8("terry_walk_idle")).index;
FP_Game_EntityActionReset(action, FP_GAME_ENTITY_ACTION_INFINITE_TIMER, anim); FP_Game_EntityActionReset(action, FP_GAME_ENTITY_ACTION_INFINITE_TIMER, anim);
} else if (we_are_clicked_entity) { } else if (we_are_clicked_entity) {
if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_J)) { if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_J)) {
@ -927,7 +929,7 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_Renderer *renderer,
if (action->state == FP_GameEntityState_Run) { if (action->state == FP_GameEntityState_Run) {
if (action->flags & FP_GameEntityActionFlag_StateTransition) { if (action->flags & FP_GameEntityActionFlag_StateTransition) {
TELY_AssetSpriteAnimation *anim = entity->sprite_anims.data + TELY_Asset_GetSpriteAnimation(entity->sprite_anims, DQN_STRING8("Walk_right")).index; TELY_AssetSpriteAnimation *anim = entity->sprite_anims.data + TELY_Asset_GetSpriteAnimation(entity->sprite_anims, DQN_STRING8("terry_walk_right")).index;
FP_Game_EntityActionReset(action, FP_GAME_ENTITY_ACTION_INFINITE_TIMER, anim); FP_Game_EntityActionReset(action, FP_GAME_ENTITY_ACTION_INFINITE_TIMER, anim);
} else if (we_are_clicked_entity) { } else if (we_are_clicked_entity) {
if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_J)) { if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_J)) {

Binary file not shown.