Simplify some

This commit is contained in:
Gouvernathor 2024-04-04 22:37:33 +02:00
parent b49129ad1f
commit 878cec8c76

View File

@ -274,10 +274,9 @@ init 5 python:
return
# Freezes the animation
path, _, _, _ = self.atl_partial.args
pos = path[-1]
xzoom = -1 if (path[-1] > path[-2]) else 1
zpos = self.zorder + (1.0 / (pos[1] / config.screen_height))
(*_, opos, pos), _, _, _ = self.atl_partial.args
xzoom = -1 if (pos > opos) else 1
zpos = self.zorder + (config.screen_height / pos[1])
self.pos = pos
self.xzoom = xzoom
@ -316,14 +315,16 @@ init 5 python:
segment_time = (timer - internal_time) / times[current_segment]
next_segment = current_segment + 1
path_current_segment = path[current_segment]
path_next_segment = path[next_segment]
# Adjust XY position
trans.pos = renpy.atl.interpolate(warper(segment_time), path[current_segment], path[next_segment], renpy.atl.PROPERTIES["pos"])
trans.pos = renpy.atl.interpolate(warper(segment_time), path_current_segment, path_next_segment, renpy.atl.PROPERTIES["pos"])
self.pos = trans.pos
# Adjust X zoom based on target X position
# 1 = Facing Right, -1 = Facing Left
trans.xzoom = 1 if (path[current_segment][0] > path[next_segment][0]) else -1
trans.xzoom = 1 if (path_current_segment[0] > path_next_segment[0]) else -1
self.xzoom = trans.xzoom
# Adjust zoom
@ -332,13 +333,13 @@ init 5 python:
# Adjust Z position based on Y axis
# TODO: Add room support with bottom, middle, and top vanishing points.
# room_scale = 0.5
# zpos1 = ((path[current_segment][1] / 600.0) * 1000.0) * room_scale
# zpos2 = ((path[next_segment][1] / 600.0) * 1000.0) * room_scale
# zpos1 = ((path_current_segment[1] / 600.0) * 1000.0) * room_scale
# zpos2 = ((path_next_segment[1] / 600.0) * 1000.0) * room_scale
# trans.zpos = renpy.atl.interpolate(warper(segment_time), zpos1, zpos2, renpy.atl.PROPERTIES["zpos"])
# self.zpos = trans.zpos
# TODO: Using zorders is suboptimal and expensive, using 3D staging would be preferable.
zpos = self.zorder + (1.0 / (self.pos[1] / config.screen_height))
zpos = self.zorder + (config.screen_height / self.pos[1])
renpy.change_zorder(self.layer, self.tag, zpos)
return 0