#◆◇◆◇◆ アニメFPS変更スクリプトVX ver 1.01 ◇◆◇◆◇ # サポート掲示板 http://www2.ezbbs.net/21/minto-aaa/ # by みんと =begin ■ 更新履歴 ○ ver 1.01(2009/05/01) マップ時にエラー落ちするミスを修正 ○ ver 1.00(2009/04/29) 公開 ※ 導入場所の注意 再定義で構成されていますので、 システム上部(マスタースクリプトの真下推奨)に導入してください。 ■ 説明 ツクールVXは秒間60FPS更新ですが、 アニメ更新FPSは秒間15とツクールシリーズの中では過去最も遅い数値です。 このスクリプトはアニメ再生FPSを変更します。 アニメの再生リミッターレベルは5段階あり、以下の通りです。 ・レベル 0 アニメの再生リミッターを解除します。 ツクールVX本来の秒間60FPSでアニメを再生します。 ・レベル 1 秒間40FPSでアニメを再生します。 ・レベル 2 秒間30FPSでアニメを再生します。 ・レベル 3 秒間20FPSでアニメを再生します。 ツクールXPのアニメ再生FPSと同じです。 ツクールXPと同じ感覚でアニメの製作ができます(オススメ) ・レベル 4 秒間15FPSでアニメを再生します。 ツクールVXデフォルトです。 ※ イベントコマンドのウェイトは秒間60FPSです。 =end #============================================================================== # ☆ MINTO #------------------------------------------------------------------------------ # 様々なフラグを扱うメインモジュールです。 #============================================================================== module MINTO # アニメFPS変更スクリプトVXを有効化 ( true で有効 / false で無効 ) RGSS["アニメFPS変更スクリプトVX"] = true end # アニメFPS変更スクリプトVXが有効な場合に以降の処理を実行する if MINTO::RGSS["アニメFPS変更スクリプトVX"] == true then #============================================================================== # ☆ カスタマイズ #------------------------------------------------------------------------------ # 機能のカスタマイズをここで行います。 #============================================================================== module MINTO # アニメ再生リミッターレベル Anima_Limitar = 3 end #============================================================================== # ■ Sprite_Base #------------------------------------------------------------------------------ #  アニメーションの表示処理を追加したスプライトのクラスです。 #============================================================================== class Sprite_Base < Sprite #-------------------------------------------------------------------------- # ● フラッシュ # flash_target : フラッシュ対象 # flash_color : フラッシュカラー # timing : タイミングデータ (RPG::Animation::Timing) #-------------------------------------------------------------------------- def anima_flash(flash_target, timing, flash_color) case MINTO::Anima_Limitar # 60FPS when 0 flash_target.flash(flash_color, timing.flash_duration) # 40FPS when 1 flash_target.flash(flash_color, ((timing.flash_duration * 3) / 2)) # 30FPS when 2 flash_target.flash(flash_color, timing.flash_duration * 2) # 20FPS when 3 flash_target.flash(flash_color, timing.flash_duration * 3) # 15FPS when 4 flash_target.flash(flash_color, timing.flash_duration * 4) end end #-------------------------------------------------------------------------- # ● アニメ更新可能判定 #-------------------------------------------------------------------------- def anima_update? case MINTO::Anima_Limitar # 60FPS when 0 return true # 40FPS when 1 return ((((Graphics.frame_count * 2) / 3) % 2).zero?) # 30FPS when 2 return ((Graphics.frame_count % 2).zero?) # 20FPS when 3 return ((Graphics.frame_count % 3).zero?) # 15FPS when 4 return ((Graphics.frame_count % 4).zero?) end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super unless @animation.nil? if anima_update? then update_animation @animation_duration -= 1 end end @@animations.clear end #-------------------------------------------------------------------------- # ● アニメーションの開始 #-------------------------------------------------------------------------- def start_animation(animation, mirror = false) dispose_animation @animation = animation return if @animation == nil @animation_mirror = mirror @animation_duration = @animation.frame_max load_animation_bitmap @animation_sprites = [] if @animation.position != 3 or not @@animations.include?(animation) if @use_sprite for i in 0..15 sprite = ::Sprite.new(self.viewport) sprite.visible = false @animation_sprites.push(sprite) end unless @@animations.include?(animation) @@animations.push(animation) end end end if @animation.position == 3 if viewport == nil @animation_ox = Graphics.width / 2 @animation_oy = Graphics.height / 2 else @animation_ox = viewport.rect.width / 2 @animation_oy = viewport.rect.height / 2 end else @animation_ox = x - ox + width / 2 @animation_oy = y - oy + height / 2 if @animation.position == 0 @animation_oy -= height / 2 elsif @animation.position == 2 @animation_oy += height / 2 end end end #-------------------------------------------------------------------------- # ● アニメーションの更新 #-------------------------------------------------------------------------- def update_animation unless @animation_duration.zero? frame_index = @animation.frame_max - @animation_duration animation_set_sprites(@animation.frames[frame_index]) for timing in @animation.timings if timing.frame == frame_index animation_process_timing(timing) end end else dispose_animation end end #-------------------------------------------------------------------------- # ● SE とフラッシュのタイミング処理 # timing : タイミングデータ (RPG::Animation::Timing) #-------------------------------------------------------------------------- def animation_process_timing(timing) timing.se.play case timing.flash_scope when 1 anima_flash(self, timing, timing.flash_color) when 2 if viewport != nil anima_flash(viewport, timing, timing.flash_color) end when 3 anima_flash(self, timing, nil) end end end end