0 Members and 1 Guest are viewing this topic.
I'm making it so that they appear above the F buttons, so that you just have to press the one that it's above to click it.
Is the purple glitch due to the same problem you had with your (canceled?) Mode 7 engine? I like the custom fonts by the way
In : color, alpha (between 0 and 1)Out : colorOnScreen * (1 - alpha) + color * alpha
/*Note it is up to the caller to ensure that alpha is in range of 1-31 * For a value of 32 or greater just don't draw the image * For a value of 0 use a plain mask function that does not take into account alpha * Also make sure width is a multiple of two*/void CopySpriteMaskedAlpha(unsigned *data,unsigned x,unsigned y,unsigned width,unsigned height,unsigned maskcolor,unsigned alpha){ unsigned short*v=(unsigned short*)0xA8000000; unsigned* VRAM,w,alphai; width/=2; v += 384*y + x; VRAM=v; alphai=32-alpha; maskcolor|=maskcolor<<16;/*Note I have decided to do a minor tradeoff for speed. Make sure your alpha pixels are multiple of two*/ while(height--){ w=width; while(w--){ unsigned color1=*data++; if(color1 != maskcolor){ /*Note this is based on the source code of Fblend's function fblend_rect_trans_16*/ unsigned rbg_source, grb_source,temp1; /* Split up components to allow us to do operations on all of them at the same time */ rbg_source = *VRAM & 0xF81F07E0, grb_source = *VRAM & 0x07E0F81F; /* Multiply the source by the factor */ rbg_source = ((rbg_source >> 5) * alpha) & 0xF81F07E0; grb_source = ((grb_source * alpha) >> 5) & 0x07E0F81F; /* Split up RGB -> R-B and G */ temp1 = color1 & 0x7E0F81F; color1 &= 0xF81F07E0; /* Multiply the source by the factor */ color1 = ((((color1 >> 5) * alphai) & 0xF81F07E0) + rbg_source) & 0xF81F07E0; temp1 = ((((temp1 * alphai) >> 5) & 0x07E0F81F) + grb_source) & 0x07E0F81F; color1 |= temp1; *VRAM++=color1; }else ++VRAM; } VRAM += (384/2)-width; }}