diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c091839 --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Numerous always-ignore extensions +################### +*.diff +*.err +*.orig +*.log +*.rej +*.swo +*.swp +*.vi +*~ + +*.sass-cache +# Folders to ignore +################### +.hg +.svn +.CVS +# OS or Editor folders +################### +.DS_Store +Icon? +Thumbs.db +ehthumbs.db +nbproject +.cache +.project +.settings +.tmproj +*.esproj +*.sublime-project +*.sublime-workspace +# Dreamweaver added files +################### +_notes +dwsync.xml +# Komodo +################### +*.komodoproject +.komodotools diff --git a/doc/fr_class_index.html b/doc/fr_class_index.html index 9beed8c..acd2784 100644 --- a/doc/fr_class_index.html +++ b/doc/fr_class_index.html @@ -1,6 +1,6 @@ - diff --git a/doc/fr_file_index.html b/doc/fr_file_index.html index 98fcbf8..19efeeb 100644 --- a/doc/fr_file_index.html +++ b/doc/fr_file_index.html @@ -1,6 +1,6 @@ - diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html index 16a68b9..d68eaa2 100644 --- a/doc/fr_method_index.html +++ b/doc/fr_method_index.html @@ -1,6 +1,6 @@ - diff --git a/lib/swf.rb b/lib/swf.rb index 67312d7..17eb77a 100644 --- a/lib/swf.rb +++ b/lib/swf.rb @@ -56,7 +56,7 @@ def partialize(adjustment = false, root_define_sprite_id_to = 0, available_id_fr xpath_axes = "//" # making object_id_map if e.name == "DefineSprite" and e.attributes['objectID'] == root_define_sprite_id_from.to_s then - # inherit original object_id + # inherit original object_id #object_id_map[e.attributes['objectID']] = root_define_sprite_id_to.to_s e.attributes['objectID'] = root_define_sprite_id_to.to_s xpath_axes = ".//" @@ -127,7 +127,7 @@ def read_swf_structure xml = "" # pickup referred DefineShape @xmldoc.find(".//*[self::DefineShape[@objectID='#{object_id}'] or self::DefineShape2[@objectID='#{object_id}'] or self::DefineShape3[@objectID='#{object_id}']]").each do |e1| - # pickup referred ClippedBitmap + # pickup referred ClippedBitmap e1.find('.//ClippedBitmap[@objectID]').each do |e2| # pickup referred DefineBitsLossless, DefineBitsLossless2 and DefineBitsJPEG2 @xmldoc.find(".//*[self::DefineBitsLossless[@objectID='#{e2.attributes['objectID']}'] or self::DefineBitsLossless2[@objectID='#{e2.attributes['objectID']}'] or self::DefineBitsJPEG2[@objectID='#{e2.attributes['objectID']}']]").each do |e3| @@ -250,13 +250,13 @@ def self.image2xml(object_id, image) data = colormap.inject("") { |r,c| opacity = (MaxRGB-c.opacity) >> ShiftDepth if opacity == 0 then - r += + r += [0].pack("C") + [0].pack("C") + [0].pack("C") + [opacity].pack("C") else - r += + r += [c.red >> ShiftDepth].pack("C") + [c.green >> ShiftDepth].pack("C") + [c.blue >> ShiftDepth].pack("C") + @@ -391,7 +391,7 @@ def self.image2xml(object_id, image) # format=3 # added colormap before data_stream data = colormap.inject("") { |r,c| - r += + r += [c.red >> ShiftDepth].pack("C") + [c.green >> ShiftDepth].pack("C") + [c.blue >> ShiftDepth].pack("C") @@ -551,7 +551,7 @@ def regenerate(adjustment) xpath_axes = "//" # making object_id_map if e.name == "DefineSprite" and e.attributes['objectID'] == define_sprite.xmldoc.root.attributes['baseObjectID'] then - # inherit original object_id + # inherit original object_id e.attributes['objectID'] = object_id xpath_axes = ".//" else diff --git a/sample/templatize_sample.rb b/sample/templatize_sample.rb index 0c009f7..6dc0138 100644 --- a/sample/templatize_sample.rb +++ b/sample/templatize_sample.rb @@ -13,7 +13,7 @@ # check included movieclip_ids by instance_name pp swf.movieclip_ids_named("animation") #=> ["5"] -# templatize Swf - replace specified movieclip element will be replaced to +# templatize Swf - replace specified movieclip element will be replaced to # special text pattern (for using String#gsub). File.open("data/animation_template_gsub.xml", "w") do |f| f.puts swf.templatize({ "5" => { :replace_name => '####PARTIAL_MOVIECLIP_5####', :replace_id => 5 } })