comparison libvo/sub.c @ 6190:bd6748605681

Bounding box and partial update patch for vob/dvdsub by Hephooey.
author atmos4
date Sat, 25 May 2002 17:40:40 +0000
parents 7bea806b9c5f
children 60a473935d7d
comparison
equal deleted inserted replaced
6189:838380d56166 6190:bd6748605681
318 // obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo_font->height; 318 // obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo_font->height;
319 obj->flags|=OSDFLAG_BBOX; 319 obj->flags|=OSDFLAG_BBOX;
320 320
321 } 321 }
322 322
323 inline static void vo_update_spudec_sub(mp_osd_obj_t* obj, int dxs, int dys)
324 {
325 unsigned int bbox[4];
326 int i;
327 spudec_calc_bbox(vo_spudec, dxs, dys, bbox);
328 obj->bbox.x1 = bbox[0];
329 obj->bbox.x2 = bbox[1];
330 obj->bbox.y1 = bbox[2];
331 obj->bbox.y2 = bbox[3];
332 obj->flags |= OSDFLAG_BBOX;
333 }
334
335 inline static void vo_draw_spudec_sub(mp_osd_obj_t* obj, void (*draw_alpha)(int x0, int y0, int w, int h, unsigned char* src, unsigned char* srca, int stride))
336 {
337 spudec_draw_scaled(vo_spudec, obj->dxs, obj->dys, draw_alpha);
338 }
323 inline static void vo_draw_text_sub(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ 339 inline static void vo_draw_text_sub(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
324 int i,j,c,x,l,font; 340 int i,j,c,x,l,font;
325 int y=obj->y; 341 int y=obj->y;
326 342
327 i=j=0; 343 i=j=0;
383 break; 399 break;
384 case OSDTYPE_PROGBAR: 400 case OSDTYPE_PROGBAR:
385 vo_update_text_progbar(obj,dxs,dys); 401 vo_update_text_progbar(obj,dxs,dys);
386 break; 402 break;
387 case OSDTYPE_SPU: 403 case OSDTYPE_SPU:
388 if(vo_spudec && spudec_visible(vo_spudec)) 404 if(vo_spudec && spudec_visible(vo_spudec)){
405 vo_update_spudec_sub(obj, dxs, dys);
389 obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; 406 obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED;
407 }
390 else 408 else
391 obj->flags&=~OSDFLAG_VISIBLE; 409 obj->flags&=~OSDFLAG_VISIBLE;
392 break; 410 break;
393 case OSDTYPE_OSD: 411 case OSDTYPE_OSD:
394 if(vo_font && vo_osd_text && vo_osd_text[0]){ 412 if(vo_font && vo_osd_text && vo_osd_text[0]){
471 while(obj){ 489 while(obj){
472 if(obj->flags&OSDFLAG_VISIBLE){ 490 if(obj->flags&OSDFLAG_VISIBLE){
473 vo_osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack 491 vo_osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack
474 switch(obj->type){ 492 switch(obj->type){
475 case OSDTYPE_SPU: 493 case OSDTYPE_SPU:
476 spudec_draw_scaled(vo_spudec, dxs, dys, draw_alpha); // FIXME 494 vo_draw_spudec_sub(obj, draw_alpha); // FIXME
477 break; 495 break;
478 case OSDTYPE_OSD: 496 case OSDTYPE_OSD:
479 vo_draw_text_osd(obj,draw_alpha); 497 vo_draw_text_osd(obj,draw_alpha);
480 break; 498 break;
481 case OSDTYPE_SUBTITLE: 499 case OSDTYPE_SUBTITLE: