mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixed Pokédex showing genders for the wrong species, fixed AI always switching sleeping/frozen Pokémon, fixed class PngAnimatedBitmap animating slowly
This commit is contained in:
@@ -48,14 +48,14 @@ class PngAnimatedBitmap
|
||||
if filename[/^\[(\d+)(?:,(\d+))?\]/] # Starts with 1 or 2 numbers in brackets
|
||||
# File has a frame count
|
||||
numFrames = $1.to_i
|
||||
duration = $2.to_i
|
||||
duration = $2.to_i # In 1/20ths of a second
|
||||
duration = 5 if duration == 0
|
||||
raise "Invalid frame count in #{filename}" if numFrames <= 0
|
||||
raise "Invalid frame duration in #{filename}" if duration <= 0
|
||||
if panorama.width % numFrames != 0
|
||||
raise "Bitmap's width (#{panorama.width}) is not divisible by frame count: #{filename}"
|
||||
end
|
||||
@frame_duration = duration
|
||||
@frame_duration = duration / 20.0
|
||||
subWidth = panorama.width / numFrames
|
||||
numFrames.times do |i|
|
||||
subBitmap = Bitmap.new(subWidth, panorama.height)
|
||||
@@ -99,7 +99,7 @@ class PngAnimatedBitmap
|
||||
|
||||
# Actually returns the total number of 1/20ths of a second this animation lasts.
|
||||
def totalFrames
|
||||
return @frame_duration * @frames.length
|
||||
return (@frame_duration * @frames.length * 20).to_i
|
||||
end
|
||||
|
||||
def each
|
||||
|
||||
Reference in New Issue
Block a user