Cerca nel Forum
Showing results for tags 'Ottimizzazione Cache'.
Trovato 1 risultato
-
Nome Script: Ottimizzazione Cache Versione: N/D Autore/i: Jet Informazioni: Script che velocizza il caricamento delle bitmap in game :3 Istruzioni: Inserite lo script Sotto Material. Script: #=============================================================================== # Cache Optimization # By Jet10985 (Jet) #=============================================================================== # This snippet will pre-cache all images at the beginning of the game to # quicken the loading of bitmaps in-game, and return dups instead of originals # to prevent having to recreate after disposing it. # This script has: 0 customization options. #=============================================================================== # Overwritten Methods: # None #------------------------------------------------------------------------------- # Aliased methods: # Cache: load_bitmap #=============================================================================== if File.directory?("Graphics") g_array = Dir.entries("Graphics") g_array.each {|a| next if [".", ".."].include?(a) if !File.directory?("Graphics/#{a}") Cache.load_bitmap("Graphics/", a) rescue next next end file = Dir.entries("Graphics/#{a}") file.each {|b| next if [".", ".."].include?( if File.directory?("Graphics/#{a}/#{b}") g_array << "#{a}/#{b}" next end Cache.load_bitmap("Graphics/#{a}/", rescue next } } end class << Cache alias jet3745_load_bitmap load_bitmap unless $@ def load_bitmap(*args, &block) (jet3745_load_bitmap(*args, &block)).dup end end