Changeset 24144


Ignore:
Timestamp:
10/08/13 22:33:59 (9 years ago)
Author:
nit
Message:

[titan] fix autosubtitle overdraw

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/subtitle.h

    r24138 r24144  
    103103}
    104104
     105int checkfbregion(struct subpage* page)
     106{
     107        struct subpagereg* pageregnode = NULL;
     108        int y, x;
     109       
     110        if(status.autosubtitle == 0) return 0;
     111        if(page == NULL) return 0;
     112       
     113        pageregnode = page->pageregions;
     114        while(pageregnode != NULL)
     115        {
     116                struct subreg *regnode = page->regions;
     117                while(regnode != NULL)
     118                {
     119                        if(regnode->regid == pageregnode->regid) break;
     120                        regnode = regnode->next;
     121                }
     122               
     123                if(regnode != NULL && regnode->buf != NULL)
     124                {
     125                        int posx = pageregnode->reghorizontaladdress * skinfb->width / subdisplaywidth;
     126                        int posy = pageregnode->regverticaladdress * skinfb->height / subdisplayheight;
     127                       
     128                        //check if drawing place is empty
     129                        for(y = 0; y < regnode->scaleheight; y++)
     130                        {
     131                                if(y == 0 || y == regnode->scaleheight - 1)
     132                                {
     133                                        for(x = 0; x < regnode->scalewidth; x++)
     134                                        {
     135                                                if(getpixel(posx + x, posy + y) != 0)
     136                                                        return 1;
     137                                        }
     138                                }
     139                                else
     140                                {
     141                                        if(getpixel(posx, posy + y) != 0 || getpixel(posx + regnode->scalewidth - 1, posy + y) != 0)
     142                                                return 1;
     143                                }
     144                        }       
     145                }
     146               
     147                pageregnode = pageregnode->next;
     148        }
     149       
     150        return 0;
     151}
     152
    105153void subdraw(unsigned long long subpts, struct subpage* page)
    106154{
     
    112160
    113161        if(page == NULL) return;
     162        if(checkfbregion(page) == 1) return;
    114163
    115164        //wait for subtitle to display
Note: See TracChangeset for help on using the changeset viewer.