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->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[1].h.packed = 0;
softwareRenderer->winN[1].v.packed = 0;
softwareRenderer->winN[1].control.packed = 0;
softwareRenderer->winN[1].control.priority = 1;
softwareRenderer->objwin.packed = 0;
softwareRenderer->objwin.priority = 2;
softwareRenderer->winout.packed = 0;
softwareRenderer->winout.priority = 3;
softwareRenderer->mosaic.packed = 0;

View File

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