void IN_DrawYAH(void) { uint i; FR_SetFont(FID(GF_FONTA)); FR_LoadDefaultAttrib(); FR_SetColorAndAlpha(defFontRGB3[0], defFontRGB3[1], defFontRGB3[2], 1); FR_DrawTextXY3("NOW ENTERING:", 160, 10, ALIGN_TOP, DTF_ONLY_SHADOW); FR_SetFont(FID(GF_FONTB)); FR_SetColor(defFontRGB[0], defFontRGB[1], defFontRGB[2]); FR_DrawTextXY3(P_GetShortMapName(wbs->episode, wbs->nextMap), 160, 20, ALIGN_TOP, DTF_ONLY_SHADOW); DGL_Color4f(1, 1, 1, 1); for(i = 0; i < wbs->nextMap; ++i) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][i]); } if(players[CONSOLEPLAYER].didSecret) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][8]); } if(!(interTime & 16) || interState == 3) { // Draw the destination 'X' GL_DrawPatch(dpGoingThere, &YAHspot[wbs->episode][wbs->nextMap]); } }
void IN_DrawYAH() { FR_SetFont(FID(GF_FONTA)); FR_LoadDefaultAttrib(); FR_SetColorAndAlpha(defFontRGB3[0], defFontRGB3[1], defFontRGB3[2], 1); FR_DrawTextXY3("NOW ENTERING:", 160, 10, ALIGN_TOP, DTF_ONLY_SHADOW); FR_SetFont(FID(GF_FONTB)); FR_SetColor(defFontRGB[0], defFontRGB[1], defFontRGB[2]); FR_DrawTextXY3(G_MapTitle(&wbs->nextMap).toUtf8().constData(), 160, 20, ALIGN_TOP, DTF_ONLY_SHADOW); DGL_Color4f(1, 1, 1, 1); uint const nextMap = G_MapNumberFor(wbs->nextMap); for(uint i = 0; i < nextMap; ++i) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][i]); } if(players[CONSOLEPLAYER].didSecret) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][8]); } if(!(interTime & 16) || interState == 3) { // Draw the destination 'X' GL_DrawPatch(dpGoingThere, &YAHspot[::gameEpisode][nextMap]); } }
void ST_refreshBackground(void) { if(st_statusbaron) { GL_DrawPatch(ST_X, ST_Y, sbar.lump); if(IS_NETGAME) GL_DrawPatch(ST_FX, ST_Y, faceback.lump); } }
void IN_DrawOldLevel(void) { DGL_Enable(DGL_TEXTURE_2D); FR_SetFont(FID(GF_FONTB)); FR_LoadDefaultAttrib(); FR_SetColorAndAlpha(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); FR_DrawTextXY3(P_GetShortMapName(wbs->episode, wbs->currentMap), 160, 3, ALIGN_TOP, DTF_ONLY_SHADOW); FR_SetFont(FID(GF_FONTA)); FR_SetColor(defFontRGB3[0], defFontRGB3[1],defFontRGB3[2]); FR_DrawTextXY3("FINISHED", 160, 25, ALIGN_TOP, DTF_ONLY_SHADOW); if(wbs->currentMap == 8) { uint i; DGL_Color4f(1, 1, 1, 1); for(i = 0; i < wbs->nextMap; ++i) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][i]); } if(!(interTime & 16)) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][8]); } } else { uint i; DGL_Color4f(1, 1, 1, 1); for(i = 0; i < wbs->currentMap; ++i) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][i]); } if(players[CONSOLEPLAYER].didSecret) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][8]); } if(!(interTime & 16)) { GL_DrawPatch(dpBeenThere, &YAHspot[wbs->episode][wbs->currentMap]); } } DGL_Disable(DGL_TEXTURE_2D); }
void IN_DrawOldLevel() { DGL_Enable(DGL_TEXTURE_2D); FR_SetFont(FID(GF_FONTB)); FR_LoadDefaultAttrib(); FR_SetColorAndAlpha(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); FR_DrawTextXY3(G_MapTitle(&wbs->currentMap).toUtf8().constData(), 160, 3, ALIGN_TOP, DTF_ONLY_SHADOW); FR_SetFont(FID(GF_FONTA)); FR_SetColor(defFontRGB3[0], defFontRGB3[1],defFontRGB3[2]); FR_DrawTextXY3("FINISHED", 160, 25, ALIGN_TOP, DTF_ONLY_SHADOW); if(G_MapNumberFor(wbs->currentMap) == 8) { DGL_Color4f(1, 1, 1, 1); uint const nextMap = G_MapNumberFor(wbs->nextMap); for(uint i = 0; i < nextMap; ++i) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][i]); } if(!(interTime & 16)) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][8]); } } else { DGL_Color4f(1, 1, 1, 1); uint const currentMap = G_MapNumberFor(wbs->currentMap); for(uint i = 0; i < currentMap; ++i) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][i]); } if(players[CONSOLEPLAYER].didSecret) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][8]); } if(!(interTime & 16)) { GL_DrawPatch(dpBeenThere, &YAHspot[::gameEpisode][currentMap]); } } DGL_Disable(DGL_TEXTURE_2D); }
static void DrawHubText(void) { int count; char *ch; int c; int cx, cy; patch_t *w; cy = 5; cx = 10; ch = HubText; count = (intertime - 10) / TEXTSPEED; if(count < 0) { count = 0; } for(; count; count--) { c = *ch++; if(!c) { break; } if(c == '\n') { cx = 10; cy += 9; continue; } if(c < 32) { continue; } c = toupper(c); if(c == 32) { cx += 5; continue; } w = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE); if(cx + w->width > SCREENWIDTH) { break; } GL_DrawPatch(cx, cy, FontABaseLump + c - 33); cx += w->width; } }
/* * This routine tests for a string-replacement for the patch. If one is * found, it's used instead of the original graphic. * * If the patch is not in an IWAD, it won't be replaced! */ void WI_DrawPatch(int x, int y, int lump) { char def[80], *string; const char *name = W_LumpName(lump); // "{fontb; r=0.5; g=1; b=0; x=2; y=-2}This is good!" strcpy(def, "Patch Replacement|"); strcat(def, name); if(!cfg.usePatchReplacement || !W_IsFromIWAD(lump) || !Def_Get(DD_DEF_VALUE, def, &string)) { // Replacement string not found, draw the patch. GL_DrawPatch(x, y, lump); return; } WI_DrawParamText(x, y, string, hu_font_b, 1, 0, 0, false, false); }
void G_Drawer(void) { player_t *vplayer = &players[displayplayer]; boolean iscam = (vplayer->plr->flags & DDPF_CAMERA) != 0; // $democam // $democam: can be set on every frame if(cfg.setblocks > 10 || iscam) { // Full screen. R_ViewWindow(0, 0, 320, 200); } else { int w = cfg.setblocks * 32; int h = cfg.setblocks * (200 - SBARHEIGHT * cfg.sbarscale / 20) / 10; R_ViewWindow(160 - (w >> 1), (200 - SBARHEIGHT * cfg.sbarscale / 20 - h) >> 1, w, h); } // Do buffered drawing switch (gamestate) { case GS_LEVEL: // Clients should be a little careful about the first frames. if(IS_CLIENT && (!Get(DD_GAME_READY) || !Get(DD_GOTFRAME))) break; // Good luck trying to render the view without a viewpoint... if(!vplayer->plr->mo) break; if(leveltime < 2) { // Don't render too early; the first couple of frames // might be a bit unstable -- this should be considered // a bug, but since there's an easy fix... break; } if(automapactive) { AM_Drawer(); } else { boolean special200 = false; R_HandleSectorSpecials(); // Set flags for the renderer. if(IS_CLIENT) R_SetAllDoomsdayFlags(); GL_SetFilter(vplayer->plr->filter); // $democam // Check for the sector special 200: use sky2. // I wonder where this is used? if(vplayer->plr->mo->subsector->sector->special == 200) { special200 = true; Rend_SkyParams(0, DD_DISABLE, 0); Rend_SkyParams(1, DD_ENABLE, 0); } // How about a bit of quake? if(localQuakeHappening[displayplayer] && !paused) { int intensity = localQuakeHappening[displayplayer]; Set(DD_VIEWX_OFFSET, ((M_Random() % (intensity << 2)) - (intensity << 1)) << FRACBITS); Set(DD_VIEWY_OFFSET, ((M_Random() % (intensity << 2)) - (intensity << 1)) << FRACBITS); } else { Set(DD_VIEWX_OFFSET, 0); Set(DD_VIEWY_OFFSET, 0); } // The view angle offset. Set(DD_VIEWANGLE_OFFSET, ANGLE_MAX * -lookOffset); // Render the view. if(!dontrender) { R_RenderPlayerView(vplayer->plr); } if(special200) { Rend_SkyParams(0, DD_ENABLE, 0); Rend_SkyParams(1, DD_DISABLE, 0); } if(!iscam) X_Drawer(); // Draw the crosshair. R_DrawMapTitle(); } GL_Update(DDUF_FULLSCREEN); if(!iscam) SB_Drawer(); // $democam // We'll draw the chat text *after* the status bar to // be a bit clearer. CT_Drawer(); // Also update view borders? if(Get(DD_VIEWWINDOW_HEIGHT) != 200) GL_Update(DDUF_BORDER); break; case GS_INTERMISSION: IN_Drawer(); break; case GS_INFINE: GL_Update(DDUF_FULLSCREEN); break; case GS_WAITING: GL_DrawRawScreen(W_GetNumForName("TITLE"), 0, 0); gl.Color3f(1, 1, 1); MN_DrCenterTextA_CS("WAITING... PRESS ESC FOR MENU", 160, 188); GL_Update(DDUF_FULLSCREEN); break; default: break; } if(paused && !MenuActive && !askforquit && !fi_active) { if(!netgame) { GL_DrawPatch(160, Get(DD_VIEWWINDOW_Y) + 5, W_GetNumForName("PAUSED")); } else { GL_DrawPatch(160, 70, W_GetNumForName("PAUSED")); } } FI_Drawer(); }
void WI_slamBackground(void) { GL_DrawPatch(0, 0, bg.lump); }
void WI_loadData(void) { int i; int j; char name[9]; wianim_t *a; if(gamemode == commercial) strcpy(name, "INTERPIC"); else sprintf(name, "WIMAP%d", wbs->epsd); if(gamemode == retail) { if(wbs->epsd == 3) strcpy(name, "INTERPIC"); } if(!Get(DD_NOVIDEO)) { // background R_CachePatch(&bg, name); GL_DrawPatch(0, 0, bg.lump); } // UNUSED unsigned char *pic = screens[1]; // if (gamemode == commercial) // { // darken the background image // while (pic != screens[1] + SCREENHEIGHT*SCREENWIDTH) // { // *pic = colormaps[256*25 + *pic]; // pic++; // } //} if(gamemode == commercial) { NUMCMAPS = 32; lnames = (dpatch_t *) Z_Malloc(sizeof(dpatch_t) * NUMCMAPS, PU_STATIC, 0); for(i = 0; i < NUMCMAPS; i++) { sprintf(name, "CWILV%2.2d", i); //lnames[i] = W_CacheLumpName(name, PU_STATIC); R_CachePatch(&lnames[i], name); } } else { lnames = (dpatch_t *) Z_Malloc(sizeof(dpatch_t) * NUMMAPS, PU_STATIC, 0); for(i = 0; i < NUMMAPS; i++) { sprintf(name, "WILV%d%d", wbs->epsd, i); //lnames[i] = W_CacheLumpName(name, PU_STATIC); R_CachePatch(&lnames[i], name); } // you are here //yah[0] = W_CacheLumpName("WIURH0", PU_STATIC); R_CachePatch(&yah[0], "WIURH0"); // you are here (alt.) //yah[1] = W_CacheLumpName("WIURH1", PU_STATIC); R_CachePatch(&yah[1], "WIURH1"); // splat //splat = W_CacheLumpName("WISPLAT", PU_STATIC); R_CachePatch(&splat, "WISPLAT"); if(wbs->epsd < 3) { for(j = 0; j < NUMANIMS[wbs->epsd]; j++) { a = &anims[wbs->epsd][j]; for(i = 0; i < a->nanims; i++) { // MONDO HACK! if(wbs->epsd != 1 || j != 8) { // animations sprintf(name, "WIA%d%.2d%.2d", wbs->epsd, j, i); //a->p[i] = W_CacheLumpName(name, PU_STATIC); R_CachePatch(&a->p[i], name); } else { // HACK ALERT! //a->p[i] = anims[1][4].p[i]; memcpy(&a->p[i], &anims[1][4].p[i], sizeof(dpatch_t)); } } } } } // More hacks on minus sign. //wiminus = W_CacheLumpName("WIMINUS", PU_STATIC); R_CachePatch(&wiminus, "WIMINUS"); for(i = 0; i < 10; i++) { // numbers 0-9 sprintf(name, "WINUM%d", i); //num[i] = W_CacheLumpName(name, PU_STATIC); R_CachePatch(&num[i], name); } // percent sign R_CachePatch(&percent, "WIPCNT"); // "finished" R_CachePatch(&finished, "WIF"); // "entering" R_CachePatch(&entering, "WIENTER"); // "kills" R_CachePatch(&kills, "WIOSTK"); // "scrt" R_CachePatch(&secret, "WIOSTS"); // "secret" R_CachePatch(&sp_secret, "WISCRT2"); // Yuck. /*if (french) { // "items" if (netgame && !deathmatch) //items = W_CacheLumpName("WIOBJ", PU_STATIC); R_CachePatch(&items, "WIOBJ", PU_STATIC); else //items = W_CacheLumpName("WIOSTI", PU_STATIC); R_CachePatch(&items, "WIOSTI", PU_STATIC); } else */ //items = W_CacheLumpName("WIOSTI", PU_STATIC); R_CachePatch(&items, "WIOSTI"); // "frgs" R_CachePatch(&frags, "WIFRGS"); // ":" R_CachePatch(&colon, "WICOLON"); // "time" R_CachePatch(&time, "WITIME"); // "sucks" R_CachePatch(&sucks, "WISUCKS"); // "par" R_CachePatch(&par, "WIPAR"); // "killers" (vertical) R_CachePatch(&killers, "WIKILRS"); // "victims" (horiz) R_CachePatch(&victims, "WIVCTMS"); // "total" R_CachePatch(&total, "WIMSTT"); // your face R_CachePatch(&star, "STFST01"); // dead face R_CachePatch(&bstar, "STFDEAD0"); for(i = 0; i < MAXPLAYERS; i++) { // "1,2,3,4" sprintf(name, "STPB%d", i); //p[i] = W_CacheLumpName(name, PU_STATIC); R_CachePatch(&p[i], name); // "1,2,3,4" sprintf(name, "WIBP%d", i + 1); //bp[i] = W_CacheLumpName(name); R_CachePatch(&bp[i], name); } }
static void DrDeathTally(void) { int i, j; fixed_t xPos, yPos; fixed_t xDelta, yDelta; fixed_t xStart, scale; int x, y; boolean bold; static boolean showTotals; int temp; GL_DrawPatch(TALLY_TOP_X, TALLY_TOP_Y, W_GetNumForName("tallytop")); GL_DrawPatch(TALLY_LEFT_X, TALLY_LEFT_Y, W_GetNumForName("tallylft")); if(intertime < TALLY_EFFECT_TICKS) { showTotals = false; scale = (intertime * FRACUNIT) / TALLY_EFFECT_TICKS; xDelta = FixedMul(scale, TALLY_FINAL_X_DELTA); yDelta = FixedMul(scale, TALLY_FINAL_Y_DELTA); xStart = TALLY_START_XPOS - FixedMul(scale, TALLY_START_XPOS - TALLY_STOP_XPOS); yPos = TALLY_START_YPOS - FixedMul(scale, TALLY_START_YPOS - TALLY_STOP_YPOS); } else { xDelta = TALLY_FINAL_X_DELTA; yDelta = TALLY_FINAL_Y_DELTA; xStart = TALLY_STOP_XPOS; yPos = TALLY_STOP_YPOS; } if(intertime >= TALLY_EFFECT_TICKS && showTotals == false) { showTotals = true; S_StartSound(SFX_PLATFORM_STOP, NULL); } y = yPos >> FRACBITS; for(i = 0; i < MAXPLAYERS; i++) { xPos = xStart; for(j = 0; j < MAXPLAYERS; j++, xPos += xDelta) { x = xPos >> FRACBITS; bold = (i == consoleplayer || j == consoleplayer); if(players[i].plr->ingame && players[j].plr->ingame) { if(bold) { DrNumberBold(players[i].frags[j], x, y, 100); } else { DrNumber(players[i].frags[j], x, y, 100); } } else { temp = MN_TextAWidth("--") / 2; if(bold) { MN_DrTextAYellow("--", x - temp, y); } else { MN_DrTextA("--", x - temp, y); } } } if(showTotals && players[i].plr->ingame && !((slaughterboy & (1 << i)) && !(intertime & 16))) { DrNumber(totalFrags[i], TALLY_TOTALS_X, y, 1000); } yPos += yDelta; y = yPos >> FRACBITS; } }