1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Refactoring

This commit is contained in:
Shlomi Fish 2018-03-14 19:46:16 +02:00
parent 77a5b47e98
commit 1394c0df8f

View file

@ -1233,14 +1233,14 @@ class Game(object):
frames = 8 frames = 8
assert frames >= 2 assert frames >= 2
if self.app.opt.animations == 3: # medium if self.app.opt.animations == 3: # medium
frames = frames * 3 frames *= 3
SPF = SPF / 2 SPF /= 2
elif self.app.opt.animations == 4: # slow elif self.app.opt.animations == 4: # slow
frames = frames * 8 frames *= 8
SPF = SPF / 2 SPF /= 2
elif self.app.opt.animations == 5: # very slow elif self.app.opt.animations == 5: # very slow
frames = frames * 16 frames *= 16
SPF = SPF / 2 SPF /= 2
elif self.app.opt.animations == 10: elif self.app.opt.animations == 10:
# this is used internally in game preview to speed up # this is used internally in game preview to speed up
# the initial dealing # the initial dealing
@ -1490,12 +1490,8 @@ class Game(object):
xpos = x0 + int(xmid + r * math.cos(ang) - iw / 2.0) xpos = x0 + int(xmid + r * math.cos(ang) - iw / 2.0)
ypos = y0 + int(ymid + r * math.sin(ang) - ih / 2.0) ypos = y0 + int(ymid + r * math.sin(ang) - ih / 2.0)
if img_index & 1: k = (math.sin if img_index & 1 else math.cos)(f * 2.0 * math.pi)
k = math.sin(f * 2.0 * math.pi) k = max(0.4, k ** 2)
else:
k = math.cos(f * 2.0 * math.pi)
k = k * k
k = max(0.4, k)
round_k = int(round(k*100)) round_k = int(round(k*100))
if img_index not in saved_images: if img_index not in saved_images:
saved_images[img_index] = {} saved_images[img_index] = {}