void F_TextWrite (void) { { // erase the entire screen to a tiled background const byte *src; // cph - const int x,y; int lump; // killough 4/17/98: src = W_CacheLumpNum(lump = firstflat + R_FlatNumForName(finaleflat)); V_DrawBlock(0, 0, 0, 64, 64, src, 0); for (y=0 ; y<SCREENHEIGHT ; y+=64) for (x=y ? 0 : 64; x<SCREENWIDTH ; x+=64) V_CopyRect(0, 0, 0, ((SCREENWIDTH-x) < 64) ? (SCREENWIDTH-x) : 64, ((SCREENHEIGHT-y) < 64) ? (SCREENHEIGHT-y) : 64, x, y, 0); W_UnlockLumpNum(lump); } V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT); { // draw some of the text onto the screen int cx = 10; int cy = 10; const char* ch = finaletext; // CPhipps - const int count = (finalecount - 10)/Get_TextSpeed(); // phares int w; if (count < 0) count = 0; for ( ; count ; count-- ) { int c = *ch++; if (!c) break; if (c == '\n') { cx = 10; cy += 11; continue; } c = toupper(c) - HU_FONTSTART; if (c < 0 || c> HU_FONTSIZE) { cx += 4; continue; } w = SHORT (hu_font[c]->width); if (cx+w > SCREENWIDTH) break; // CPhipps - patch drawing updated V_DrawMemPatch(cx, cy, 0, hu_font[c], NULL, VPT_STRETCH); cx+=w; } } }
void F_TextWrite(void) { int w; // killough 8/9/98: move variables below int count; char* ch; int c; int cx; int cy; // erase the entire screen to a tiled background // killough 11/98: the background-filling code was already in m_menu.c M_DrawBackground(finaleflat, screens[0]); // draw some of the text onto the screen cx = 10; cy = 10; ch = finaletext; count = (int)((finalecount - 10) / Get_TextSpeed()); // phares if (count < 0) count = 0; for (; count ; count--) { c = *ch++; if (!c) break; if (c == '\n') { cx = 10; cy += 11; continue; } c = toupper(c) - HU_FONTSTART; if (c < 0 || c > HU_FONTSIZE) { cx += 4; continue; } w = SwapShort(hu_font[c]->width); if (cx + w > SCREENWIDTH) break; V_DrawPatch(cx, cy, 0, hu_font[c]); cx += w; } }
OVERLAY void F_Ticker(void) { int i; if (!demo_compatibility) WI_checkForAccelerate(); // killough 3/28/98: check for acceleration else if (gamemode == commercial && finalecount > 50) // check for skipping for (i=0; i<MAXPLAYERS; i++) if (players[i].cmd.buttons) goto next_level; // go on to the next level // advance animation finalecount++; if (finalestage == 2) F_CastTicker(); if (!finalestage) { fixed_t speed, endcount; speed = demo_compatibility ? TEXTSPEED : Get_TextSpeed(); endcount = FixedMul(strlen(finaletext) * FRACUNIT, speed); endcount += (midstage ? NEWTEXTWAIT : TEXTWAIT); /* killough 2/28/98: changed to allow acceleration */ if (finalecount > endcount || (midstage && acceleratestage)) { if (gamemode != commercial) // Doom 1 / Ultimate Doom episode end { // with enough time, it's automatic finalecount = 0; finalestage = 1; wipegamestate = (gamestate_t)-1; // force a wipe if (gameepisode == 3) S_StartMusic(mus_bunny); } else // you must press a button to continue in Doom 2 if (!demo_compatibility && midstage) { next_level: if (gamemap == 30) F_StartCast(); // cast of Doom 2 characters else gameaction = ga_worlddone; // next level, e.g. MAP07 } } } }
OVERLAY void F_TextWrite (void) { V_DrawBackground(finaleflat); { // draw some of the text onto the screen int cx = 10; int cy = 10; const char* ch = finaletext; // CPhipps - const int count = FixedDiv(((finalecount - 10) * FRACUNIT), Get_TextSpeed()) >> FRACBITS; int w; if (count < 0) count = 0; for ( ; count ; count-- ) { int c = *ch++; if (!c) break; if (c == '\n') { cx = 10; cy += 11; continue; } c = toupper(c) - HU_FONTSTART; if (c < 0 || c> HU_FONTSIZE) { cx += 4; continue; } w = SHORT (hu_font[c]->width); if (cx+w > SCREENWIDTH) break; // CPhipps - patch drawing updated V_DrawMemPatch(cx, cy, 0, hu_font[c], NULL, VPT_STRETCH); cx+=w; } } }
static void F_TextWrite (void) { V_DrawBackground(finaleflat, 0); { // draw some of the text onto the screen int cx = 10; int cy = 10; const char* ch = finaletext; // CPhipps - const int count = (int)((float)(FinaleCount - 10)/Get_TextSpeed()); // phares int w; if (count < 0) count = 0; for ( ; count ; count-- ) { int c = *ch++; if (!c) break; if (c == '\n') { cx = 10; cy += 11; continue; } c = toupper(c) - HU_FONTSTART; if (c < 0 || c> HU_FONTSIZE) { cx += 4; continue; } w = hu_font[c].width; if (cx+w > SCREENWIDTH) break; // CPhipps - patch drawing updated V_DrawNumPatch(cx, cy, 0, hu_font[c].lumpnum, CR_DEFAULT, VPT_STRETCH); cx+=w; } } }