git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added class members, expression lefthands
[swftools.git]
/
lib
/
example
/
zlibtest.c
diff --git
a/lib/example/zlibtest.c
b/lib/example/zlibtest.c
index
f49cf5f
..
816f17d
100644
(file)
--- a/
lib/example/zlibtest.c
+++ b/
lib/example/zlibtest.c
@@
-36,12
+36,12
@@
int main ( int argc, char ** argv)
{ SWF swf;
int main ( int argc, char ** argv)
{ SWF swf;
- LPTAG t;
+ TAG* t;
RGBA rgb;
RGBA rgb;
- LPSHAPE s;
+ SHAPE* s;
MATRIX m;
SRECT r;
MATRIX m;
SRECT r;
- LPJPEGBITS jpeg;
+ JPEGBITS* jpeg;
int i,f;
int ls; // line style
int i,f;
int ls; // line style
@@
-75,15
+75,26
@@
int main ( int argc, char ** argv)
bitmap8[y*bps8+x] = (y/16)*16+(x/16);
for (x=0;x<256;x++)
bitmap8[y*bps8+x] = (y/16)*16+(x/16);
for (x=0;x<256;x++)
- { pal[x].r = (x&0xf)*16;
- pal[x].g = (x*2)&0xff;
- pal[x].b = x&0xf0;
- pal[x].a = (x==0xff)?0:0xff;
+ {
+ pal[x].r = (x/16)*16;
+ pal[x].g = (x&15)*16;
+ pal[x].b = 0;
+ pal[x].a = x;
+ pal[x].r = (pal[x].r*pal[x].a)/255;
+ pal[x].g = (pal[x].g*pal[x].a)/255;
+ pal[x].b = (pal[x].b*pal[x].a)/255;
}
for (y=0;y<dy;y++)
}
for (y=0;y<dy;y++)
- for (x=0;x<dx;x++)
- bitmap16[y*(bps16>>1)+x] = ((x&0xf0)==(y&0xf0))?0xffff:(x&0x0f)<(y&0xf)?BM16_RED|BM16_GREEN:BM16_BLUE;
+ for (x=0;x<dx;x++) {
+ U8 red = x;
+ U8 green = y;
+ U8 blue = x+y;
+ bitmap16[y*(bps16>>1)+x] = ((green/0x40)&0x03)|
+ ((red/4)&0x3f)<<2|
+ ((blue/8)&0x1f)<<8|
+ ((green/0x08)&0x07)<<13;
+ }
for (y=0;y<dy;y++)
for (x=0;x<dx;x++)
for (y=0;y<dy;y++)
for (x=0;x<dx;x++)
@@
-106,9
+117,9
@@
int main ( int argc, char ** argv)
swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
t = swf.firstTag;
swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
t = swf.firstTag;
- rgb.r = 0xff;
- rgb.b = 0xff;
- rgb.g = 0xff;
+ rgb.r = 0x00;
+ rgb.b = 0x00;
+ rgb.g = 0x00;
swf_SetRGB(t,&rgb);
t = swf_InsertTag(t,ST_DEFINEBITSLOSSLESS);
swf_SetRGB(t,&rgb);
t = swf_InsertTag(t,ST_DEFINEBITSLOSSLESS);
@@
-188,7
+199,7
@@
int main ( int argc, char ** argv)
// swf_WriteCGI(&swf);
// swf_WriteCGI(&swf);
- f = open("zlibtest.swf",O_RDWR|O_CREAT|O_TRUNC,0644);
+ f = open("zlibtest.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644);
if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
close(f);
if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
close(f);