File deprecationfix.patch of Package ardentryst
Fix 10 deprecation warnings.
The following message...
/usr/share/games/ardentryst/ardentryst.py:<LINE>: DeprecationWarning: an
integer is required (got type float). Implicit conversion to integers using
__int__ is deprecated, and may be removed in a future version of Python.
... was triggered by these lines in ardentryst.py...
- Resume Quest screen, >14 saves present: lines 1367, 1373, 1378, 1384
- Eternal Boulder (save location): lines 2339, 2347, 2383
- Snodom reached on the map: lines 2745, 2778
- Kiripan floating down (endscene): line 2835.
Bug-Debian: https://bugs.debian.org/1005849
Signed-off-by: Jens Rottmann
--- ardentryst/ardentryst.py
+++ deprecationfix/ardentryst.py
@@ -1364,24 +1364,24 @@ def Game_SlotMenu(gameobj = None):
gsw = Fonts[16].render(torender+["","_"][newgame and (tick//20)%2 and x == cursor and not passwordstage], 1, (255,255,255))
gsb = Fonts[16].render(torender+["","_"][newgame and (tick//20)%2 and x == cursor and not passwordstage], 1, ( 0, 0, 0))
gsr = gsw.get_rect()
- gsr.midleft = (70, 100 + x * 25 - scroll_factor * 25)
+ gsr.midleft = (70, 100 + x * 25 - int(scroll_factor * 25))
if gsr.bottom < 450:
screen.blit(gsb, gsr)
screen.blit(gsw, gsr.move(-2,-2))
else:
more_arrow_visible = True
- crect.midleft = (65, 100 + cursor * 25 - scroll_factor * 25)
+ crect.midleft = (65, 100 + cursor * 25 - int(scroll_factor * 25))
screen.blit(csurf, crect)
if more_arrow_visible:
arrow, arrowrect = Data.images["Arrowmore.png"]
- arrowrect.center = (130, 450 + math.sin(tick/10.0)*5)
+ arrowrect.center = (130, 450 + int(math.sin(tick/10.0)*5.0))
screen.blit(arrow, arrowrect)
hand, handr = Data.images["hand.png"]
hand = pygame.transform.flip(hand, True, False)
- handr.midright = (int(60+abs(math.sin(tick/10.0))*10.0), 100 + cursor * 25 - scroll_factor * 25)
+ handr.midright = (60+int(abs(math.sin(tick/10.0))*10.0), 100 + cursor * 25 - int(scroll_factor * 25))
screen.blit(hand, handr)
inw = Fonts[9].render("Instructions: " + instructions, 1, (255,255,255))
@@ -2336,7 +2336,7 @@ def Save_intermission(game, pic, must = False, leavemus = False):
m_s = Fonts[16].render(vmsg, 1, (255,255,255))
m_sb = Fonts[16].render(vmsg, 1, (0,0,0))
m_r = m_s.get_rect()
- m_r.midleft = (320-Fonts[16].size(msg)[0]/2, 350)
+ m_r.midleft = (320-Fonts[16].size(msg)[0]//2, 350)
for xp in range(-1,2):
for yp in range(-1,2):
screen.blit(m_sb, m_r.move(xp,yp))
@@ -2344,7 +2344,7 @@ def Save_intermission(game, pic, must = False, leavemus = False):
npi, npi_r = Data.images["Next_Page_Icon.png"]
if ready:
- npi_r.center = (320, 400+abs(math.sin(tick/10.0)*15))
+ npi_r.center = (320, 400+int(abs(math.sin(tick/10.0)*15.0)))
screen.blit(npi, npi_r)
myflip()
@@ -2380,7 +2380,7 @@ def Save_intermission(game, pic, must = False, leavemus = False):
m_s = Fonts[16].render(vmsg, 1, (50,50,50))
m_sb = Fonts[16].render(vmsg, 1, (0,0,0))
m_r = m_s.get_rect()
- m_r.midleft = (320-Fonts[16].size(msg)[0]/2, 350+y)
+ m_r.midleft = (320-Fonts[16].size(msg)[0]//2, 350+y)
for xp in range(-1,2):
for yp in range(-1,2):
screen.blit(m_sb, m_r.move(xp,yp))
@@ -2742,7 +2742,7 @@ def handle_game(Game, loaded = False):
if Game.ENDSCENE:
screen.blit(Data.images["kiripan.png"][0], (290, 81 + Game.ENDSCENE))
elif Game.KIRI_HEIGHT:
- screen.blit(Data.images["kiripan.png"][0], (290, 141 - Game.KIRI_HEIGHT*60 + math.sin(tick/30.0)*6))
+ screen.blit(Data.images["kiripan.png"][0], (290, 141 - Game.KIRI_HEIGHT*60 + int(math.sin(tick/30.0)*6.0)))
else:
screen.blit(Data.images["kiripan.png"][0], (290, 141))
screen.blit(Data.images["maptop.png"][0], (0,0))
@@ -2775,7 +2775,7 @@ def handle_game(Game, loaded = False):
if Game.ENDSCENE:
screen.blit(Data.images["kiripan.png"][0], (290, 81 + Game.ENDSCENE))
elif Game.KIRI_HEIGHT:
- screen.blit(Data.images["kiripan.png"][0], (290, 141 - Game.KIRI_HEIGHT*60 + math.sin(tick/30.0)*6))
+ screen.blit(Data.images["kiripan.png"][0], (290, 141 - Game.KIRI_HEIGHT*60 + int(math.sin(tick/30.0)*6.0)))
else:
screen.blit(Data.images["kiripan.png"][0], (290, 141))
@@ -2832,7 +2832,7 @@ def handle_game(Game, loaded = False):
screen.blit(bgmap, (0,0))
if cloudlayer:
if Game.ENDSCENE:
- screen.blit(Data.images["kiripan.png"][0], (290, 81 + Game.ENDSCENE))
+ screen.blit(Data.images["kiripan.png"][0], (290, 81 + int(Game.ENDSCENE)))
elif Game.KIRI_HEIGHT:
screen.blit(Data.images["kiripan.png"][0], (290, int(141 - Game.KIRI_HEIGHT*60 + math.sin(tick/30.0)*6)))
else:
--