ppu_redraw: use the same optimization that one-layer logic had
This commit is contained in:
parent
c2829ce5fe
commit
831014e811
|
@ -82,9 +82,11 @@ ppu_clear(Ppu *p, Layer *layer)
|
||||||
void
|
void
|
||||||
ppu_redraw(Ppu *p, Uint32 *screen)
|
ppu_redraw(Ppu *p, Uint32 *screen)
|
||||||
{
|
{
|
||||||
Uint32 i, size = p->width * p->height;
|
Uint32 i, size = p->width * p->height, palette[16];
|
||||||
|
for(i = 0; i < 16; ++i)
|
||||||
|
palette[i] = p->palette[(i >> 2) ? (i >> 2) : (i & 3)];
|
||||||
for(i = 0; i < size; ++i)
|
for(i = 0; i < size; ++i)
|
||||||
screen[i] = p->palette[p->fg.pixels[i] ? p->fg.pixels[i] : p->bg.pixels[i]];
|
screen[i] = palette[p->fg.pixels[i] << 2 | p->bg.pixels[i]];
|
||||||
p->fg.changed = p->bg.changed = 0;
|
p->fg.changed = p->bg.changed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue