original editor compliance and some fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user