X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fmodules%2Fswfrender.c;h=6c5262a7cfc16d6ba1f373aca9782fc2014f4fb0;hp=9683622d9f9d48e981a1a6d7d3cee6a82a4ee4b1;hb=5a4a20931aade60f0e99df0819fbd1c007a705da;hpb=2e9e3fa8fc322ec9fb73bcf7a732b6a4ce42749c diff --git a/lib/modules/swfrender.c b/lib/modules/swfrender.c index 9683622..6c5262a 100644 --- a/lib/modules/swfrender.c +++ b/lib/modules/swfrender.c @@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include +#include +#include "../rfxswf.h" /* one bit flag: */ #define clip_type 0 @@ -362,7 +365,7 @@ void swf_Render_Delete(RENDERBUF*dest) /* delete line buffers */ for(y=0;yheight2;y++) { - swf_DeleteTag(i->lines[y].points); + swf_DeleteTag(0, i->lines[y].points); i->lines[y].points = 0; } @@ -677,8 +680,6 @@ static void fill_gradient(RGBA*line, int*z, int y, int x1, int x2, MATRIX*m, GRA RGBA col; double xx = ( (x - rx) * m22 - (y - ry) * m21)*det; double yy = (- (x - rx) * m12 + (y - ry) * m11)*det; - int ainv; - ainv = 255-col.a; if(type == FILL_LINEAR) { int xr = xx*256; @@ -695,7 +696,8 @@ static void fill_gradient(RGBA*line, int*z, int y, int x1, int x2, MATRIX*m, GRA xr = 511; col = palette[xr]; } - + int ainv; + ainv = 255-col.a; line[x].r = clamp(((line[x].r*ainv)>>8)+col.r); line[x].g = clamp(((line[x].g*ainv)>>8)+col.g); line[x].b = clamp(((line[x].b*ainv)>>8)+col.b); @@ -830,7 +832,7 @@ static void change_state(int y, state_t* state, renderpoint_t*p) layer_t*before=0, *self=0, *after=0; if(DEBUG&2) { - printf("[(%d,%d)/%d/%d-%d]", p->x, y, p->depth, p->shapeline->fillstyle0, p->shapeline->fillstyle1); + printf("[(%f,%d)/%d/%d-%d]", p->x, y, p->depth, p->shapeline->fillstyle0, p->shapeline->fillstyle1); } search_layer(state, p->depth, &before, &self, &after); @@ -1045,7 +1047,7 @@ typedef struct SHAPE2**glyphs; } font_t; -enum CHARACTER_TYPE {none_type, shape_type, image_type, text_type, font_type, sprite_type}; +enum CHARACTER_TYPE {none_type, shape_type, image_type, text_type, edittext_type, font_type, sprite_type}; typedef struct { TAG*tag; @@ -1230,6 +1232,12 @@ static void renderFromTag(RENDERBUF*buf, character_t*idtable, TAG*firstTag, MATR info.buf = buf; swf_ParseDefineText(tag, textcallback, &info); + } else if(idtable[id].type == edittext_type) { + TAG* tag = idtable[id].tag; + U16 flags = swf_GetBits(tag, 16); + if(flags & ET_HASTEXT) { + fprintf(stderr, "edittext not supported yet (id %d)\n", id); + } } else { fprintf(stderr, "Unknown/Unsupported Object Type for id %d: %s\n", id, swf_TagGetName(idtable[id].tag)); } @@ -1244,6 +1252,7 @@ void swf_RenderSWF(RENDERBUF*buf, SWF*swf) int t; RGBA color; + swf_OptimizeTagOrder(swf); swf_FoldAll(swf); character_t* idtable = (character_t*)rfx_calloc(sizeof(character_t)*65536); // id to character mapping @@ -1299,6 +1308,8 @@ void swf_RenderSWF(RENDERBUF*buf, SWF*swf) idtable[id].type = text_type; } else if(tag->id == ST_DEFINESPRITE) { idtable[id].type = sprite_type; + } else if(tag->id == ST_DEFINEEDITTEXT) { + idtable[id].type = edittext_type; } } tag = tag->next;