mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-11-30 03:30:43 +00:00
[PATCH] Fix "end titles" bug in software renderer
Fix a bug in the software renderer where we write past the end of the rendering context if the end of episode text extends off the bottom of the screen. The bug had actually been fixed in QW but not NQ, so this patch fixes both consistently. Thanks to Sander van Dijk <a.h.vandijk@gmail.com> for both reporting the problem and finding the cause. Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
parent
06a9958685
commit
4a513d70f6
@ -118,7 +118,7 @@ SCR_CenterPrint(char *str)
|
||||
void
|
||||
SCR_EraseCenterString(void)
|
||||
{
|
||||
int y;
|
||||
int y, height;
|
||||
|
||||
if (scr_erase_center++ > vid.numpages) {
|
||||
scr_erase_lines = 0;
|
||||
@ -130,8 +130,11 @@ SCR_EraseCenterString(void)
|
||||
else
|
||||
y = 48;
|
||||
|
||||
/* Make sure we don't draw off the bottom of the screen*/
|
||||
height = qmin(8 * scr_erase_lines, ((int)vid.height) - y - 1);
|
||||
|
||||
scr_copytop = 1;
|
||||
Draw_TileClear(0, y, vid.width, 8 * scr_erase_lines);
|
||||
Draw_TileClear(0, y, vid.width, height);
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,7 +165,7 @@ SCR_CenterPrint(char *str)
|
||||
void
|
||||
SCR_EraseCenterString(void)
|
||||
{
|
||||
int y;
|
||||
int y, height;
|
||||
|
||||
if (scr_erase_center++ > vid.numpages) {
|
||||
scr_erase_lines = 0;
|
||||
@ -177,10 +177,11 @@ SCR_EraseCenterString(void)
|
||||
else
|
||||
y = 48;
|
||||
|
||||
// FIXME - min/signed/unsigned?
|
||||
/* Make sure we don't draw off the bottom of the screen*/
|
||||
height = qmin(8 * scr_erase_lines, ((int)vid.height) - y - 1);
|
||||
|
||||
scr_copytop = 1;
|
||||
Draw_TileClear(0, y, vid.width,
|
||||
qmin(8 * scr_erase_lines, ((int)vid.height) - y - 1));
|
||||
Draw_TileClear(0, y, vid.width, height);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user