From e2e163c6e3fc1db2df6da1d4ed831fe6629e180b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 20 Sep 2008 20:32:24 +0000 Subject: Remove screen parameter from V_DrawPatch functions; update code to use V_UseBuffer where necessary. Subversion-branch: /branches/raven-branch Subversion-revision: 1248 --- src/doom/wi_stuff.c | 70 ++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) (limited to 'src/doom/wi_stuff.c') diff --git a/src/doom/wi_stuff.c b/src/doom/wi_stuff.c index 938d6915..e0e0ad24 100644 --- a/src/doom/wi_stuff.c +++ b/src/doom/wi_stuff.c @@ -429,13 +429,15 @@ void WI_drawLF(void) // draw V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2, - y, FB, lnames[wbs->last]); + y, + lnames[wbs->last]); // draw "Finished!" y += (5*SHORT(lnames[wbs->last]->height))/4; V_DrawPatch((SCREENWIDTH - SHORT(finished->width))/2, - y, FB, finished); + y, + finished); } @@ -447,13 +449,15 @@ void WI_drawEL(void) // draw "Entering" V_DrawPatch((SCREENWIDTH - SHORT(entering->width))/2, - y, FB, entering); + y, + entering); // draw level y += (5*SHORT(lnames[wbs->next]->height))/4; V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->next]->width))/2, - y, FB, lnames[wbs->next]); + y, + lnames[wbs->next]); } @@ -493,8 +497,9 @@ WI_drawOnLnode if (fits && i<2) { - V_DrawPatch(lnodes[wbs->epsd][n].x, lnodes[wbs->epsd][n].y, - FB, c[i]); + V_DrawPatch(lnodes[wbs->epsd][n].x, + lnodes[wbs->epsd][n].y, + c[i]); } else { @@ -601,7 +606,7 @@ void WI_drawAnimatedBack(void) a = &anims[wbs->epsd][i]; if (a->ctr >= 0) - V_DrawPatch(a->loc.x, a->loc.y, FB, a->p[a->ctr]); + V_DrawPatch(a->loc.x, a->loc.y, a->p[a->ctr]); } } @@ -658,13 +663,13 @@ WI_drawNum while (digits--) { x -= fontwidth; - V_DrawPatch(x, y, FB, num[ n % 10 ]); + V_DrawPatch(x, y, num[ n % 10 ]); n /= 10; } // draw a minus sign if necessary if (neg) - V_DrawPatch(x-=8, y, FB, wiminus); + V_DrawPatch(x-=8, y, wiminus); return x; @@ -679,7 +684,7 @@ WI_drawPercent if (p < 0) return; - V_DrawPatch(x, y, FB, percent); + V_DrawPatch(x, y, percent); WI_drawNum(x, y, p, -1); } @@ -714,14 +719,14 @@ WI_drawTime // draw if (div==60 || t / div) - V_DrawPatch(x, y, FB, colon); + V_DrawPatch(x, y, colon); } while (t / div); } else { // "sucks" - V_DrawPatch(x - SHORT(sucks->width), y, FB, sucks); + V_DrawPatch(x - SHORT(sucks->width), y, sucks); } } @@ -1009,11 +1014,10 @@ void WI_drawDeathmatchStats(void) // draw stat titles (top line) V_DrawPatch(DM_TOTALSX-SHORT(total->width)/2, DM_MATRIXY-WI_SPACINGY+10, - FB, total); - V_DrawPatch(DM_KILLERSX, DM_KILLERSY, FB, killers); - V_DrawPatch(DM_VICTIMSX, DM_VICTIMSY, FB, victims); + V_DrawPatch(DM_KILLERSX, DM_KILLERSY, killers); + V_DrawPatch(DM_VICTIMSX, DM_VICTIMSY, victims); // draw P? x = DM_MATRIXX + DM_SPACINGX; @@ -1025,33 +1029,29 @@ void WI_drawDeathmatchStats(void) { V_DrawPatch(x-SHORT(p[i]->width)/2, DM_MATRIXY - WI_SPACINGY, - FB, p[i]); V_DrawPatch(DM_MATRIXX-SHORT(p[i]->width)/2, y, - FB, p[i]); if (i == me) { V_DrawPatch(x-SHORT(p[i]->width)/2, DM_MATRIXY - WI_SPACINGY, - FB, bstar); V_DrawPatch(DM_MATRIXX-SHORT(p[i]->width)/2, y, - FB, star); } } else { // V_DrawPatch(x-SHORT(bp[i]->width)/2, - // DM_MATRIXY - WI_SPACINGY, FB, bp[i]); + // DM_MATRIXY - WI_SPACINGY, bp[i]); // V_DrawPatch(DM_MATRIXX-SHORT(bp[i]->width)/2, - // y, FB, bp[i]); + // y, bp[i]); } x += DM_SPACINGX; y += WI_SPACINGY; @@ -1283,17 +1283,17 @@ void WI_drawNetgameStats(void) // draw stat titles (top line) V_DrawPatch(NG_STATSX+NG_SPACINGX-SHORT(kills->width), - NG_STATSY, FB, kills); + NG_STATSY, kills); V_DrawPatch(NG_STATSX+2*NG_SPACINGX-SHORT(items->width), - NG_STATSY, FB, items); + NG_STATSY, items); V_DrawPatch(NG_STATSX+3*NG_SPACINGX-SHORT(secret->width), - NG_STATSY, FB, secret); + NG_STATSY, secret); if (dofrags) V_DrawPatch(NG_STATSX+4*NG_SPACINGX-SHORT(frags->width), - NG_STATSY, FB, frags); + NG_STATSY, frags); // draw stats y = NG_STATSY + SHORT(kills->height); @@ -1304,10 +1304,10 @@ void WI_drawNetgameStats(void) continue; x = NG_STATSX; - V_DrawPatch(x-SHORT(p[i]->width), y, FB, p[i]); + V_DrawPatch(x-SHORT(p[i]->width), y, p[i]); if (i == me) - V_DrawPatch(x-SHORT(p[i]->width), y, FB, star); + V_DrawPatch(x-SHORT(p[i]->width), y, star); x += NG_SPACINGX; WI_drawPercent(x-pwidth, y+10, cnt_kills[i]); x += NG_SPACINGX; @@ -1456,21 +1456,21 @@ void WI_drawStats(void) WI_drawLF(); - V_DrawPatch(SP_STATSX, SP_STATSY, FB, kills); + V_DrawPatch(SP_STATSX, SP_STATSY, kills); WI_drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY, cnt_kills[0]); - V_DrawPatch(SP_STATSX, SP_STATSY+lh, FB, items); + V_DrawPatch(SP_STATSX, SP_STATSY+lh, items); WI_drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY+lh, cnt_items[0]); - V_DrawPatch(SP_STATSX, SP_STATSY+2*lh, FB, sp_secret); + V_DrawPatch(SP_STATSX, SP_STATSY+2*lh, sp_secret); WI_drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY+2*lh, cnt_secret[0]); - V_DrawPatch(SP_TIMEX, SP_TIMEY, FB, timepatch); + V_DrawPatch(SP_TIMEX, SP_TIMEY, timepatch); WI_drawTime(SCREENWIDTH/2 - SP_TIMEX, SP_TIMEY, cnt_time); if (wbs->epsd < 3) { - V_DrawPatch(SCREENWIDTH/2 + SP_TIMEX, SP_TIMEY, FB, par); + V_DrawPatch(SCREENWIDTH/2 + SP_TIMEX, SP_TIMEY, par); WI_drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cnt_par); } @@ -1742,8 +1742,12 @@ void WI_loadData(void) sprintf(bg_lumpname, DEH_String("WIMAP%d"), wbs->epsd); } + // Draw backdrop and save to a temporary buffer + + V_UseBuffer(screens[1]); bg = W_CacheLumpName(bg_lumpname, PU_CACHE); - V_DrawPatch(0, 0, 1, bg); + V_DrawPatch(0, 0, bg); + V_RestoreBuffer(); } static void WI_unloadCallback(char *name, patch_t **variable) -- cgit v1.2.3