for(t=0;t<nr;t++)
{
- int xx = startx + advance[t]/20;
- if(x|y|w|h) {
- /* TODO: this does not do any matrix handling yet */
+ int xx = startx + advance[t];
+ int yy = starty;
+ MATRIX*m = (MATRIX*)self;
+
+ SPOINT p = {xx,yy};
+ p = swf_TurnPoint(p, m);
+ xx = p.x / 20;
+ yy = p.y / 20;
- if(xx < x || starty < y || xx > x+w || starty > y+h) {
+ if(x|y|w|h) {
+ if(xx < x || yy < y || xx > x+w || yy > y+h) {
/* outside of bounding box */
- continue;
+ ///printf("(%d+%d,%d) -> (%d,%d)\n", startx, advance[t]/20, starty, xx, yy);
+ if(t==nr-1) return;
+ else continue;
}
}
unsigned char a;
int advance = 0;
- if(font>=0) {
+ if(font) {
if(glyphs[t]<0 || glyphs[t] >= font->numchars /*glyph is not in range*/
|| !font->glyph2ascii /* font has ascii<->glyph mapping */
) a = glyphs[t];
swf_FontFree(font);
}
+TAG**id2tag = 0;
int main (int argc,char ** argv)
{
if(!h) h = (swf.movieSize.ymax - swf.movieSize.ymin) / 20;
}
+ id2tag = malloc(sizeof(TAG)*65536);
+
fontnum = 0;
swf_FontEnumerate(&swf,&fontcallback1, 0);
fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
while (tag)
{
if(swf_isTextTag(tag)) {
- swf_ParseDefineText(tag, textcallback, 0);
+ id2tag[swf_GetDefineID(tag)] = tag;
+ } else if(swf_isPlaceTag(tag)) {
+ SWFPLACEOBJECT po;
+ swf_SetTagPos(tag, 0);
+ swf_GetPlaceObject(tag, &po);
+ if(!po.move && id2tag[po.id]) {
+ TAG*text = id2tag[po.id];
+ swf_SetTagPos(text, 0);
+ swf_GetU16(text);
+ swf_GetRect(text, NULL);
+ swf_ResetReadBits(text);
+ MATRIX m,tm;
+ swf_GetMatrix(text, &tm);
+ swf_MatrixJoin(&m, &po.matrix, &tm);
+ swf_ParseDefineText(text, textcallback, &m);
+ }
}
tag = tag->next;
}