Example #1
0
void I_EnableLoadingDisk(void)
{
    patch_t *disk;
    byte *tmpbuf;
    char *disk_name;
    int y;
    char buf[20];

    SDL_VideoDriverName(buf, 15);

    if (!strcmp(buf, "Quartz"))
    {
        // MacOS Quartz gives us pageflipped graphics that screw up the 
        // display when we use the loading disk.  Disable it.
        // This is a gross hack.

        return;
    }

    if (M_CheckParm("-cdrom") > 0)
        disk_name = DEH_String("STCDROM");
    else
        disk_name = DEH_String("STDISK");

    disk = W_CacheLumpName(disk_name, PU_STATIC);

    // Draw the patch into a temporary buffer

    tmpbuf = Z_Malloc(SCREENWIDTH * (disk->height + 1), PU_STATIC, NULL);
    V_UseBuffer(tmpbuf);

    // Draw the disk to the screen:

    V_DrawPatch(0, 0, disk);

    disk_image = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H, PU_STATIC, NULL);
    saved_background = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H, PU_STATIC, NULL);

    for (y=0; y<LOADING_DISK_H; ++y) 
    {
        memcpy(disk_image + LOADING_DISK_W * y,
               tmpbuf + SCREENWIDTH * y,
               LOADING_DISK_W);
    }

    // All done - free the screen buffer and restore the normal 
    // video buffer.

    W_ReleaseLumpName(disk_name);
    V_RestoreBuffer();
    Z_Free(tmpbuf);
}
Example #2
0
//
// F_Drawer
//
void F_Drawer (void)
{
  if (finalestage == 2)
  {
    F_CastDrawer ();
    return;
  }

  if (!finalestage)
  {
    F_TextWrite ();
  }
  else
  {
    switch (gameepisode)
    {
    case 1:
      if ( gamemode == GAME_MODE_RETAIL )
        V_DrawPatch (0, 0, 0,
                     W_CacheLumpName("CREDIT", PU_CACHE));
      else
        V_DrawPatch (0, 0, 0,
                     W_CacheLumpName("HELP2", PU_CACHE));
      break;
    case 2:
      V_DrawPatch(0, 0, 0,
                  W_CacheLumpName("VICTORY2", PU_CACHE));
      break;
    case 3:
      F_BunnyScroll ();
      break;
    case 4:
      V_DrawPatch (0, 0, 0,
                   W_CacheLumpName("ENDPIC", PU_CACHE));
      break;
    }
  }

}
Example #3
0
//
// Draw small slider.
//
static void FE_DrawSlider(femenuitem_t *item, int x, int y, int pct)
{
    int i;
    int draw_x = x;
    int slider_width = 0;
    short wl, wm, wr, ws, hs;

    wl = fesliderwidths[FE_SLIDER_LEFT];
    wm = fesliderwidths[FE_SLIDER_MIDDLE];
    wr = fesliderwidths[FE_SLIDER_RIGHT];
    ws = fesliderwidths[FE_SLIDER_GEM];
    hs = fesliderheights[FE_SLIDER_GEM];

    item->valx = draw_x;
    item->valy = y;
    item->valh = hs;

    // left end
    V_DrawPatch(draw_x, y, feslidergfx[FE_SLIDER_LEFT]);
    draw_x += wl;

    // middle
    for(i = 0; i < 9; i++)
    {
        V_DrawPatch(draw_x, y, feslidergfx[FE_SLIDER_MIDDLE]);
        draw_x += wm - 1;
    }

    // right end
    V_DrawPatch(draw_x, y, feslidergfx[FE_SLIDER_RIGHT]);

    item->valw = (draw_x + wr) - item->valx;

    // gem position
    draw_x = FE_SliderPos(pct);

    // gem
    V_DrawPatch(x + draw_x, y, feslidergfx[FE_SLIDER_GEM]);
}
Example #4
0
void WI_drawStats(void)
{
	// line height
	int lh;     

	lh = (3*SHORT(num[0]->height))/2;

	WI_slamBackground();

	// draw animated background
	WI_drawAnimatedBack();
	
	WI_drawLF();

	V_DrawPatch(SP_STATSX, SP_STATSY, kills);
	WI_drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY, cnt_kills[0]);

	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, sp_secret);
	WI_drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY+2*lh, cnt_secret[0]);

	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, par);

        // Emulation: don't draw partime value if map33
        if (gamemode != commercial || wbs->last != NUMCMAPS)
        {
		WI_drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cnt_par);
	}
    }

}
Example #5
0
//
// Draws a number.
// If digits > 0, then use that many digits minimum,
//  otherwise only use as many as necessary.
// Returns new x position.
//
int WI_drawNum(int x, int y, int n, int digits)
{

    int         fontwidth = SHORT(num[0]->width);
    int         neg;
    int         temp;

    if (digits < 0)
    {
        if (!n)
            // make variable-length zeros 1 digit long
            digits = 1;
        else
        {
            // figure out # of digits in #
            digits = 0;
            temp = n;

            while (temp)
            {
                temp /= 10;
                digits++;
            }
        }
    }

    neg = n < 0;
    if (neg)
        n = -n;

    // if non-number, do not draw it
    if (n == 1994)
        return 0;

    // draw the new number
    while (digits--)
    {
        x -= fontwidth;
        x += 2 * (n % 10 == 1);
        V_DrawPatchWithShadow(x + 1, y + 1, FB, num[n % 10], true);
        x -= 2 * (n % 10 == 1);
        n /= 10;
    }

    // draw a minus sign if necessary
    if (neg)
        V_DrawPatch(x -= 8, y, FB, wiminus);

    return x;
}
Example #6
0
//
// SDLVideoDriver::InitDiskFlash
// 
// killough 10/98: init disk icon
//
void SDLVideoDriver::InitDiskFlash()
{
   SDL_Surface *disktmp = NULL;
   VBuffer diskvb;

   if(disk)
   {
      SDL_FreeSurface(disk);
      SDL_FreeSurface(disk_bg);
   }

   if(vbscreen.scaled)
   {
      drect.x = vbscreen.x1lookup[vbscreen.unscaledw - 16];
      drect.y = vbscreen.y1lookup[vbscreen.unscaledh - 15];
      drect.w = vbscreen.x2lookup[vbscreen.unscaledw - 1] - drect.x + 1;
      drect.h = vbscreen.y2lookup[vbscreen.unscaledh - 1] - drect.y + 1;
   }
   else
   {
      drect.x = vbscreen.width - 16;
      drect.y = vbscreen.height - 15;
      drect.w = 16;
      drect.h = 15;
   }

   // haleyjd 12/26/09: create disk in a temporary 8-bit surface, unconditionally
   disktmp = SDL_CreateRGBSurface(0, drect.w, drect.h, 8, 0, 0, 0, 0);
   SDL_SetPalette(disktmp, SDL_LOGPAL, colors, 0, 256);

   // setup VBuffer and point it into the SDL_Surface
   V_InitVBufferFrom(&diskvb, drect.w, drect.h, disktmp->pitch, 8, 
                     (byte *)(disktmp->pixels));
   V_SetScaling(&diskvb, 16, 15);

   // draw the disk graphic into the VBuffer
   V_DrawPatch(0, -1, &diskvb,
      PatchLoader::CacheName(wGlobalDir, /*cdrom_mode ? "STCDROM" :*/ "STDISK", PU_CACHE));

   // Done with VBuffer object
   V_FreeVBuffer(&diskvb);

   // Convert 8-bit disk into a surface-format surface - let SDL handle the 
   // specifics of the process, as it's designed for it.
   disk    = SDL_DisplayFormat(disktmp);
   disk_bg = SDL_DisplayFormat(disktmp);

   // Done with the temporary 8-bit disk.
   SDL_FreeSurface(disktmp);
}
//
// F_Drawer
//
void F_Drawer (void)
{
    if (::g->finalestage == 2)
    {
	F_CastDrawer ();
	return;
    }

    if (!::g->finalestage)
	F_TextWrite ();
    else
    {
	switch (::g->gameepisode)
	{
	  case 1:
	    if ( ::g->gamemode == retail )
	      V_DrawPatch (0,0,0,
			 (patch_t*)W_CacheLumpName("CREDIT",PU_CACHE_SHARED));
	    else
	      V_DrawPatch (0,0,0,
			 (patch_t*)W_CacheLumpName("HELP2",PU_CACHE_SHARED));
	    break;
	  case 2:
	    V_DrawPatch(0,0,0,
			(patch_t*)W_CacheLumpName("VICTORY2",PU_CACHE_SHARED));
	    break;
	  case 3:
	    F_BunnyScroll ();
	    break;
	  case 4:
	    V_DrawPatch (0,0,0,
			 (patch_t*)W_CacheLumpName("ENDPIC",PU_CACHE_SHARED));
	    break;
	}
    }
			
}
Example #8
0
void WI_drawNetgameStats(void)
{
    int		i;
    int		x;
    int		y;
    int		pwidth = SHORT(percent->width);

    WI_slamBackground();

    // draw animated background
    WI_drawAnimatedBack();

    WI_drawLF();

    // draw stat titles (top line)
    V_DrawPatch(NG_STATSX+NG_SPACINGX-SHORT(kills->width),
                NG_STATSY, kills);

    V_DrawPatch(NG_STATSX+2*NG_SPACINGX-SHORT(items->width),
                NG_STATSY, items);

    V_DrawPatch(NG_STATSX+3*NG_SPACINGX-SHORT(secret->width),
                NG_STATSY, secret);

    if (dofrags)
        V_DrawPatch(NG_STATSX+4*NG_SPACINGX-SHORT(frags->width),
                    NG_STATSY, frags);

    // draw stats
    y = NG_STATSY + SHORT(kills->height);

    for (i=0 ; i<MAXPLAYERS ; i++)
    {
        if (!playeringame[i])
            continue;

        x = NG_STATSX;
        V_DrawPatch(x-SHORT(p[i]->width), y, p[i]);

        if (i == me)
            V_DrawPatch(x-SHORT(p[i]->width), y, star);

        x += NG_SPACINGX;
        WI_drawPercent(x-pwidth, y+10, cnt_kills[i]);
        x += NG_SPACINGX;
        WI_drawPercent(x-pwidth, y+10, cnt_items[i]);
        x += NG_SPACINGX;
        WI_drawPercent(x-pwidth, y+10, cnt_secret[i]);
        x += NG_SPACINGX;

        if (dofrags)
            WI_drawNum(x, y+10, cnt_frags[i], -1);

        y += WI_SPACINGY;
    }

}
Example #9
0
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;
  }
}
Example #10
0
static void F_TextWrite (void)
{
	int		count;
	const char	*ch;
	int		c;
	int		cx, cy;
	patch_t		*w;
	int		width;

	F_DrawBackground();

	cx = 20;
	cy = 5;
	ch = finaletext;

	count = (finalecount - 10)/TEXTSPEED;
	if (count < 0)
		count = 0;
	for ( ; count; count--)
	{
		c = *ch++;
		if (!c)
			break;
		if (c == '\n')
		{
			cx = 20;
			cy += 9;
			continue;
		}

		c = toupper(c);
		if (c < 33)
		{
			cx += 5;
			continue;
		}

		w = (patch_t *) W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
		width = SHORT(w->width);
		if (cx + width > SCREENWIDTH)
			break;
#ifdef RENDER3D
		OGL_DrawPatch (cx, cy, FontABaseLump + c - 33);
#else
		V_DrawPatch(cx, cy, w);
#endif
		cx += width;
	}
}
Example #11
0
void F_CastPrint (const char *text)
{
    const char *ch;
    int		c;
    int		cx;
    int		w;
    int		width;
    
    // find width
    ch = text;
    width = 0;
	
    while (ch)
    {
	c = *ch++;
	if (!c)
	    break;
	c = toupper(c) - HU_FONTSTART;
	if (c < 0 || c> HU_FONTSIZE)
	{
	    width += 4;
	    continue;
	}
		
	w = SHORT (hu_font[c]->width);
	width += w;
    }
    
    // draw it
    cx = SCREENWIDTH/2-width/2;
    ch = text;
    while (ch)
    {
	c = *ch++;
	if (!c)
	    break;
	c = toupper(c) - HU_FONTSTART;
	if (c < 0 || c> HU_FONTSIZE)
	{
	    cx += 4;
	    continue;
	}
		
	w = SHORT (hu_font[c]->width);
	V_DrawPatch(cx, 180, hu_font[c]);
	cx+=w;
    }
	
}
Example #12
0
void HU_FragsDrawer()
{
  int i, y;
  char tempstr[50];
  
  if(!deathmatch)
    return;
  
  if(!action_frags)
    {
      if(players[displayplayer].playerstate != PST_DEAD ||
	 walkcam_active ||
	 !show_scores)
	return;
    }
  
  // "frags"
  V_DrawPatch(FRAGSX, FRAGSY, 0, fragspic);
  
  y = NAMEY;
  
  for(i=0; i<num_players; i++)
    {
      // write their name
      sprintf(tempstr, "%s%s", !demoplayback && 
	      sortedplayers[i]==players+consoleplayer ? FC_GRAY : FC_RED,
	      sortedplayers[i]->name);
      
      V_WriteText(tempstr, NAMEX - V_StringWidth(tempstr), y);
      
      // box behind frag pic
      
      V_DrawPatchTranslated
	(
	 FRAGNUMX, y,
	 0,
	 fragbox,
	 sortedplayers[i]->colormap ?
	      (char*)translationtables+256*(sortedplayers[i]->colormap-1) :
	      cr_red,
	 13
	 );

                        // draw the frags
      sprintf(tempstr, "%i", sortedplayers[i]->totalfrags);
      V_WriteText(tempstr, FRAGNUMX + 16 - V_StringWidth(tempstr)/2, y);
      y += 10;
    }
}
Example #13
0
void ST_refreshBackground(void)
{

    if (st_statusbaron)
    {
        V_UseBuffer(st_backing_screen);

	if(fsize != 4207819 && fsize != 4274218 && fsize != 10396254)	// HACK: NOT FOR SHARE 1.0 & 1.1 && REG 1.1
	    V_DrawPatch(ST_X, 0, sbar);
	else						// HACK: IF SHAREWARE 1.0 OR 1.1
	{
	    V_DrawPatch(0, 0, sbar_left_oldwad);
	    V_DrawPatch(104, 0, sbar_right_oldwad);
	}

	if (netgame)
	    V_DrawPatch(ST_FX, 0, faceback);

        V_RestoreBuffer();

	V_CopyRect(ST_X, 0, st_backing_screen, ST_WIDTH, ST_HEIGHT, ST_X, ST_Y);
    }

}
Example #14
0
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;
        }
        V_DrawPatch(cx, cy, w);
        cx += w->width;
    }
}
Example #15
0
void WI_drawNetgameStats(void)
{
    int		i;
    int		x;
    int		y;
    int		pwidth = SHORT(::g->percent->width);

    WI_slamBackground();
    
    // draw animated background
    WI_drawAnimatedBack(); 

    WI_drawLF();

    // draw stat titles (top line)
    V_DrawPatch(NG_STATSX+NG_SPACINGX-SHORT(::g->kills->width),
		NG_STATSY, FB, ::g->kills);

    V_DrawPatch(NG_STATSX+2*NG_SPACINGX-SHORT(::g->items->width),
		NG_STATSY, FB, ::g->items);

    V_DrawPatch(NG_STATSX+3*NG_SPACINGX-SHORT(::g->secret->width),
		NG_STATSY, FB, ::g->secret);
    
    if (::g->dofrags)
	V_DrawPatch(NG_STATSX+4*NG_SPACINGX-SHORT(::g->wistuff_frags->width),
		    NG_STATSY, FB, ::g->wistuff_frags);

    // draw stats
    y = NG_STATSY + SHORT(::g->kills->height);

    for (i=0 ; i<MAXPLAYERS ; i++)
    {
	if (!::g->playeringame[i])
	    continue;

	x = NG_STATSX;
	V_DrawPatch(x-SHORT(::g->wistuff_p[i]->width), y, FB, ::g->wistuff_p[i]);

	// No splitscreen on PC
	if (i == ::g->me /* && !gameLocal->IsSplitscreen() */ )
	    V_DrawPatch(x-SHORT(::g->wistuff_p[i]->width), y, FB, ::g->star);

	x += NG_SPACINGX;
	WI_drawPercent(x-pwidth, y+10, ::g->cnt_kills[i]);	x += NG_SPACINGX;
	WI_drawPercent(x-pwidth, y+10, ::g->cnt_items[i]);	x += NG_SPACINGX;
	WI_drawPercent(x-pwidth, y+10, ::g->cnt_secret[i]);	x += NG_SPACINGX;

	if (::g->dofrags)
	    WI_drawNum(x, y+10, ::g->cnt_frags[i], -1);

	y += WI_SPACINGY;
    }

}
Example #16
0
void STlib_updateArmsIcon(st_multicon_t *mi, dboolean refresh, int i)
{
    if (*mi->on && (mi->oldinum != *mi->inum || refresh) && *mi->inum != -1)
    {
        if (STYSNUM0)
            V_DrawPatch(mi->x, mi->y, FG, mi->p[*mi->inum]);
        else
        {
            if (r_detail == r_detail_low)
                STlib_drawLowNum(i + 2, (*mi->inum ? 160 : 93), 47, mi->x, mi->y);
            else
                STlib_drawHighNum(i + 2, (*mi->inum ? 160 : 93), 47, mi->x, mi->y);
        }
        mi->oldinum = *mi->inum;
    }
}
Example #17
0
//
// Draw the keys
//
void BoomHUD::DrawKeys(int x, int y)
{
   HU_WriteText(HUDCOLOR "Keys", x, y);    // draw then leave a gap
   x += GAP;

   // haleyjd 10/09/05: don't show double keys in Heretic
   for(int i = 0; i < GameModeInfo->numHUDKeys; i++)
   {
      if(E_GetItemOwnedAmountName(&hu_player, GameModeInfo->cardNames[i]) > 0)
      {
         // got that key
         V_DrawPatch(x, y, &subscreen43, keys[i]);
         x += 11;
      }
   }
}
Example #18
0
//
// Main Console functions
//
// ticker, responder, drawer, init etc.
//
void C_InitBackdrop(void)
{  
    patch_t *patch;

    switch(gamemode)
    {
    case retail:
    case registered:
        lumpname = "PFUB1";
        break;

    case shareware:
        lumpname = "WIMAP0";
        break;

    case commercial:
        lumpname = "INTERPIC";
        break;

    default:
        lumpname = "TITLEPIC";
        break;
    }

    // allow for custom console background graphic
    if(W_CheckNumForName("CONSOLE") >= 0)
        lumpname = "CONSOLE";

    backdrop_lumpnum = W_GetNumForName(lumpname);

    if(backdrop)
        Z_Free(backdrop);

    backdrop = Z_Malloc(SCREENWIDTH * SCREENHEIGHT, PU_STATIC, 0);

    // draw the console background image to the newly allocated video buffer
    patch = W_CacheLumpName(lumpname, PU_CACHE);

    // fill the video buffer with the newly allocated screen
    V_UseBuffer(backdrop);

    V_DrawPatch(0, 0, patch);

    // restore the backup up video buffer
    V_RestoreBuffer();
}
Example #19
0
void
WI_drawOnLnode
( int		n,
  patch_t*	c[] )
{

    int		i;
    int		left;
    int		top;
    int		right;
    int		bottom;
    boolean	fits = false;

    i = 0;
    do
    {
        left = lnodes[wbs->epsd][n].x - SHORT(c[i]->leftoffset);
        top = lnodes[wbs->epsd][n].y - SHORT(c[i]->topoffset);
        right = left + SHORT(c[i]->width);
        bottom = top + SHORT(c[i]->height);

        if (left >= 0
                && right < SCREENWIDTH
                && top >= 0
                && bottom < SCREENHEIGHT)
        {
            fits = true;
        }
        else
        {
            i++;
        }
    } while (!fits && i!=2 && c[i] != NULL);

    if (fits && i<2)
    {
        V_DrawPatch(lnodes[wbs->epsd][n].x,
                    lnodes[wbs->epsd][n].y,
                    c[i]);
    }
    else
    {
        // DEBUG
        printf("Could not place patch on level %d", n+1);
    }
}
Example #20
0
void STlib_updateArmsIcon(st_multicon_t *mi, dboolean refresh, int i)
{
    if ((mi->oldinum != *mi->inum || refresh) && *mi->inum != -1)
    {
        if (usesmallnums)
        {
            if (r_detail == r_detail_high)
                STlib_drawHighNum(i + 2, (*mi->inum ? 160 : 93), 47, mi->x, mi->y);
            else
                STlib_drawLowNum(i + 2, (*mi->inum ? 160 : 93), 47, mi->x, mi->y);
        }
        else
            V_DrawPatch(mi->x, mi->y, 0, mi->p[*mi->inum]);

        mi->oldinum = *mi->inum;
    }
}
Example #21
0
void MN_HelpDrawer()
{
  if(helpscreens[viewing_helpscreen].Drawer)
    {
      helpscreens[viewing_helpscreen].Drawer();   // call drawer
    }
  else
    {
      patch_t *patch;
      
      // load lump
      patch = W_CacheLumpNum(helpscreens[viewing_helpscreen].lumpnum,
			     PU_CACHE);
      // display lump
      V_DrawPatch(0, 0, 0, patch);
    }
}
Example #22
0
//
// Draw character quit prompt
//
void FE_DrawChar(void)
{
    char msg[128];

    if(!curCharacter)
        return;

    V_DrawPatch(0, 0, W_CacheLumpName(curCharacter->pic, PU_CACHE));
    M_WriteText(12, 18, curCharacter->name);

    M_StringCopy(msg, curCharacter->text, sizeof(msg));
    M_DialogDimMsg(20, 28, msg, false);
    M_WriteText(20, 28, msg);

    FE_WriteSmallTextCentered(160, "Are you sure you want to quit?");
    FE_WriteSmallTextCentered(172, "(Press Y or confirm to quit)");
}
static void LoadDiskImage(void)
{
    patch_t *disk;
    char *disk_name;
    int y;
    int xoffset = SCREENWIDTH - LOADING_DISK_W;
    int yoffset = SCREENHEIGHT - LOADING_DISK_H;
    char buf[20];

    SDL_VideoDriverName(buf, 15);

    if (!strcmp(buf, "Quartz"))
    {
        // MacOS Quartz gives us pageflipped graphics that screw up the 
        // display when we use the loading disk.  Disable it.
        // This is a gross hack.

        return;
    }

    if (M_CheckParm("-cdrom") > 0)
        disk_name = DEH_String("STCDROM");
    else
        disk_name = DEH_String("STDISK");

    disk = W_CacheLumpName(disk_name, PU_STATIC);

    // Draw the disk to the screen:

    V_DrawPatch(SCREENWIDTH - LOADING_DISK_W,
                SCREENHEIGHT - LOADING_DISK_H,
                0, disk);

    disk_image = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H, PU_STATIC, NULL);
    saved_background = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H, PU_STATIC, NULL);

    for (y=0; y<LOADING_DISK_H; ++y) 
    {
        memcpy(disk_image + LOADING_DISK_W * y,
               screens[0] + SCREENWIDTH * (y + yoffset) + xoffset,
               LOADING_DISK_W);
    }

    W_ReleaseLumpName(disk_name);
}
Example #24
0
static void DrawFileSlots(Menu_t * menu)
{
    int i;
    int x;
    int y;

    x = menu->x;
    y = menu->y;
    for (i = 0; i < 6; i++)
    {
        V_DrawPatch(x, y, W_CacheLumpName(DEH_String("M_FSLOT"), PU_CACHE));
        if (SlotStatus[i])
        {
            MN_DrTextA(SlotText[i], x + 5, y + 5);
        }
        y += ITEM_HEIGHT;
    }
}
Example #25
0
void WI_drawAnimatedBack(void)
{
	int			i;
	anim_t*		a;

	if (commercial)
		return;

	if (wbs->epsd > 2)
		return;

	for (i=0 ; i<NUMANIMS[wbs->epsd] ; i++)
	{
		a = &anims[wbs->epsd][i];

		if (a->ctr >= 0)
			V_DrawPatch(a->loc.x, a->loc.y, FB, a->p[a->ctr]);
    }
}
Example #26
0
void MN_DrTextB(char *text, int x, int y)
{
	char c;
	patch_t *p;

	while((c = *text++) != 0)
	{
		if(c < 33)
		{
			x += 8;
		}
		else
		{
			p = W_CacheLumpNum(FontBBaseLump+c-33, PU_CACHE);
			V_DrawPatch(x, y, p);
			x += p->width-1;
		}
	}
}
Example #27
0
static void ST_refreshBackground(void)
{
  if (st_statusbaron)
    {
      V_DrawPatch(ST_X, 0, BG, sbar);

      // killough 3/7/98: make face background change with displayplayer
      if (netgame)                      //sf: new colours
        V_DrawPatchTranslated(ST_FX, 0, BG, faceback,
                        plyr->colormap ?
                (char*)translationtables + 256*(plyr->colormap-1) :
                        cr_red, -1);


      V_CopyRect(ST_X, 0, BG, ST_WIDTH, ST_HEIGHT, ST_X, ST_Y, FG);

          // faces
      STlib_initMultIcon(&w_faces,  ST_FACESX, ST_FACESY, //default_faces,
       players[displayplayer].skin->faces, &st_faceindex, &st_statusbaron);
    }
}
Example #28
0
//
// Draws a small (at most) 5 digit number. It is RIGHT aligned for x and y.
// x is expected to be 8 more than its equivalent Heretic calls.
//
static void ST_drawSmallNumber(int val, int x, int y)
{
   if(val > 1)
   {
      patch_t *patch;
      char buf[6];

      // If you want more than 99,999 of something then you probably
      // know enough about coding to change this hard limit.
      if(val > 99999)
         val = 99999;
      sprintf(buf, "%d", val);
      x -= 4 * (strlen(buf));
      for(char *rover = buf; *rover; rover++)
      {
         int i = *rover - '0';
         patch = shortnum[i];
         V_DrawPatch(x, y, &subscreen43, patch);
         x += 4;
      }
   }
}
Example #29
0
static void ST_refreshBackground()
{
   if(st_statusbaron)
   {
      V_DrawPatch(ST_X, ST_FY, &subscreen43, sbar);

      // killough 3/7/98: make face background change with displayplayer
      // haleyjd 01/12/04: changed translation handling
      if(GameType != gt_single)
      {
         V_DrawPatchTranslated(ST_FX, ST_FY, &subscreen43, faceback,
            plyr->colormap ?
               translationtables[(plyr->colormap - 1)] :
               NULL, 
            false);
      }

      // faces
      STlib_initMultIcon(&w_faces,  ST_FACESX, ST_FACESY,
                         players[displayplayer].skin->faces, 
                         &st_faceindex, &st_statusbaron);
   }
}
Example #30
0
//
// STlib_updatePercent()
//
// Draws a number/percent conditionally based on the widget's enable
//
// Passed a precent widget, the output color range, and a refresh flag
// Returns nothing
//
void STlib_updatePercent
( st_percent_t*   per,
  char *outrng,             //jff 2/16/98 add color translation to digit output
  int refresh )
{
  if (refresh || *per->n.on) // killough 2/21/98: fix percents not updated;
    {
      if (!sts_always_red)     // also support gray-only percents
	V_DrawPatchTranslated
	  (
	   per->n.x,
	   per->n.y,
	   FG,
	   per->p,
	   sts_pct_always_gray ? cr_gray : outrng,
	   0
	   );
      else   //jff 2/18/98 allow use of faster draw routine from config
	V_DrawPatch(per->n.x, per->n.y, FG, per->p);
    }
  
  STlib_updateNum(&per->n, outrng, refresh);
}