ppu_write: put new byte value only if it's different
This commit is contained in:
parent
ca5675419e
commit
28aaf40e6d
|
@ -61,11 +61,12 @@ ppu_write(Ppu *p, Uint8 layer, Uint16 x, Uint16 y, Uint8 color)
|
|||
Uint8 pix = p->pixels[row];
|
||||
Uint8 mask = ~(0x3 << shift);
|
||||
Uint8 pixnew = (pix & mask) + (color << shift);
|
||||
if(pix != pixnew){
|
||||
p->pixels[row] = pixnew;
|
||||
if(pix != pixnew)
|
||||
p->reqdraw = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ppu_1bpp(Ppu *p, Uint8 layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy)
|
||||
|
|
Loading…
Reference in New Issue