From 5f4e0b6578570f6dede7826760d5bcbb302454c7 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 4 Aug 2019 23:11:40 -0400 Subject: quake: Bail out of out-of-bounds draws With this Quake should hopefully be able to run at native resolution on smaller screens. Change-Id: Ic30c8356eb2fd030a4cf84c54b63c9b688a9c14a --- apps/plugins/sdl/progs/quake/draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/plugins/sdl/progs') diff --git a/apps/plugins/sdl/progs/quake/draw.c b/apps/plugins/sdl/progs/quake/draw.c index 2a2f65bf4c..c870e6baba 100644 --- a/apps/plugins/sdl/progs/quake/draw.c +++ b/apps/plugins/sdl/progs/quake/draw.c @@ -297,7 +297,7 @@ void Draw_Pic (int x, int y, qpic_t *pic) (y < 0) || (y + pic->height > vid.height)) { - Sys_Error ("Draw_Pic: bad coordinates"); + return; } source = pic->data; @@ -346,7 +346,7 @@ void Draw_TransPic (int x, int y, qpic_t *pic) if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 || (unsigned)(y + pic->height) > vid.height) { - Sys_Error ("Draw_TransPic: bad coordinates"); + return; } source = pic->data; @@ -433,7 +433,7 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation) if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 || (unsigned)(y + pic->height) > vid.height) { - Sys_Error ("Draw_TransPic: bad coordinates"); + return; } source = pic->data; -- cgit v1.2.3