Fix WININ priority trampling over the active windows (fixes #75)

This commit is contained in:
Jeffrey Pfau 2014-07-05 14:34:10 -07:00
parent ae12dd907c
commit 7142a0f820
2 changed files with 25 additions and 15 deletions

View File

@ -88,9 +88,17 @@ static void GBAVideoSoftwareRendererInit(struct GBAVideoRenderer* renderer) {
softwareRenderer->bldb = 0; softwareRenderer->bldb = 0;
softwareRenderer->bldy = 0; softwareRenderer->bldy = 0;
softwareRenderer->winN[0].h.packed = 0;
softwareRenderer->winN[0].v.packed = 0;
softwareRenderer->winN[0].control.packed = 0;
softwareRenderer->winN[0].control.priority = 0; softwareRenderer->winN[0].control.priority = 0;
softwareRenderer->winN[1].h.packed = 0;
softwareRenderer->winN[1].v.packed = 0;
softwareRenderer->winN[1].control.packed = 0;
softwareRenderer->winN[1].control.priority = 1; softwareRenderer->winN[1].control.priority = 1;
softwareRenderer->objwin.packed = 0;
softwareRenderer->objwin.priority = 2; softwareRenderer->objwin.priority = 2;
softwareRenderer->winout.packed = 0;
softwareRenderer->winout.priority = 3; softwareRenderer->winout.priority = 3;
softwareRenderer->mosaic.packed = 0; softwareRenderer->mosaic.packed = 0;

View File

@ -87,17 +87,19 @@ union WindowRegion {
uint16_t packed; uint16_t packed;
}; };
union WindowControl { struct WindowControl {
struct { union {
unsigned bg0Enable : 1; struct {
unsigned bg1Enable : 1; unsigned bg0Enable : 1;
unsigned bg2Enable : 1; unsigned bg1Enable : 1;
unsigned bg3Enable : 1; unsigned bg2Enable : 1;
unsigned objEnable : 1; unsigned bg3Enable : 1;
unsigned blendEnable : 1; unsigned objEnable : 1;
unsigned : 2; unsigned blendEnable : 1;
unsigned : 2;
};
uint8_t packed;
}; };
uint8_t packed;
int8_t priority; int8_t priority;
}; };
@ -105,7 +107,7 @@ union WindowControl {
struct Window { struct Window {
uint8_t endX; uint8_t endX;
union WindowControl control; struct WindowControl control;
}; };
struct GBAVideoSoftwareRenderer { struct GBAVideoSoftwareRenderer {
@ -146,13 +148,13 @@ struct GBAVideoSoftwareRenderer {
struct WindowN { struct WindowN {
union WindowRegion h; union WindowRegion h;
union WindowRegion v; union WindowRegion v;
union WindowControl control; struct WindowControl control;
} winN[2]; } winN[2];
union WindowControl winout; struct WindowControl winout;
union WindowControl objwin; struct WindowControl objwin;
union WindowControl currentWindow; struct WindowControl currentWindow;
int nWindows; int nWindows;
struct Window windows[MAX_WINDOW]; struct Window windows[MAX_WINDOW];