Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion doc/fr_class_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expand Down
2 changes: 1 addition & 1 deletion doc/fr_file_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expand Down
2 changes: 1 addition & 1 deletion doc/fr_method_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expand Down
12 changes: 6 additions & 6 deletions lib/swf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ".//"
Expand Down Expand Up @@ -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|
Expand Down Expand Up @@ -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") +
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sample/templatize_sample.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 } })
Expand Down