git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed framerate>0 restriction in order to make Flash Communication Server
[swftools.git]
/
src
/
png2swf.c
diff --git
a/src/png2swf.c
b/src/png2swf.c
index
b765df0
..
2146ef7
100644
(file)
--- a/
src/png2swf.c
+++ b/
src/png2swf.c
@@
-315,11
+315,11
@@
void applyfilter4(int mode, U8*src, U8*old, U8*dest, int width)
unsigned char lastr=0;
unsigned char lastg=0;
unsigned char lastb=0;
unsigned char lastr=0;
unsigned char lastg=0;
unsigned char lastb=0;
- unsigned char lasta=0;
+ unsigned char lasta=0; //TODO: 255?
unsigned char upperlastr=0;
unsigned char upperlastg=0;
unsigned char upperlastb=0;
unsigned char upperlastr=0;
unsigned char upperlastg=0;
unsigned char upperlastb=0;
- unsigned char upperlasta=0;
+ unsigned char upperlasta=0; //TODO: 255?
if(mode==0) {
for(x=0;x<width;x++) {
if(mode==0) {
for(x=0;x<width;x++) {
@@
-570,7
+570,7
@@
TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id)
if(!y) {
old = firstline;
if(!y) {
old = firstline;
- memset(old, 0, header.width*4);
+ memset(old, 0, header.width*4); //TODO: fill alpha with 255?
} else {
old = &data2[(y-1)*header.width*4];
}
} else {
old = &data2[(y-1)*header.width*4];
}
@@
-688,7
+688,9
@@
TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id)
swf_GetMatrix(NULL, &m);
m.sx = 20 * 0x10000;
m.sy = 20 * 0x10000;
swf_GetMatrix(NULL, &m);
m.sx = 20 * 0x10000;
m.sy = 20 * 0x10000;
- fs = swf_ShapeAddBitmapFillStyle(s, &m, id, 0);
+ m.tx = -10;
+ m.ty = -10;
+ fs = swf_ShapeAddBitmapFillStyle(s, &m, id, 1);
swf_SetU16(t, id + 1); // id
swf_SetU16(t, id + 1); // id
@@
-744,9
+746,10
@@
int CheckInputFile(char *fname, char **realname)
sprintf(s, "%s.PNG", fname);
if ((fi = fopen(s, "rb")) == NULL) {
sprintf(s, "%s.Png", fname);
sprintf(s, "%s.PNG", fname);
if ((fi = fopen(s, "rb")) == NULL) {
sprintf(s, "%s.Png", fname);
- if ((fi = fopen(s, "rb")) == NULL)
+ if ((fi = fopen(s, "rb")) == NULL) {
fprintf(stderr, "Couldn't open %s!\n", fname);
return -1;
fprintf(stderr, "Couldn't open %s!\n", fname);
return -1;
+ }
}
}
}
}
}
}
@@
-776,7
+779,9
@@
int args_callback_option(char *arg, char *val)
case 'r':
if (val)
global.framerate = atof(val);
case 'r':
if (val)
global.framerate = atof(val);
- if ((global.framerate < 1.0/256) ||(global.framerate >= 256.0)) {
+ /* removed framerate>0 restriction in order to make
+ Flash Communication Server compatible SWFs */
+ if ((global.framerate < 0) ||(global.framerate >= 256.0)) {
if (VERBOSE(1))
fprintf(stderr,
"Error: You must specify a valid framerate between 1/256 and 255.\n");
if (VERBOSE(1))
fprintf(stderr,
"Error: You must specify a valid framerate between 1/256 and 255.\n");