mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Move bg clearing to reset
This commit is contained in:
parent
095481ae2e
commit
4a158427ee
|
@ -788,28 +788,6 @@ void GBAVideoGLRendererInit(struct GBAVideoRenderer* renderer) {
|
|||
for (i = 0; i < 4; ++i) {
|
||||
struct GBAVideoGLBackground* bg = &glRenderer->bg[i];
|
||||
bg->index = i;
|
||||
bg->enabled = 0;
|
||||
bg->priority = 0;
|
||||
bg->charBase = 0;
|
||||
bg->mosaic = 0;
|
||||
bg->multipalette = 0;
|
||||
bg->screenBase = 0;
|
||||
bg->overflow = 0;
|
||||
bg->size = 0;
|
||||
bg->target1 = 0;
|
||||
bg->target2 = 0;
|
||||
bg->x = 0;
|
||||
bg->y = 0;
|
||||
bg->refx = 0;
|
||||
bg->refy = 0;
|
||||
bg->affine.dx = 256;
|
||||
bg->affine.dmx = 0;
|
||||
bg->affine.dy = 0;
|
||||
bg->affine.dmy = 256;
|
||||
bg->affine.sx = 0;
|
||||
bg->affine.sy = 0;
|
||||
bg->offsetX = 0;
|
||||
bg->offsetY = 0;
|
||||
glGenFramebuffers(1, &bg->fbo);
|
||||
glGenTextures(1, &bg->tex);
|
||||
}
|
||||
|
@ -929,6 +907,33 @@ void GBAVideoGLRendererReset(struct GBAVideoRenderer* renderer) {
|
|||
glRenderer->objOffsetY = 0;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
struct GBAVideoGLBackground* bg = &glRenderer->bg[i];
|
||||
bg->index = i;
|
||||
bg->enabled = 0;
|
||||
bg->priority = 0;
|
||||
bg->charBase = 0;
|
||||
bg->mosaic = 0;
|
||||
bg->multipalette = 0;
|
||||
bg->screenBase = 0;
|
||||
bg->overflow = 0;
|
||||
bg->size = 0;
|
||||
bg->target1 = 0;
|
||||
bg->target2 = 0;
|
||||
bg->x = 0;
|
||||
bg->y = 0;
|
||||
bg->refx = 0;
|
||||
bg->refy = 0;
|
||||
bg->affine.dx = 256;
|
||||
bg->affine.dmx = 0;
|
||||
bg->affine.dy = 0;
|
||||
bg->affine.dmy = 256;
|
||||
bg->affine.sx = 0;
|
||||
bg->affine.sy = 0;
|
||||
bg->offsetX = 0;
|
||||
bg->offsetY = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 512; ++i) {
|
||||
int r = M_R5(glRenderer->d.palette[i]);
|
||||
int g = M_G5(glRenderer->d.palette[i]) << 1;
|
||||
|
|
Loading…
Reference in New Issue