+}
+
+
+///////////
+/*
+for(t=0;t<picpos;t++)
+ {
+ if(pic_xids[t] == xid &&
+ pic_yids[t] == yid) {
+ width = pic_width[t];
+ height = pic_height[t];
+ found = t;break;
+ }
+ }
+ pic_ids[picpos] = swfoutput_drawimagelosslessN(&output, pic, pal, width, height, x1,y1,x2,y2,x3,y3,x4,y4, numpalette);
+ pic_xids[picpos] = xid;
+ pic_yids[picpos] = yid;
+ pic_width[picpos] = width;
+ pic_height[picpos] = height;
+ if(picpos<1024)
+ picpos++;
+ pic[width*y+x] = buf[0];
+ xid+=x*buf[0]+1;
+ yid+=y*buf[0]*3+1;
+
+ xid += pal[1].r*3 + pal[1].g*11 + pal[1].b*17;
+ yid += pal[1].r*7 + pal[1].g*5 + pal[1].b*23;
+
+ int xid = 0;
+ int yid = 0;
+ xid += x*r+x*b*3+x*g*7+x*a*11;
+ yid += y*r*3+y*b*17+y*g*19+y*a*11;
+ int t,found = -1;
+ for(t=0;t<picpos;t++)
+ {
+ if(pic_xids[t] == xid &&
+ pic_yids[t] == yid) {
+ found = t;break;
+ }
+ }
+ if(found<0) {
+*/
+///////////
+
+
+int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value)
+{
+ swfoutput_internal*i = (swfoutput_internal*)dev->internal;
+
+ if(!strcmp(name, "jpegsubpixels")) {
+ i->config_jpegsubpixels = atof(value);
+ } else if(!strcmp(name, "ppmsubpixels")) {
+ i->config_ppmsubpixels = atof(value);
+ } else if(!strcmp(name, "drawonlyshapes")) {
+ i->config_drawonlyshapes = atoi(value);
+ } else if(!strcmp(name, "ignoredraworder")) {
+ i->config_ignoredraworder = atoi(value);
+ } else if(!strcmp(name, "filloverlap")) {
+ i->config_filloverlap = atoi(value);
+ } else if(!strcmp(name, "linksopennewwindow")) {
+ i->config_opennewwindow = atoi(value);
+ } else if(!strcmp(name, "opennewwindow")) {
+ i->config_opennewwindow = atoi(value);
+ } else if(!strcmp(name, "storeallcharacters")) {
+ i->config_storeallcharacters = atoi(value);
+ } else if(!strcmp(name, "enablezlib")) {
+ i->config_enablezlib = atoi(value);
+ } else if(!strcmp(name, "bboxvars")) {
+ i->config_bboxvars = atoi(value);
+ } else if(!strcmp(name, "insertstop")) {
+ i->config_insertstoptag = atoi(value);
+ } else if(!strcmp(name, "protect")) {
+ i->config_protect = atoi(value);
+ if(i->config_protect && i->tag) {
+ i->tag = swf_InsertTag(i->tag, ST_PROTECT);
+ }
+ } else if(!strcmp(name, "faketags")) {
+ i->config_generate_fake_tags = atoi(value);
+ } else if(!strcmp(name, "flashversion")) {
+ i->config_flashversion = atoi(value);
+ if(i->swf) {
+ i->swf->fileVersion = i->config_flashversion;
+ }
+ } else if(!strcmp(name, "minlinewidth")) {
+ i->config_minlinewidth = atof(value);
+ } else if(!strcmp(name, "caplinewidth")) {
+ i->config_caplinewidth = atof(value);
+ } else if(!strcmp(name, "linktarget")) {
+ i->config_linktarget = strdup(value);
+ } else if(!strcmp(name, "dumpfonts")) {
+ i->config_dumpfonts = atoi(value);
+ } else if(!strcmp(name, "next_bitmap_is_jpeg")) {
+ i->jpeg = 1;
+ } else if(!strcmp(name, "jpegquality")) {
+ int val = atoi(value);
+ if(val<0) val=0;
+ if(val>100) val=100;
+ i->config_jpegquality = val;
+ } else if(!strcmp(name, "splinequality")) {
+ int v = atoi(value);
+ v = 500-(v*5); // 100% = 0.25 pixel, 0% = 25 pixel
+ if(v<1) v = 1;
+ i->config_splinemaxerror = v;
+ } else if(!strcmp(name, "fontquality")) {
+ int v = atoi(value);
+ v = 500-(v*5); // 100% = 0.25 pixel, 0% = 25 pixel
+ if(v<1) v = 1;
+ i->config_fontsplinemaxerror = v;
+ } else {
+ fprintf(stderr, "unknown parameter: %s (=%s)\n", name, value);
+ return 0;