original editor compliance and some fixes

This commit is contained in:
2025-11-14 14:08:41 -05:00
parent 911085ef47
commit 5470368b6a
22 changed files with 202 additions and 78 deletions

View File

@@ -295,4 +295,18 @@ namespace anm2ed::anm2
if (frame.atFrame == atFrame) return i;
return -1;
}
float Item::frame_time_from_index_get(int index)
{
if (!vector::in_bounds(frames, index)) return 0.0f;
float time{};
for (auto [i, frame] : std::views::enumerate(frames))
{
if (i == index) return time;
time += frame.duration;
}
return time;
}
}

View File

@@ -26,5 +26,6 @@ namespace anm2ed::anm2
void frames_generate_from_grid(glm::ivec2, glm::ivec2, glm::ivec2, int, int, int);
void frames_sort_by_at_frame();
int frame_index_from_at_frame_get(int);
float frame_time_from_index_get(int);
};
}