mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-22 06:06:01 +00:00
Removed unused audio utilities and audio-recording (e.g. for Chatter)
This commit is contained in:
@@ -270,57 +270,24 @@ end
|
||||
|
||||
|
||||
|
||||
# A safer version of RPG::Cache, this module loads bitmaps that keep an internal
|
||||
# reference count. Each call to dispose decrements the reference count and the
|
||||
# bitmap is freed when the reference count reaches 0.
|
||||
class Thread
|
||||
def Thread.exclusive
|
||||
old_thread_status = Thread.critical
|
||||
begin
|
||||
Thread.critical = true
|
||||
return yield
|
||||
ensure
|
||||
Thread.critical = old_thread_status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class BitmapWrapper < Bitmap
|
||||
attr_reader :refcount
|
||||
|
||||
@@disposedBitmaps={}
|
||||
@@keys={}
|
||||
=begin
|
||||
@@final = lambda { |id|
|
||||
Thread.exclusive {
|
||||
if @@disposedBitmaps[id]!=true
|
||||
File.open("debug.txt","ab") { |f|
|
||||
f.write("Bitmap finalized without being disposed: #{@@keys[id]}\r\n")
|
||||
}
|
||||
end
|
||||
@@disposedBitmaps[id]=nil
|
||||
}
|
||||
}
|
||||
=end
|
||||
attr_reader :refcount
|
||||
|
||||
def dispose
|
||||
return if self.disposed?
|
||||
@refcount-=1
|
||||
if @refcount==0
|
||||
super
|
||||
#Thread.exclusive { @@disposedBitmaps[__id__]=true }
|
||||
end
|
||||
super if @refcount==0
|
||||
end
|
||||
|
||||
def initialize(*arg)
|
||||
super
|
||||
@refcount=1
|
||||
#Thread.exclusive { @@keys[__id__]=arg.inspect+caller(1).inspect }
|
||||
#ObjectSpace.define_finalizer(self,@@final)
|
||||
end
|
||||
|
||||
def resetRef # internal
|
||||
def resetRef
|
||||
@refcount=1
|
||||
end
|
||||
|
||||
|
||||
@@ -600,6 +600,22 @@ def pbFadeOutInWithUpdate(z,sprites,nofadeout=false)
|
||||
end
|
||||
end
|
||||
|
||||
# Similar to pbFadeOutIn, but pauses the music as it fades out.
|
||||
# Requires scripts "Audio" (for bgm_pause) and "SpriteWindow" (for pbFadeOutIn).
|
||||
def pbFadeOutInWithMusic(zViewport=99999)
|
||||
playingBGS = $game_system.getPlayingBGS
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
$game_system.bgm_pause(1.0)
|
||||
$game_system.bgs_pause(1.0)
|
||||
pos = $game_system.bgm_position
|
||||
pbFadeOutIn(zViewport) {
|
||||
yield
|
||||
$game_system.bgm_position = pos
|
||||
$game_system.bgm_resume(playingBGM)
|
||||
$game_system.bgs_resume(playingBGS)
|
||||
}
|
||||
end
|
||||
|
||||
def pbFadeOutAndHide(sprites)
|
||||
visiblesprites = {}
|
||||
numFrames = (Graphics.frame_rate*0.4).floor
|
||||
|
||||
@@ -1081,25 +1081,6 @@ def drawFormattedTextEx(bitmap,x,y,width,text,baseColor=nil,shadowColor=nil,line
|
||||
drawFormattedChars(bitmap,chars)
|
||||
end
|
||||
|
||||
# Deprecated -- not to be used in new code
|
||||
def coloredToFormattedText(text,baseColor=nil,shadowColor=nil)
|
||||
base=!baseColor ? Color.new(12*8,12*8,12*8) : baseColor.clone
|
||||
shadow=!shadowColor ? Color.new(26*8,26*8,25*8) : shadowColor.clone
|
||||
text2=text.gsub(/&/,"&")
|
||||
text2.gsub!(/</,"<")
|
||||
text2.gsub!(/>/,">")
|
||||
text2.gsub!(/\\\[([A-Fa-f0-9]{8,8})\]/) { "<c2="+$1+">" }
|
||||
text2="<c2="+colorToRgb16(base)+colorToRgb16(shadow)+">"+text2
|
||||
text2.gsub!(/\\\\/,"\\")
|
||||
return text2
|
||||
end
|
||||
|
||||
# Deprecated -- not to be used in new code
|
||||
def drawColoredTextEx(bitmap,x,y,width,text,_baseColor=nil,_shadowColor=nil)
|
||||
chars=getFormattedText(bitmap,x,y,width,-1,coloredToFormattedText(text),32)
|
||||
drawFormattedChars(bitmap,chars)
|
||||
end
|
||||
|
||||
def pbDrawShadow(bitmap,x,y,width,height,string)
|
||||
return if !bitmap || !string
|
||||
pbDrawShadowText(bitmap,x,y,width,height,string,nil,bitmap.font.color)
|
||||
|
||||
@@ -732,9 +732,6 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
|
||||
Graphics.update
|
||||
Input.update
|
||||
facewindow.update if facewindow
|
||||
if $DEBUG && Input.trigger?(Input::F6)
|
||||
pbRecord(unformattedText)
|
||||
end
|
||||
if autoresume && msgwindow.waitcount==0
|
||||
msgwindow.resume if msgwindow.busy?
|
||||
break if !msgwindow.busy?
|
||||
|
||||
Reference in New Issue
Block a user