From 804c677bc9f9a3c89de257a1e6b14be27dea999b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 12 Sep 2020 22:16:23 +0300 Subject: VisBuf: Method for marking textures as valid --- src/ui/visbuf.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/visbuf.c') diff --git a/src/ui/visbuf.c b/src/ui/visbuf.c index 107b8568..64d861c6 100644 --- a/src/ui/visbuf.c +++ b/src/ui/visbuf.c @@ -123,6 +123,14 @@ void invalidRanges_VisBuf(const iVisBuf *d, const iRangei full, iRangei *out_inv } } +void validate_VisBuf(iVisBuf *d) { + iForIndices(i, d->buffers) { + iVisBufTexture *buf = &d->buffers[i]; + buf->validRange = + intersect_Rangei(d->vis, (iRangei){ buf->origin, buf->origin + d->texSize.y }); + } +} + void draw_VisBuf(const iVisBuf *d, iInt2 topLeft) { SDL_Renderer *render = renderer_Window(get_Window()); iForIndices(i, d->buffers) { -- cgit v1.2.3