当前位置: 首页>>代码示例>>C++>>正文


C++ V_DrawPatch函数代码示例

本文整理汇总了C++中V_DrawPatch函数的典型用法代码示例。如果您正苦于以下问题:C++ V_DrawPatch函数的具体用法?C++ V_DrawPatch怎么用?C++ V_DrawPatch使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了V_DrawPatch函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: I_EnableLoadingDisk

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);
}
开发者ID:MP2E,项目名称:chocolate-doom,代码行数:52,代码来源:i_video.c

示例2: F_Drawer

//
// 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;
    }
  }

}
开发者ID:peelonet,项目名称:DOOM,代码行数:42,代码来源:f_finale.c

示例3: FE_DrawSlider

//
// 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]);
}
开发者ID:Lord-Ptolemy,项目名称:strife-ve,代码行数:42,代码来源:fe_menuengine.c

示例4: WI_drawStats

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);
	}
    }

}
开发者ID:jfaulken,项目名称:chocolate-doom,代码行数:38,代码来源:wi_stuff.c

示例5: WI_drawNum

//
// 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;
}
开发者ID:gamebytes,项目名称:doomretro,代码行数:56,代码来源:wi_stuff.c

示例6: F_Drawer

//
// 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;
	}
    }
			
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:40,代码来源:f_finale.cpp

示例7: WI_drawNetgameStats

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;
    }

}
开发者ID:paulguy,项目名称:chocolate-doom,代码行数:57,代码来源:wi_stuff.c

示例8: F_TextWrite

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;
  }
}
开发者ID:AlexMax,项目名称:winmbf,代码行数:49,代码来源:f_finale.c

示例9: F_TextWrite

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;
	}
}
开发者ID:carstene1ns,项目名称:hheretic,代码行数:49,代码来源:f_finale.c

示例10: F_CastPrint

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;
    }
	
}
开发者ID:Azarien,项目名称:chocolate-doom,代码行数:49,代码来源:f_finale.c

示例11: HU_FragsDrawer

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;
    }
}
开发者ID:dorienh,项目名称:smmu,代码行数:49,代码来源:hu_frags.c

示例12: ST_refreshBackground

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);
    }

}
开发者ID:DooMJunkie,项目名称:wii-doom,代码行数:24,代码来源:st_stuff.c

示例13: DrawHubText

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;
    }
}
开发者ID:MP2E,项目名称:chocolate-doom,代码行数:48,代码来源:in_lude.c

示例14: WI_drawNetgameStats

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;
    }

}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:55,代码来源:wi_stuff.cpp

示例15: STlib_updateArmsIcon

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;
    }
}
开发者ID:Manuel-K,项目名称:doomretro,代码行数:16,代码来源:st_lib.c


注:本文中的V_DrawPatch函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。