1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-27 06:14:09 +00:00

Fix end_frame computation in osg_stats.py

If begin_frame is not the first frame then begin_frame + number of frames points
to a frame after end_frame with shift begin_frame - first_frame.
This commit is contained in:
elsid 2023-01-14 18:06:37 +01:00
parent d1c602ce85
commit 2a660be8a2
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -123,7 +123,7 @@ def collect_per_frame(sources, keys, begin_frame, end_frame, frame_number_name):
assert begin_frame < end_frame
result = collections.defaultdict(lambda: collections.defaultdict(list))
begin_frame = max(begin_frame, min(v[0][frame_number_name] for v in sources.values()))
end_frame = min(end_frame, begin_frame + max(len(v) for v in sources.values()))
end_frame = min(end_frame, max(v[-1][frame_number_name] for v in sources.values()) + 1)
for name in sources.keys():
for key in keys:
result[name][key] = [0] * (end_frame - begin_frame)