mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
improves battles loading time
This commit is contained in:
@@ -64,7 +64,6 @@ class Scene_Map
|
|||||||
|
|
||||||
#todo
|
#todo
|
||||||
def cacheNeedsClearing
|
def cacheNeedsClearing
|
||||||
p RPG::Cache.size
|
|
||||||
return RPG::Cache.size >= 100
|
return RPG::Cache.size >= 100
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbSceneStandby
|
def pbSceneStandby
|
||||||
$scene.disposeSpritesets if $scene.is_a?(Scene_Map)
|
$scene.disposeSpritesets if $scene.is_a?(Scene_Map)
|
||||||
RPG::Cache.clear
|
if RPG::Cache.need_clearing
|
||||||
|
RPG::Cache.clear
|
||||||
|
end
|
||||||
Graphics.frame_reset
|
Graphics.frame_reset
|
||||||
yield
|
yield
|
||||||
$scene.createSpritesets if $scene.is_a?(Scene_Map)
|
$scene.createSpritesets if $scene.is_a?(Scene_Map)
|
||||||
@@ -23,7 +25,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
|||||||
$game_system.bgs_pause
|
$game_system.bgs_pause
|
||||||
end
|
end
|
||||||
pbMEFade(0.25)
|
pbMEFade(0.25)
|
||||||
pbWait(Graphics.frame_rate/4)
|
#pbWait(Graphics.frame_rate/4)
|
||||||
pbMEStop
|
pbMEStop
|
||||||
# Play battle music
|
# Play battle music
|
||||||
bgm = pbGetWildBattleBGM([]) if !bgm
|
bgm = pbGetWildBattleBGM([]) if !bgm
|
||||||
@@ -113,7 +115,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
|||||||
$PokemonEncounters.reset_step_count
|
$PokemonEncounters.reset_step_count
|
||||||
# Fade back to the overworld
|
# Fade back to the overworld
|
||||||
viewport.color = Color.new(0,0,0,255)
|
viewport.color = Color.new(0,0,0,255)
|
||||||
numFrames = Graphics.frame_rate*4/10 # 0.4 seconds, 16 frames
|
numFrames = Graphics.frame_rate*1/10 #4/10 0.4 seconds, 16 frames
|
||||||
alphaDiff = (255.0/numFrames).ceil
|
alphaDiff = (255.0/numFrames).ceil
|
||||||
numFrames.times do
|
numFrames.times do
|
||||||
viewport.color.alpha -= alphaDiff
|
viewport.color.alpha -= alphaDiff
|
||||||
|
|||||||
Reference in New Issue
Block a user