mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Yet more Rubocopping
This commit is contained in:
@@ -138,7 +138,7 @@ def getPlayTime2(filename)
|
||||
loop do
|
||||
rstr = ""
|
||||
ateof = false
|
||||
while !file.eof?
|
||||
until file.eof?
|
||||
if (file.read(1)[0] rescue 0) == 0xFF
|
||||
begin
|
||||
rstr = file.read(3)
|
||||
@@ -152,14 +152,14 @@ def getPlayTime2(filename)
|
||||
if rstr[0] == 0xFB
|
||||
t = rstr[1] >> 4
|
||||
next if [0, 15].include?(t)
|
||||
freqs = [44100, 22050, 11025, 48000]
|
||||
freqs = [44_100, 22_050, 11_025, 48_000]
|
||||
bitrates = [32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320]
|
||||
bitrate = bitrates[t]
|
||||
t = (rstr[1] >> 2) & 3
|
||||
freq = freqs[t]
|
||||
t = (rstr[1] >> 1) & 1
|
||||
filesize = FileTest.size(filename)
|
||||
frameLength = ((144000 * bitrate) / freq) + t
|
||||
frameLength = ((144_000 * bitrate) / freq) + t
|
||||
numFrames = filesize / (frameLength + 4)
|
||||
time = (numFrames * 1152.0 / freq)
|
||||
break
|
||||
|
||||
@@ -58,7 +58,7 @@ def pbBGMPlay(param, volume = nil, pitch = nil)
|
||||
return
|
||||
elsif (RPG.const_defined?(:BGM) rescue false)
|
||||
b = RPG::BGM.new(param.name, param.volume, param.pitch)
|
||||
if b && b.respond_to?("play")
|
||||
if b&.respond_to?("play")
|
||||
b.play
|
||||
return
|
||||
end
|
||||
@@ -108,7 +108,7 @@ def pbMEPlay(param, volume = nil, pitch = nil)
|
||||
return
|
||||
elsif (RPG.const_defined?(:ME) rescue false)
|
||||
b = RPG::ME.new(param.name, param.volume, param.pitch)
|
||||
if b && b.respond_to?("play")
|
||||
if b&.respond_to?("play")
|
||||
b.play
|
||||
return
|
||||
end
|
||||
@@ -125,7 +125,7 @@ def pbMEStop(timeInSeconds = 0.0)
|
||||
if $game_system && timeInSeconds > 0.0 && $game_system.respond_to?("me_fade")
|
||||
$game_system.me_fade(timeInSeconds)
|
||||
return
|
||||
elsif $game_system && $game_system.respond_to?("me_stop")
|
||||
elsif $game_system&.respond_to?("me_stop")
|
||||
$game_system.me_stop(nil)
|
||||
return
|
||||
elsif (RPG.const_defined?(:ME) rescue false)
|
||||
@@ -158,7 +158,7 @@ def pbBGSPlay(param, volume = nil, pitch = nil)
|
||||
return
|
||||
elsif (RPG.const_defined?(:BGS) rescue false)
|
||||
b = RPG::BGS.new(param.name, param.volume, param.pitch)
|
||||
if b && b.respond_to?("play")
|
||||
if b&.respond_to?("play")
|
||||
b.play
|
||||
return
|
||||
end
|
||||
@@ -209,7 +209,7 @@ def pbSEPlay(param, volume = nil, pitch = nil)
|
||||
end
|
||||
if (RPG.const_defined?(:SE) rescue false)
|
||||
b = RPG::SE.new(param.name, param.volume, param.pitch)
|
||||
if b && b.respond_to?("play")
|
||||
if b&.respond_to?("play")
|
||||
b.play
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user