Changeset 28309


Ignore:
Timestamp:
04/02/14 10:49:09 (10 years ago)
Author:
gost
Message:

[titan] mipsel.. workaround for blitjpg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/mipselport.h

    r28134 r28309  
    743743//void blitjpg(unsigned char* buf, int posx, int posy, int width, int height, int scalewidth, int scaleheight)
    744744{
     745#ifdef MIPSEL
     746        unsigned char *helpbuf = NULL;
     747        unsigned char *framebuf = NULL;
     748
     749        if(scalewidth != 0 || scaleheight != 0) {
     750                helpbuf = scale(buf, width, height, 3, scalewidth, scaleheight, 1);
     751                if(helpbuf == NULL)
     752                        return;
     753        }
     754        else {
     755                helpbuf = buf;
     756                scalewidth = width;
     757                scaleheight = height;
     758        }
     759        size_t helpb = 0;
     760        size_t helpz = 0;
     761        size_t help = 0;
     762       
     763        framebuf = skinfb->fb;
     764        framebuf = framebuf + (posy * skinfb->pitch) + (posx*4);
     765       
     766        while(helpz < scaleheight && helpz < (skinfb->height - posy)) {
     767                help = 0;
     768                while(help < (scalewidth*4) && help < (skinfb->pitch - (posx*4))) {
     769                        framebuf[help+0] = helpbuf[helpb+2];
     770                        framebuf[help+1] = helpbuf[helpb+1];
     771                        framebuf[help+2] = helpbuf[helpb+0];
     772                        framebuf[help+3] = 0xff;
     773                        help = help + 4;
     774                        helpb = helpb + 3;
     775                }
     776                if(help >= (skinfb->pitch - (posx*4)))
     777                        helpb = (helpz+1) * (scalewidth*3);
     778                framebuf = framebuf + skinfb->pitch;
     779                helpz = helpz + 1;
     780        }
     781        free(helpbuf);
     782        blit();
     783#endif
     784                 
    745785/*
    746786#ifndef SIMULATE
     
    783823#endif
    784824*/
     825
    785826}
    786827
Note: See TracChangeset for help on using the changeset viewer.