мЭkяΘÐ ツVie Ago 17, 2012 1:30 am
Usuario Nv10
IMPORTANTE¡¡
hola amigos de hunter maker... bueno me acabo de enterar que hay un bug en las imagenes del vx ace q provoca lag..
LES EXPLICARE COMO ESTA.. Mirenn cuando ustedes ponen una imagen con un cierto numero en el mapa y despues cuando la borran esta se mantiene ahi.. es decir esta ocupando memoria pero ya no aparece . esto es un gran problema la verdad, con este script lo solucionaran asi que en verdad les recomiendo que lo pongan en su proyecto y mas los enginers¡¡
script:
- Spoiler:
- Código:
#==============================================================================
# ▼ Mithran Picture Bug Fix
# -- Created: 3/12/2012
#==============================================================================
# The problem is caused when a picture is erased it holds an assoicated "picture"
# object in memory as long as you stay on the same scene. Every time that picture
# object comes up, it creates a NEW blank bitmap, every frame, basically if you
# want it to lag, create a lot of blank pictures when they get garbage collected,
# it lags.
# Each erased picture creates a single 32x32 blank bitmap to associate
# itself with, every frame, same with any picture shown as (none). Since the lag
# is caused by garbage collection, which is basically uncontrollabe with Ruby.
#
# The reason why it constantly creates new blank pictures is because the base
# scripts check for the picture name. And if it's "" (aka no picture name),
# it keeps creating. When a picture is erased, it sets to ""
#
# This script fixes that.
#==============================================================================
class Sprite_Picture
def update_bitmap
if @picture.name != @pic_name
self.bitmap = Cache.picture(@picture.name)
end
@pic_name = @picture.name
end
end
class Spriteset_Map
def update_pictures
$game_map.screen.pictures.each do |pic|
@picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport2, pic)
@picture_sprites[pic.number].update
if pic.name == ""
$game_map.screen.pictures.remove(pic.number)
@picture_sprites[pic.number].dispose
@picture_sprites[pic.number] = nil
end
end
end
end
class Game_Pictures
def remove(index)
@data[index] = nil
end
end