mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Add window y offsetting
This commit is contained in:
parent
c8e1e14d3f
commit
4aed125b3e
|
@ -120,6 +120,8 @@ struct GBAVideoSoftwareRenderer {
|
|||
struct GBAVideoWindowRegion h;
|
||||
struct GBAVideoWindowRegion v;
|
||||
struct WindowControl control;
|
||||
int16_t offsetX;
|
||||
int16_t offsetY;
|
||||
} winN[2];
|
||||
|
||||
struct WindowControl winout;
|
||||
|
|
|
@ -1099,6 +1099,10 @@ static void _GBACoreAdjustVideoLayer(struct mCore* core, size_t id, int32_t x, i
|
|||
gbacore->renderer.objOffsetY = y;
|
||||
gbacore->renderer.oamDirty = 1;
|
||||
break;
|
||||
case GBA_LAYER_WIN0:
|
||||
gbacore->renderer.winN[id - GBA_LAYER_WIN0].offsetX = x;
|
||||
gbacore->renderer.winN[id - GBA_LAYER_WIN0].offsetY = y;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -443,13 +443,13 @@ static void GBAVideoSoftwareRendererWritePalette(struct GBAVideoRenderer* render
|
|||
|
||||
static void _breakWindow(struct GBAVideoSoftwareRenderer* softwareRenderer, struct WindowN* win, int y) {
|
||||
if (win->v.end >= win->v.start) {
|
||||
if (y >= win->v.end) {
|
||||
if (y >= win->v.end + win->offsetY) {
|
||||
return;
|
||||
}
|
||||
if (y < win->v.start) {
|
||||
if (y < win->v.start + win->offsetY) {
|
||||
return;
|
||||
}
|
||||
} else if (y >= win->v.end && y < win->v.start) {
|
||||
} else if (y >= win->v.end + win->offsetY && y < win->v.start + win->offsetY) {
|
||||
return;
|
||||
}
|
||||
if (win->h.end > GBA_VIDEO_HORIZONTAL_PIXELS || win->h.end < win->h.start) {
|
||||
|
|
Loading…
Reference in New Issue