From b00b65538a1f7a04fdd46d7c193a7c59733fde9b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 9 Dec 2008 23:32:19 +0000 Subject: Make intermission screen work on MAP33, to be consistent with Vanilla Doom. Also, make levels after MAP33 trigger a V_DrawPatch error. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1414 --- src/wi_stuff.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/wi_stuff.c b/src/wi_stuff.c index 938d6915..238462de 100644 --- a/src/wi_stuff.c +++ b/src/wi_stuff.c @@ -427,13 +427,32 @@ void WI_drawLF(void) { int y = WI_TITLEY; - // draw - V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2, - y, FB, lnames[wbs->last]); + if (wbs->last < NUMCMAPS) + { + // draw + V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2, + y, FB, lnames[wbs->last]); + + // draw "Finished!" + y += (5*SHORT(lnames[wbs->last]->height))/4; + } + else if (wbs->last == NUMCMAPS) + { + // MAP33 - nothing is displayed! + } + else if (wbs->last > NUMCMAPS) + { + // > MAP33. Doom bombs out here with a Bad V_DrawPatch error. + // I'm pretty sure that doom2.exe is just reading into random + // bits of memory at this point, but let's try to be accurate + // anyway. This deliberately triggers a V_DrawPatch error. + + patch_t tmp = { SCREENWIDTH, SCREENHEIGHT, 1, 1, + { 0, 0, 0, 0, 0, 0, 0, 0 } }; + + V_DrawPatch(0, y, FB, &tmp); + } - // draw "Finished!" - y += (5*SHORT(lnames[wbs->last]->height))/4; - V_DrawPatch((SCREENWIDTH - SHORT(finished->width))/2, y, FB, finished); } -- cgit v1.2.3