git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clipdepth is now always shown.
[swftools.git]
/
src
/
swfdump.c
diff --git
a/src/swfdump.c
b/src/swfdump.c
index
a697900
..
051b8a2
100644
(file)
--- a/
src/swfdump.c
+++ b/
src/swfdump.c
@@
-56,6
+56,7
@@
static int showtext = 0;
static int showshapes = 0;
static int hex = 0;
static int used = 0;
static int showshapes = 0;
static int hex = 0;
static int used = 0;
+static int bbox = 0;
static struct options_t options[] = {
{"h", "help"},
static struct options_t options[] = {
{"h", "help"},
@@
-66,6
+67,7
@@
static struct options_t options[] = {
{"t", "text"},
{"s", "shapes"},
{"p", "placements"},
{"t", "text"},
{"s", "shapes"},
{"p", "placements"},
+{"b", "bbox"},
{"X", "width"},
{"Y", "height"},
{"r", "rate"},
{"X", "width"},
{"Y", "height"},
{"r", "rate"},
@@
-125,6
+127,10
@@
int args_callback_option(char*name,char*val)
used = 1;
return 0;
}
used = 1;
return 0;
}
+ else if(name[0]=='b') {
+ bbox = 1;
+ return 0;
+ }
else if(name[0]=='D') {
action = placements = showtext = showshapes = 1;
return 0;
else if(name[0]=='D') {
action = placements = showtext = showshapes = 1;
return 0;
@@
-153,6
+159,7
@@
void args_callback_usage(char *name)
printf("-t , --text Show text fields (like swfstrings).\n");
printf("-s , --shapes Show shape coordinates/styles\n");
printf("-p , --placements Show placement information\n");
printf("-t , --text Show text fields (like swfstrings).\n");
printf("-s , --shapes Show shape coordinates/styles\n");
printf("-p , --placements Show placement information\n");
+ printf("-b , --bbox Print tag's bounding boxes\n");
printf("-X , --width Prints out a string of the form \"-X width\".\n");
printf("-Y , --height Prints out a string of the form \"-Y height\".\n");
printf("-r , --rate Prints out a string of the form \"-r rate\".\n");
printf("-X , --width Prints out a string of the form \"-X width\".\n");
printf("-Y , --height Prints out a string of the form \"-Y height\".\n");
printf("-r , --rate Prints out a string of the form \"-r rate\".\n");
@@
-909,8
+916,16
@@
int main (int argc,char ** argv)
printf(" object");
printf(" at depth %04d", swf_GetDepth(tag));
printf(" object");
printf(" at depth %04d", swf_GetDepth(tag));
+
+ if(tag->data[0]&64) {
+ SWFPLACEOBJECT po;
+ swf_GetPlaceObject(tag, &po);
+ printf(" (clip to %04d)", po.clipdepth);
+ swf_PlaceObjectFree(&po);
+ }
if(swf_GetName(tag))
printf(" name \"%s\"",swf_GetName(tag));
if(swf_GetName(tag))
printf(" name \"%s\"",swf_GetName(tag));
+
}
else if(tag->id == ST_REMOVEOBJECT) {
printf(" removes id %04d from depth %04d", swf_GetPlaceID(tag), swf_GetDepth(tag));
}
else if(tag->id == ST_REMOVEOBJECT) {
printf(" removes id %04d from depth %04d", swf_GetPlaceID(tag), swf_GetDepth(tag));
@@
-1035,6
+1050,15
@@
int main (int argc,char ** argv)
else {
printf("\n");
}
else {
printf("\n");
}
+
+ if(bbox && swf_isDefiningTag(tag) && tag->id != ST_DEFINESPRITE) {
+ SRECT r = swf_GetDefineBBox(tag);
+ printf(" %s bbox [%.2f, %.2f, %.2f, %.2f]\n", prefix,
+ r.xmin/20.0,
+ r.ymin/20.0,
+ r.xmax/20.0,
+ r.ymax/20.0);
+ }
sprintf(myprefix, " %s", prefix);
sprintf(myprefix, " %s", prefix);