mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 14:54:30 +01:00
Playing about with viewport setup
This commit is contained in:
@@ -338,7 +338,7 @@ void gfx_redraw_screen_rect(short left, short top, short right, short bottom)
|
||||
rct_drawpixelinfo *windowDPI = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_DPI, rct_drawpixelinfo);
|
||||
|
||||
// Unsure what this does
|
||||
RCT2_CALLPROC_X(0x00683326, left, top, right - 1, bottom - 1, 0, 0, 0);
|
||||
//RCT2_CALLPROC_X(0x00683326, left, top, right - 1, bottom - 1, 0, 0, 0);
|
||||
|
||||
windowDPI->bits = screenDPI->bits + left + ((screenDPI->width + screenDPI->pitch) * top);
|
||||
windowDPI->x = left;
|
||||
@@ -348,6 +348,21 @@ void gfx_redraw_screen_rect(short left, short top, short right, short bottom)
|
||||
windowDPI->pitch = screenDPI->width + screenDPI->pitch + left - right;
|
||||
|
||||
for (w = g_window_list; w < RCT2_GLOBAL(RCT2_ADDRESS_NEW_WINDOW_PTR, rct_window*); w++) {
|
||||
if (w->viewport != NULL && w != g_window_list){
|
||||
windowDPI->bits = screenDPI->bits + w->viewport->x + ((screenDPI->width + screenDPI->pitch)* w->viewport->y);
|
||||
windowDPI->x = w->viewport->x;
|
||||
windowDPI->y = w->viewport->y;
|
||||
windowDPI->width = w->viewport->width;
|
||||
windowDPI->height = w->viewport->height;
|
||||
windowDPI->pitch = screenDPI->width + screenDPI->pitch - w->viewport->width;
|
||||
window_draw(w, w->viewport->x, w->viewport->y, w->viewport->x + w->viewport->width, w->viewport->y + w->viewport->height);
|
||||
windowDPI->bits = screenDPI->bits + left + ((screenDPI->width + screenDPI->pitch) * top);
|
||||
windowDPI->x = left;
|
||||
windowDPI->y = top;
|
||||
windowDPI->width = right - left;
|
||||
windowDPI->height = bottom - top;
|
||||
windowDPI->pitch = screenDPI->width + screenDPI->pitch + left - right;
|
||||
}
|
||||
if (w->flags & WF_TRANSPARENT)
|
||||
continue;
|
||||
if (right <= w->x || bottom <= w->y)
|
||||
|
||||
@@ -290,7 +290,7 @@ void game_logic_update()
|
||||
// stop viewports from failing. Remove this when real bug cause has been
|
||||
// found.
|
||||
// ***********
|
||||
gfx_invalidate_screen();
|
||||
//gfx_invalidate_screen();
|
||||
// ***********
|
||||
|
||||
sub_68B089();
|
||||
|
||||
@@ -402,6 +402,8 @@ void viewport_render(rct_drawpixelinfo *dpi, rct_viewport *viewport, int left, i
|
||||
if (left >= viewport->x + viewport->width )return;
|
||||
if (top >= viewport->y + viewport->height )return;
|
||||
|
||||
int l = left, t = top, r = right, b = bottom;
|
||||
|
||||
left = max(left - viewport->x, 0);
|
||||
right = min(right - viewport->x, viewport->width);
|
||||
top = max(top - viewport->y, 0);
|
||||
@@ -424,7 +426,12 @@ void viewport_render(rct_drawpixelinfo *dpi, rct_viewport *viewport, int left, i
|
||||
top += 384;
|
||||
}
|
||||
//Paint
|
||||
viewport_paint(viewport, dpi, left, top, right, bottom);
|
||||
viewport_paint(viewport, dpi, left, top, right, bottom);
|
||||
|
||||
if (viewport != g_viewport_list){
|
||||
gfx_fill_rect_inset(dpi, l, t, r-1, b-1, 0x2, 0x30);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -208,7 +208,7 @@ static void window_viewport_update(rct_window *w)
|
||||
}
|
||||
|
||||
// Not sure how to invalidate part of the viewport that has changed, this will have to do for now
|
||||
widget_invalidate(w, WIDX_VIEWPORT);
|
||||
//widget_invalidate(w, WIDX_VIEWPORT);
|
||||
}
|
||||
|
||||
static void window_viewport_invalidate()
|
||||
|
||||
Reference in New Issue
Block a user