📄 render_do.c.svn-base
字号:
#include <stdio.h>#include <glib.h>#include "instance.h"#include "player_pub.h"#include "swf_file_pub.h"#include "static_text_ins.h"#include "xwin_pub.h"#include "movie_clips_ins.h"#include "render_pub.h"#include <strings.h>#include <inttypes.h>#include <shape_def.h>#include <render_shape.h>#include <render_rend.h>#include <static_text_def.h>#include <matrix.h>#include <morphing_ins.h>#include <cxform.h>extern int hb;#include <stdlib.h>#include <assert.h>#include "config.h"#if WITH_DMALLOC#include <dmalloc.h>#endifextern player_t *player_p;extern struct GraphicDevice gd;extern struct ShapeDef shapedef;unsigned int gmaskflag=0;unsigned int gmaskedflag=0;void render_draw_node(GNode* node_p,gpointer render_p) { instance_t *data_p = (instance_t*)(node_p->data); define_t *def_p = (define_t*)data_p->define_p; swf_file_t *swf_p = data_p->swf_p; int i; struct CxFormWithAlpha cxf,*cxf1,*cxf2; GNode *nodetmp=0; instance_t *tmpdata; int cxformflag=1; struct cxforms { struct cxforms *priv; struct CxFormWithAlpha *cx; struct cxforms *next; } *tmpcxformp,*tmpcxformp1,*tmpcx,*cxformdel; struct CxFormWithAlpha cxformmiddle; tmpcxformp=0; tmpcxformp1=0; tmpcx=0; cxformdel=0; tmpcxformp=malloc(sizeof(struct cxforms)); tmpcxformp->cx=&(data_p->cxform); tmpcxformp->next=0; tmpcxformp->priv=0; if(node_p->parent) nodetmp=node_p->parent; while(nodetmp) { tmpcx=malloc(sizeof(struct cxforms)); tmpdata= (instance_t*)(nodetmp->data); tmpcx->cx=&(tmpdata->cxform); tmpcx->next=tmpcxformp; tmpcxformp->priv=tmpcx; tmpcxformp=tmpcx; nodetmp=nodetmp->parent; // printf("to there\n"); }; /* tmpcxformp->next->next=123; tmpcxformp1=tmpcxformp; while(tmpcxformp1) {printf("to here\n"); tmpcxformp1->next=123; cxformdel=tmpcxformp1->next; free(tmpcxformp1); tmpcxformp1=cxformdel; }*/ // printf("for debug\n"); cxf.RedMultTerm=1; cxf.GreenMultTerm=1; cxf.BlueMultTerm=1; cxf.AlphaMultTerm=1; cxf.RedAddTerm=0; cxf.GreenAddTerm=0; cxf.BlueAddTerm=0; cxf.AlphaAddTerm=0; cxformmiddle=cxf; tmpcxformp1=tmpcxformp; while(tmpcxformp) { cxf.RedMultTerm = cxf.RedMultTerm * tmpcxformp->cx->RedMultTerm; cxf.GreenMultTerm = cxf.GreenMultTerm * tmpcxformp->cx->GreenMultTerm; cxf.BlueMultTerm = cxf.BlueMultTerm * tmpcxformp->cx->BlueMultTerm; cxf.AlphaMultTerm = cxf.AlphaMultTerm * tmpcxformp->cx->AlphaMultTerm; cxf.RedAddTerm = (long) (cxf.RedMultTerm * tmpcxformp->cx->RedAddTerm + cxf.RedAddTerm); cxf.GreenAddTerm = (long)(cxf.GreenMultTerm * tmpcxformp->cx->GreenAddTerm + cxf.GreenAddTerm); cxf.BlueAddTerm = (long)(cxf.BlueMultTerm * tmpcxformp->cx->BlueAddTerm + cxf.BlueAddTerm); cxf.AlphaAddTerm = (long)(cxf.AlphaMultTerm * tmpcxformp->cx->AlphaAddTerm + cxf.AlphaAddTerm); tmpcxformp=tmpcxformp->next; } if(cxf.RedMultTerm==1&&cxf.GreenMultTerm==1&&cxf.BlueMultTerm==1&&cxf.AlphaMultTerm==1) if(cxf.RedAddTerm==0&&cxf.GreenAddTerm==0&&cxf.BlueAddTerm==0&&cxf.AlphaAddTerm==0) cxformflag=0; while(tmpcxformp1) { cxformdel=tmpcxformp1->next; free(tmpcxformp1); tmpcxformp1=cxformdel; } if(hb==1&&data_p->clip_depth==0) { printf("to hb\n"); maskhb(swf_p); hb=0; } if(data_p->clip_depth!=0||((node_p->parent)&&((instance_t*)(node_p->parent->data))->clip_depth!=0)) { printf("to mask\n"); gmaskflag=1; gmaskedflag=0; } else { if(swf_p->mask_stack_p) { printf("to masked\n"); gmaskflag=0; gmaskedflag=1; } else { gmaskflag=0; gmaskedflag=0; } } switch (data_p->ins_type) { case INS_MC: // printf("MC "); break; case INS_BTN: // printf("BTN "); break; case INS_DTX: case INS_STX: { struct RGBA tcolor; struct Matrix cmat; struct Matrix tmat; struct Matrix *cmat1; int ti; struct DefineText text; struct DefineText *text1; struct TextRecord *trecord; text1 = NULL; trecord = NULL; text1=((stx_ins_t*)data_p)->text_p; cmat1=&cmat; if(text1->TextRecordsP) trecord=(text1->TextRecordsP); tmat=MatrixMulti(&(text1->TextMatrix),&(data_p->ab_matrix)); while(trecord) { if(trecord->Flags&0x04) tcolor=trecord->TextColor; for(ti=0;ti<(trecord->GlyphCount);ti=ti+1) { if(trecord->GlyphEntries[ti].Shape.ShapeRecordsP==NULL) continue; // printf("-----------------------------record is NULL------------------\n"); cmat = MatrixMulti(&tmat ,&(trecord->GlyphEntries[ti].GlyphMatrix)); shapedef.getStyles = 0; if (cxformflag==2) { if(!(trecord->Flags&0x04)) setForegroundColor(&gd,getColor(cxf1,tcolor)); else setForegroundColor(&gd,getColor(cxf1,trecord->TextColor)); //setForegroundColor(gd,getColor(cxf1,trecord->TextColor)); } else { if(!(trecord->Flags&0x04)) setForegroundColor(&gd,tcolor); else setForegroundColor(&gd,trecord->TextColor); } shapeexecute(&gd,&(trecord->GlyphEntries[ti].Shape),cmat1,(cxformflag==1?&cxf:0)); // shapeexecute(&gd,&(trecord->GlyphEntries[ti].Shape),cmat1,0); // printf("-----------------------------record is NULL end------------------\n"); } trecord=trecord->NextP; } //printf("to static text\n"); } // printf("STX "); break; case INS_MRH: { struct DefineShape mshape; mshape=*(((mrp_ins_t *)(data_p))->shape_p); shapeexecute(&gd,&mshape,&(data_p->ab_matrix),0); /* if(e->MatrixP) transformBoundingBox(bb,e->MatrixP,&(mshape.ShapeBounds), 0); else transformBoundingBox(bb,&rootmatrix,&(mshape.ShapeBounds), 0); */ // printf("MRH "); } break; case INS_SHP: { struct DefineShape cshape; cshape=*((struct DefineShape *)(data_p->define_p)); shapedef.getStyles = 1; shapeexecute(&gd,&cshape,&(data_p->ab_matrix),(cxformflag==1?&cxf:0)); } break; };};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -