Esempio n. 1
0
//
// M_Drawer
// Called after the view has been rendered,
// but before it has been blitted.
//
void M_Drawer (void)
{
	unsigned short		i;
	short		max;
	char		string[40];
	int			start;

	::g->inhelpscreens = false;


	// Horiz. & Vertically center string and print it.
	if (::g->messageToPrint)
	{
		start = 0;
		::g->md_y = 100 - M_StringHeight(::g->messageString)/2;
		while(*(::g->messageString+start))
		{
			for (i = 0;i < strlen(::g->messageString+start);i++)
				if (*(::g->messageString+start+i) == '\n')
				{
					memset(string,0,40);
					strncpy(string,::g->messageString+start,i);
					start += i+1;
					break;
				}

				if (i == strlen(::g->messageString+start))
				{
					strcpy(string,::g->messageString+start);
					start += i;
				}

				::g->md_x = 160 - M_StringWidth(string)/2;
				M_WriteText(::g->md_x,::g->md_y,string);
				::g->md_y += SHORT(::g->hu_font[0]->height);
		}
		return;
	}


	if (!::g->menuactive)
		return;

	if (::g->currentMenu->routine)
		::g->currentMenu->routine();         // call Draw routine

	// DRAW MENU
	::g->md_x = ::g->currentMenu->x;
	::g->md_y = ::g->currentMenu->y;
	max = ::g->currentMenu->numitems;

	for (i=0;i<max;i++)
	{
		if (::g->currentMenu->menuitems[i].name[0])
			V_DrawPatchDirect (::g->md_x,::g->md_y,0,
			(patch_t*)W_CacheLumpName(::g->currentMenu->menuitems[i].name ,PU_CACHE_SHARED));
		::g->md_y += LINEHEIGHT;
	}


	// DRAW SKULL
	V_DrawPatchDirect(::g->md_x + SKULLXOFF,::g->currentMenu->y - 5 + ::g->itemOn*LINEHEIGHT, 0,
		(patch_t*)W_CacheLumpName(skullName[::g->whichSkull],PU_CACHE_SHARED));
}
Esempio n. 2
0
//
// M_Drawer
// Called after the view has been rendered,
// but before it has been blitted.
//
void M_Drawer (void)
{
  static short	x;
  static short	y;
  short			i;
  short			max;
  char			string[40];
  int				start;

  inhelpscreens = false;


  // Horiz. & Vertically center string and print it.
  if (messageToPrint)
  {
    start = 0;
    y = (short)(100 - M_StringHeight(messageString)/2);
    while(*(messageString+start))
    {
      for (i = 0;i < CGDstrlen(messageString+start);i++)
        if (*(messageString+start+i) == '\n')
        {
          memset(string,0,40);
          CGDstrncpy(string,messageString+start,i);
          start += i+1;
          break;
        }

        if (i == CGDstrlen(messageString+start))
        {
          CGDstrcpy(string,messageString+start);
          start += i;
        }

        x = (short)(160 - M_StringWidth(string)/2);
        M_WriteText(x,y,string);
        y = y + SHORT(hu_font[0]->height);
    }
    return;
  }

  if (!menuactive)
    return;

  if (currentMenu->routine)
    currentMenu->routine();         // call Draw routine

  // DRAW MENU
  x = currentMenu->x;
  y = currentMenu->y;
  max = currentMenu->numitems;

  for (i=0;i<max;i++)
  {
    if (currentMenu->menuitems[i].name[0])
      V_DrawPatchDirect (x,y,0,W_CacheLumpNamePatch(currentMenu->menuitems[i].name ,PU_CACHE));
    y += LINEHEIGHT;
  }


  // DRAW SKULL
  V_DrawPatchDirect(x + SKULLXOFF,currentMenu->y - 5 + itemOn*LINEHEIGHT, 0,W_CacheLumpNamePatch(skullName[whichSkull],PU_CACHE));
}