// // MN_SkinDrawer // // The skin viewer widget drawer function. Puts the player sprite on // screen with the currently active properties (frame, rotation, and // lighting). // static void MN_SkinDrawer() { spritedef_t *sprdef; spriteframe_t *sprframe; int lump, rot = 0; bool flip; patch_t *patch; int pctype; int lighttouse; byte *translate = NULL; // draw the normal menu background V_DrawBackground(mn_background_flat, &vbscreen); // draw instructions and title MN_SkinInstructions(); pctype = players[consoleplayer].pclass->type; // get the player skin sprite definition if(skview_state->sprite == mobjinfo[pctype]->defsprite) sprdef = &sprites[players[consoleplayer].skin->sprite]; else sprdef = &sprites[skview_state->sprite]; if(!(sprdef->spriteframes)) return; // get the current frame, using the skin state and rotation vars sprframe = &sprdef->spriteframes[skview_state->frame&FF_FRAMEMASK]; if(sprframe->rotate) rot = skview_rot; lump = sprframe->lump[rot]; flip = !!sprframe->flip[rot]; lighttouse = (skview_state->frame & FF_FULLBRIGHT ? 0 : skview_light); if(players[consoleplayer].colormap) translate = translationtables[players[consoleplayer].colormap - 1]; // cache the sprite patch -- watch out for "firstspritelump"! patch = PatchLoader::CacheNum(wGlobalDir, lump+firstspritelump, PU_CACHE); // draw the sprite, with color translation and proper flipping // 01/12/04: changed translation handling V_DrawPatchTranslatedLit(160, 120, &subscreen43, patch, translate, colormaps[0] + 256 * lighttouse, flip); }
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; } } }