Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self._tracked_gids.add(gid)
frames = list()
for frame_gid, frame_duration in frame_data:
image = self._get_tile_image_by_id(frame_gid)
frames.append(AnimationFrame(image, frame_duration))
# the following line is slow when loading maps, but avoids overhead when rendering
# positions = set(self.tmx.get_tile_locations_by_gid(gid))
# ideally, positions would be populated with all the known
# locations of an animation, but searching for their locations
# is slow. so it will be updated as the map is drawn.
positions = set()
ani = AnimationToken(positions, frames, self._last_time)
self._animation_map[gid] = ani
heappush(self._animation_queue, ani)