summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-12 22:16:23 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-12 22:16:23 +0300
commit804c677bc9f9a3c89de257a1e6b14be27dea999b (patch)
treeb8770919de82a97298e4b62971da340b839c489c /src
parentf7e2ac29ea9d312ef6c9be4ce015676e2e78027b (diff)
VisBuf: Method for marking textures as valid
Diffstat (limited to 'src')
-rw-r--r--src/ui/visbuf.c8
-rw-r--r--src/ui/visbuf.h1
2 files changed, 9 insertions, 0 deletions
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
123 } 123 }
124} 124}
125 125
126void validate_VisBuf(iVisBuf *d) {
127 iForIndices(i, d->buffers) {
128 iVisBufTexture *buf = &d->buffers[i];
129 buf->validRange =
130 intersect_Rangei(d->vis, (iRangei){ buf->origin, buf->origin + d->texSize.y });
131 }
132}
133
126void draw_VisBuf(const iVisBuf *d, iInt2 topLeft) { 134void draw_VisBuf(const iVisBuf *d, iInt2 topLeft) {
127 SDL_Renderer *render = renderer_Window(get_Window()); 135 SDL_Renderer *render = renderer_Window(get_Window());
128 iForIndices(i, d->buffers) { 136 iForIndices(i, d->buffers) {
diff --git a/src/ui/visbuf.h b/src/ui/visbuf.h
index f383789c..4b0908f9 100644
--- a/src/ui/visbuf.h
+++ b/src/ui/visbuf.h
@@ -47,6 +47,7 @@ void invalidate_VisBuf (iVisBuf *);
47void alloc_VisBuf (iVisBuf *, const iInt2 size, int granularity); 47void alloc_VisBuf (iVisBuf *, const iInt2 size, int granularity);
48void dealloc_VisBuf (iVisBuf *); 48void dealloc_VisBuf (iVisBuf *);
49void reposition_VisBuf (iVisBuf *, const iRangei vis); 49void reposition_VisBuf (iVisBuf *, const iRangei vis);
50void validate_VisBuf (iVisBuf *);
50 51
51void invalidRanges_VisBuf (const iVisBuf *, const iRangei full, iRangei *out_invalidRanges); 52void invalidRanges_VisBuf (const iVisBuf *, const iRangei full, iRangei *out_invalidRanges);
52void draw_VisBuf (const iVisBuf *, iInt2 topLeft); 53void draw_VisBuf (const iVisBuf *, iInt2 topLeft);