summaryrefslogtreecommitdiff
path: root/src/ui/visbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/visbuf.c')
-rw-r--r--src/ui/visbuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/visbuf.c b/src/ui/visbuf.c
index a9443b34..e9bfee58 100644
--- a/src/ui/visbuf.c
+++ b/src/ui/visbuf.c
@@ -219,7 +219,7 @@ void validate_VisBuf(iVisBuf *d) {
219 219
220//#define DEBUG_SCALE 0.5f 220//#define DEBUG_SCALE 0.5f
221 221
222void draw_VisBuf(const iVisBuf *d, iInt2 topLeft) { 222void draw_VisBuf(const iVisBuf *d, const iInt2 topLeft, const iRangei yClipBounds) {
223 SDL_Renderer *render = renderer_Window(get_Window()); 223 SDL_Renderer *render = renderer_Window(get_Window());
224 iForIndices(i, d->buffers) { 224 iForIndices(i, d->buffers) {
225 const iVisBufTexture *buf = d->buffers + i; 225 const iVisBufTexture *buf = d->buffers + i;
@@ -227,6 +227,9 @@ void draw_VisBuf(const iVisBuf *d, iInt2 topLeft) {
227 topLeft.y + buf->origin, 227 topLeft.y + buf->origin,
228 d->texSize.x, 228 d->texSize.x,
229 d->texSize.y }; 229 d->texSize.y };
230 if (dst.y >= yClipBounds.end || dst.y + dst.h < yClipBounds.start) {
231 continue; /* Outside the clipping area. */
232 }
230#if defined (DEBUG_SCALE) 233#if defined (DEBUG_SCALE)
231 dst.w *= DEBUG_SCALE; 234 dst.w *= DEBUG_SCALE;
232 dst.h *= DEBUG_SCALE; 235 dst.h *= DEBUG_SCALE;