예제 #1
0
//
// STlib_updateMultIcon()
//
// Draw a st_multicon_t widget, used for a multigraphic display
// like the status bar's keys. Displays each when the control
// numbers change or refresh is true
//
// Passed a st_multicon_t widget, and a refresh flag
// Returns nothing.
//
void STlib_updateMultIcon
( st_multicon_t*  mi,
  boolean   refresh )
{
  int w;
  int h;
  int x;
  int y;

  if (*mi->on && (mi->oldinum != *mi->inum || refresh))
  {
    if (mi->oldinum != -1)
    {
      x = mi->x - mi->p[mi->oldinum].leftoffset;
      y = mi->y - mi->p[mi->oldinum].topoffset;
      w = mi->p[mi->oldinum].width;
      h = mi->p[mi->oldinum].height;

#ifdef RANGECHECK
      if (y - ST_Y < 0)
        I_Error("STlib_updateMultIcon: y - ST_Y < 0");
#endif

      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG_L, VPT_STRETCH);
      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG_R, VPT_STRETCH);
    }
    if (*mi->inum != -1) { // killough 2/16/98: redraw only if != -1
      V_DrawNumPatch(mi->x, mi->y, FG_L, mi->p[*mi->inum].lumpnum, CR_DEFAULT, VPT_STRETCH);
      V_DrawNumPatch(mi->x, mi->y, FG_R, mi->p[*mi->inum].lumpnum, CR_DEFAULT, VPT_STRETCH);
    }
    mi->oldinum = *mi->inum;
  }
}
예제 #2
0
파일: f_wipe.c 프로젝트: WinterMute/dsdoom
int wipe_EndScreen(int x, int y, int width, int height)
{
  wipe_scr_end = screens[DEST_SCR] = malloc(SCREENWIDTH * SCREENHEIGHT);
  V_CopyRect(x, y, 0,       width, height, x, y, DEST_SCR, VPT_NONE); // Copy end screen to buffer
  V_CopyRect(x, y, SRC_SCR, width, height, x, y, 0       , VPT_NONE); // restore start screen
  return 0;
}
예제 #3
0
//
// STlib_updateBinIcon()
//
// DInitialize a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons, that are present or not.
//
// Draw a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons that are present or not. Displays each
// when the control flag changes or refresh is true
//
// Passed a st_binicon_t widget, and a refresh flag
// Returns nothing.
//
void STlib_updateBinIcon
( st_binicon_t*   bi,
  boolean   refresh )
{
  int     x;
  int     y;
  int     w;
  int     h;

  if (*bi->on && (bi->oldval != *bi->val || refresh))
  {
    x = bi->x - bi->p->leftoffset;
    y = bi->y - bi->p->topoffset;
    w = bi->p->width;
    h = bi->p->height;

#ifdef RANGECHECK
    if (y - ST_Y < 0)
      I_Error("STlib_updateBinIcon: y - ST_Y < 0");
#endif

    if (*bi->val) {
      V_DrawNumPatch(bi->x, bi->y, FG_L, bi->p->lumpnum, CR_DEFAULT, VPT_STRETCH);
      V_DrawNumPatch(bi->x, bi->y, FG_R, bi->p->lumpnum, CR_DEFAULT, VPT_STRETCH);
    } else {
      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG_L, VPT_STRETCH);
      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG_R, VPT_STRETCH);
    }
    bi->oldval = *bi->val;
  }
}
예제 #4
0
int wipe_EndScreen(void)
{
  wipe_scr_end.width = SCREENWIDTH;
  wipe_scr_end.height = SCREENHEIGHT;
  wipe_scr_end.byte_pitch = screens[0].byte_pitch;
  wipe_scr_end.short_pitch = screens[0].short_pitch;
  wipe_scr_end.int_pitch = screens[0].int_pitch;
  wipe_scr_end.not_on_heap = false;
  V_AllocScreen(&wipe_scr_end);
  screens[DEST_SCR] = wipe_scr_end;
  V_CopyRect(0, 0, 0,       SCREENWIDTH, SCREENHEIGHT, 0, 0, DEST_SCR, VPT_NONE); // Copy end screen to buffer
  V_CopyRect(0, 0, SRC_SCR, SCREENWIDTH, SCREENHEIGHT, 0, 0, 0       , VPT_NONE); // restore start screen
  return 0;
}
예제 #5
0
OVERLAY static void F_BunnyScroll (void)
{
  char        name[10];
  int         stage;
  static int  laststage;

  V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
  {
    int scrolled = (finalecount-230)/2;
    if (scrolled <= 0) {
      V_DrawNamePatch(0, 0, 0, pfub2, NULL, VPT_STRETCH);
    } else if (scrolled >= 320) {
      V_DrawNamePatch(0, 0, 0, pfub1, NULL, VPT_STRETCH);
    } else {
#define SCRN 2
      int realscrolled = (SCREENWIDTH * scrolled) / 320;

      V_AllocScreen(SCRN);
      V_DrawNamePatch(0, 0, SCRN, pfub2, NULL, VPT_STRETCH);
      V_CopyRect(realscrolled, 0, SCRN, SCREENWIDTH-realscrolled, SCREENHEIGHT, 0, 0, 0);
      V_DrawNamePatch(0, 0, SCRN, pfub1, NULL, VPT_STRETCH);
      V_CopyRect(0, 0, SCRN, realscrolled, SCREENHEIGHT, SCREENWIDTH-realscrolled, 0, 0);
      V_FreeScreen(SCRN);
    }
  }

  if (finalecount < 1130)
    return;
  if (finalecount < 1180)
  {
    // CPhipps - patch drawing updated
    V_DrawNamePatch((320-13*8)/2, (200-8*8)/2,0, "END0", NULL, VPT_STRETCH);
    laststage = 0;
    return;
  }
      
  stage = (finalecount-1180) / 5;
  if (stage > 6)
    stage = 6;
  if (stage > laststage)
  {
    S_StartSound (NULL, sfx_pistol);
    laststage = stage;
  }
      
  sprintf (name,"END%i",stage);
  // CPhipps - patch drawing updated
  V_DrawNamePatch((320-13*8)/2, (200-8*8)/2, 0, name, NULL, VPT_STRETCH);
}
예제 #6
0
파일: st_stuff.c 프로젝트: twinaphex/sdcell
static void ST_refreshBackground(void)
{
  int y = ST_Y;
  enum patch_translation_e flags = VPT_ALIGN_LEFT_TOP;
  
  if (st_statusbaron)
    {
      flags = VPT_ALIGN_BOTTOM;

      V_DrawNumPatch(ST_X, y, BG, stbarbg.lumpnum, CR_DEFAULT, flags);
      if (!deathmatch)
      {
        V_DrawNumPatch(ST_ARMSBGX, y, BG, armsbg.lumpnum, CR_DEFAULT, flags);
      }

      // killough 3/7/98: make face background change with displayplayer
      if (netgame)
      {
        V_DrawNumPatch(ST_FX, y, BG, faceback.lumpnum,
           displayplayer ? CR_LIMIT+displayplayer : CR_DEFAULT,
           displayplayer ? (VPT_TRANS | VPT_ALIGN_BOTTOM) : flags);
      }
      V_CopyRect(BG, FG, ST_X + wide_offsetx, SCREENHEIGHT - ST_SCALED_HEIGHT, ST_SCALED_WIDTH, ST_SCALED_HEIGHT, VPT_NONE);
    }
}
예제 #7
0
void
STlib_updateMultIcon
( st_multicon_t*	mi,
  qboolean		refresh)
{
    int			w;
    int			h;
    int			x;
    int			y;

    if (*mi->on
            && (mi->oldinum != *mi->inum || refresh)
            && (*mi->inum!=-1))
    {
        if (mi->oldinum != -1)
        {
            x = mi->x - SHORT(mi->p[mi->oldinum]->leftoffset);
            y = mi->y - SHORT(mi->p[mi->oldinum]->topoffset);
            w = SHORT(mi->p[mi->oldinum]->width);
            h = SHORT(mi->p[mi->oldinum]->height);

            if (y - ST_Y < 0)
                I_Error("updateMultIcon: y - ST_Y < 0");

            V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG);
        }
        V_DrawPatch(mi->x, mi->y, FG, mi->p[*mi->inum]);
        mi->oldinum = *mi->inum;
    }
}
예제 #8
0
void
STlib_updateBinIcon
( st_binicon_t*		bi,
  qboolean		refresh)
{
    int			x;
    int			y;
    int			w;
    int			h;

    if (*bi->on
            && (bi->oldval != *bi->val || refresh))
    {
        x = bi->x - SHORT(bi->p->leftoffset);
        y = bi->y - SHORT(bi->p->topoffset);
        w = SHORT(bi->p->width);
        h = SHORT(bi->p->height);

        if (y - ST_Y < 0)
            I_Error("updateBinIcon: y - ST_Y < 0");

        if (*bi->val)
            V_DrawPatch(bi->x, bi->y, FG, bi->p);
        else
            V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG);

        bi->oldval = *bi->val;
    }

}
예제 #9
0
//
// STlib_updateMultIcon()
//
// Draw a st_multicon_t widget, used for a multigraphic display
// like the status bar's keys. Displays each when the control
// numbers change or refresh is true
//
// Passed a st_multicon_t widget, and a refresh flag
// Returns nothing.
//
void STlib_updateMultIcon
( st_multicon_t*  mi,
  boolean   refresh )
{
  int w;
  int h;
  int x;
  int y;

  if (*mi->on && (mi->oldinum != *mi->inum || refresh))
  {
    if (mi->oldinum != -1)
    {
      x = mi->x - SHORT(mi->p[mi->oldinum]->leftoffset);
      y = mi->y - SHORT(mi->p[mi->oldinum]->topoffset);
      w = SHORT(mi->p[mi->oldinum]->width);
      h = SHORT(mi->p[mi->oldinum]->height);

#ifdef RANGECHECK
      if (y - ST_Y < 0)
        I_Error("updateMultIcon: y - ST_Y < 0");
#endif

      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG);
    }
    if (*mi->inum != -1)  // killough 2/16/98: redraw only if != -1
      V_DrawMemPatch(mi->x, mi->y, FG, mi->p[*mi->inum], NULL, VPT_NONE);
    mi->oldinum = *mi->inum;
  }
}
예제 #10
0
파일: st_lib.c 프로젝트: 4nykey/rockbox
//
// STlib_updateBinIcon()
//
// DInitialize a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons, that are present or not.
//
// Draw a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons that are present or not. Displays each
// when the control flag changes or refresh is true
//
// Passed a st_binicon_t widget, and a refresh flag
// Returns nothing.
//
void STlib_updateBinIcon
( st_binicon_t*   bi,
  boolean   refresh )
{
   int     x;
   int     y;
   int     w;
   int     h;

   if (*bi->on && (bi->oldval != (signed)*bi->val || refresh))
   {
      x = bi->x - SHORT(bi->p->leftoffset);
      y = bi->y - SHORT(bi->p->topoffset);
      w = SHORT(bi->p->width);
      h = SHORT(bi->p->height);

#ifdef RANGECHECK
      if (y - ST_Y < 0)
         I_Error("STlib_updateBinIcon: y - ST_Y < 0");
#endif

      if (*bi->val)
         V_DrawNumPatch(bi->x, bi->y, FG, bi->p->lumpnum, CR_DEFAULT, VPT_STRETCH);
      else
         V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG, VPT_STRETCH);

      bi->oldval = *bi->val;
   }
}
예제 #11
0
파일: st_lib.c 프로젝트: evanshauser/doom
//
// STlib_updateBinIcon()
//
// DInitialize a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons, that are present or not.
//
// Draw a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons that are present or not. Displays each
// when the control flag changes or refresh is true
//
// Passed a st_binicon_t widget, and a refresh flag
// Returns nothing.
//
OVERLAY void STlib_updateBinIcon
( st_binicon_t*   bi,
  boolean   refresh )
{
  int     x;
  int     y;
  int     w;
  int     h;

  if (*bi->on && (bi->oldval != *bi->val || refresh))
  {
    x = bi->x - SHORT(bi->p->leftoffset);
    y = bi->y - SHORT(bi->p->topoffset);
    w = SHORT(bi->p->width);
    h = SHORT(bi->p->height);

#ifdef RANGECHECK
    if (y - ST_Y < 0)
      I_Error("updateBinIcon: y - ST_Y < 0");
#endif

    if (*bi->val)
      V_DrawMemPatch(bi->x, bi->y, FG, bi->p, NULL, VPT_NONE);
    else
      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG);

    bi->oldval = *bi->val;
  }
}
예제 #12
0
// 
// A fairly efficient way to draw a number
//  based on differences from the old number.
// Note: worth the trouble?
//
void
STlib_drawNum
( st_number_t*	n,
  qboolean	refresh )
{

    int		numdigits = n->width;
    int		num = *n->num;
    
    int		w = SHORT(n->p[0]->width);
    int		h = SHORT(n->p[0]->height);
    int		x = n->x;
    
    int		neg;

    n->oldnum = *n->num;

    neg = num < 0;

    if (neg)
    {
	if (numdigits == 2 && num < -9)
	    num = -9;
	else if (numdigits == 3 && num < -99)
	    num = -99;
	
	num = -num;
    }

    // clear the area
    x = n->x - numdigits*w;

    if (n->y - ST_Y < 0)
	I_Error("drawNum: n->y - ST_Y < 0");

    V_CopyRect(x, n->y - ST_Y, BG, w*numdigits, h, x, n->y, FG);

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

    x = n->x;

    // in the special case of 0, you draw 0
    if (!num)
	V_DrawPatch(x - w, n->y, FG, n->p[ 0 ]);

    // draw the new number
    while (num && numdigits--)
    {
	x -= w;
	V_DrawPatch(x, n->y, FG, n->p[ num % 10 ]);
	num /= 10;
    }

    // draw a minus sign if necessary
    if (neg)
	V_DrawPatch(x - 8, n->y, FG, ::g->sttminus);
}
예제 #13
0
파일: f_finale.c 프로젝트: hexameron/DOOM
void F_TextWrite (void)
{
  {
    // erase the entire screen to a tiled background
    const byte *src; // cph - const
    int         x,y;
    int         lump;
    
    // killough 4/17/98: 
    src = W_CacheLumpNum(lump = firstflat + R_FlatNumForName(finaleflat));
    
    V_DrawBlock(0, 0, 0, 64, 64, src, 0);
    
    for (y=0 ; y<SCREENHEIGHT ; y+=64)
      for (x=y ? 0 : 64; x<SCREENWIDTH ; x+=64)
	V_CopyRect(0, 0, 0, ((SCREENWIDTH-x) < 64) ? (SCREENWIDTH-x) : 64, 
		   ((SCREENHEIGHT-y) < 64) ? (SCREENHEIGHT-y) : 64, x, y, 0);
    W_UnlockLumpNum(lump);
  }
  V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
  { // draw some of the text onto the screen
    int         cx = 10;
    int         cy = 10;
    const char* ch = finaletext; // CPhipps - const
    int         count = (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 = 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;
    }
  }
}
예제 #14
0
파일: st_stuff.c 프로젝트: AlexMax/winmbf
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)
      V_DrawPatch(ST_FX, 0, BG, faceback[displayplayer]);

    V_CopyRect(ST_X, 0, BG, ST_WIDTH, ST_HEIGHT, ST_X, ST_Y, FG);
  }
}
예제 #15
0
int wipe_StartScreen(void)
{
  wipe_scr_start.width = SCREENWIDTH;
  wipe_scr_start.height = SCREENHEIGHT;
  wipe_scr_start.byte_pitch = screens[0].byte_pitch;
  wipe_scr_start.short_pitch = screens[0].short_pitch;
  wipe_scr_start.int_pitch = screens[0].int_pitch;
  wipe_scr_start.not_on_heap = false;
  V_AllocScreen(&wipe_scr_start);
  screens[SRC_SCR] = wipe_scr_start;
  V_CopyRect(0, 0, 0,       SCREENWIDTH, SCREENHEIGHT, 0, 0, SRC_SCR, VPT_NONE ); // Copy start screen to buffer
  return 0;
}
예제 #16
0
파일: st_stuff.c 프로젝트: Vraiment/VROOM
void ST_refreshBackground(void)
{

    if (st_statusbaron)
    {
	V_DrawPatch(ST_X, 0, BG, sbar);

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

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

}
예제 #17
0
OVERLAY void ST_refreshBackground(void)
{
    if (st_statusbaron)
    {
        // CPhipps - patch drawing updated
        V_DrawBlock(ST_X, 0, BG, sbar_width, sbar_height, sbar, VPT_NONE);

        // killough 3/7/98: make face background change with displayplayer
        if (netgame) {
            int whattrans = playernumtotrans[displayplayer];
            V_DrawMemPatch(ST_FX, 0, BG, faceback,
                           whattrans ? translationtables + 256*(whattrans-1) : NULL,
                           whattrans ? VPT_TRANS : VPT_NONE);
        }

        V_CopyRect(ST_X, 0, BG, ST_WIDTH, ST_HEIGHT, ST_X, ST_Y, FG);
    }
}
예제 #18
0
void ST_refreshBackground(void)
{

    if (st_statusbaron)
    {
        V_UseBuffer(st_backing_screen);

	V_DrawPatch(ST_X, 0, sbar);

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

}
예제 #19
0
파일: st_stuff.c 프로젝트: dorienh/smmu
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);
    }
}
예제 #20
0
void ST_refreshBackground(void)
{

    if (screenblocks >= CRISPY_HUD && !automapactive)
        return;

    if (st_statusbaron)
    {
        V_UseBuffer(st_backing_screen);

	V_DrawPatch(ST_X, 0, sbar);

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

}
예제 #21
0
static void ST_refreshBackground(void)
{
  int y=0;

  if (st_statusbaron)
    {
      // proff 05/17/2000: draw to the frontbuffer in OpenGL
      V_DrawNumPatch(ST_X, y, BG, stbarbg.lumpnum, CR_DEFAULT, VPT_STRETCH);
      if (st_armson)
        V_DrawNumPatch(ST_ARMSBGX, y, BG, armsbg.lumpnum, CR_DEFAULT, VPT_STRETCH);

      // killough 3/7/98: make face background change with displayplayer
      if (netgame)
      {
        V_DrawNumPatch(ST_FX, y, BG, faceback.lumpnum,
           displayplayer ? CR_LIMIT+displayplayer : CR_DEFAULT,
           displayplayer ? (VPT_TRANS | VPT_STRETCH) : VPT_STRETCH);
      }
      V_CopyRect(ST_X, y, BG, ST_SCALED_WIDTH, ST_SCALED_HEIGHT, ST_X, ST_SCALED_Y, FG, VPT_NONE);
    }
}
예제 #22
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);
    }

}
예제 #23
0
/*
 * STlib_drawNum()
 *
 * A fairly efficient way to draw a number based on differences from the
 * old number.
 *
 * Passed a st_number_t widget, a color range for output, and a flag
 * indicating whether refresh is needed.
 * Returns nothing
 *
 * jff 2/16/98 add color translation to digit output
 * cphipps 10/99 - const pointer to colour trans table, made function static
 */
static void STlib_drawNum
( st_number_t*  n,
  int cm,
  dboolean refresh )
{

  int   numdigits = n->width;
  int   num = *n->num;

  int   w = n->p[0].width;
  int   h = n->p[0].height;
  int   x = n->x;

  int   neg;

  // leban 1/20/99:
  // strange that somebody went through all the work to draw only the
  // differences, and then went and constantly redrew all the numbers.
  // return without drawing if the number didn't change and the bar
  // isn't refreshing.
  if(n->oldnum == num && !refresh)
    return;

  // CPhipps - compact some code, use num instead of *n->num
  if ((neg = (n->oldnum = num) < 0))
  {
    if (numdigits == 2 && num < -9)
      num = -9;
    else if (numdigits == 3 && num < -99)
      num = -99;

    num = -num;
  }

  // clear the area
  x = n->x - numdigits*w;

#ifdef RANGECHECK
  if (n->y - ST_Y < 0)
    I_Error("STlib_drawNum: n->y - ST_Y < 0");
#endif

  V_CopyRect(BG, FG, x, n->y, w * numdigits, h, VPT_STRETCH | VPT_ALIGN_BOTTOM);

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

  x = n->x;

  //jff 2/16/98 add color translation to digit output
  // in the special case of 0, you draw 0
  if (!num)
    // CPhipps - patch drawing updated, reformatted
    V_DrawNumPatch(x - w, n->y, FG, n->p[0].lumpnum, cm,
       (((cm!=CR_DEFAULT) && !sts_always_red) ? VPT_TRANS : VPT_NONE) | VPT_ALIGN_BOTTOM);

  // draw the new number
  //jff 2/16/98 add color translation to digit output
  while (num && numdigits--) {
    // CPhipps - patch drawing updated, reformatted
    x -= w;
    V_DrawNumPatch(x, n->y, FG, n->p[num % 10].lumpnum, cm,
       (((cm!=CR_DEFAULT) && !sts_always_red) ? VPT_TRANS : VPT_NONE) | VPT_ALIGN_BOTTOM);
    num /= 10;
  }

  // draw a minus sign if necessary
  //jff 2/16/98 add color translation to digit output
  // cph - patch drawing updated, load by name instead of acquiring pointer earlier
  if (neg)
    V_DrawNamePatch(x - w, n->y, FG, "STTMINUS", cm,
       (((cm!=CR_DEFAULT) && !sts_always_red) ? VPT_TRANS : VPT_NONE) | VPT_ALIGN_BOTTOM);
}
예제 #24
0
파일: st_lib.c 프로젝트: mehzemo/64doom
// 
// A fairly efficient way to draw a number
//  based on differences from the old number.
// Note: worth the trouble?
//
void
STlib_drawNum
( st_number_t*	n,
  boolean	refresh )
{

    int		numdigits = n->width;
    int		num = *n->num;
    
    int		w = SHORT(n->p[0]->width);
    int		h = SHORT(n->p[0]->height);
    int		x = n->x;
    const int		y = n->y;
    
    int		neg;

    n->oldnum = *n->num;

    neg = num < 0;

    if (neg)
    {
	if (numdigits == 2 && num < -9)
	    num = -9;
	else if (numdigits == 3 && num < -99)
	    num = -99;
	
	num = -num;
    }

    // clear the area
    x = n->x - numdigits*w;

    unsigned int c = y - ST_Y;

    if (/*n->*/c > y)
    {
	char ermac[256];
        sprintf(ermac,"drawNum: n->y - ST_Y < 0; %d - %d < 0", /*n->*/y, ST_Y);
        I_Error(ermac);
    }

    V_CopyRect(x, /*n->*/y - ST_Y, BG, w*numdigits, h, x, /*n->*/y, FG);

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

    x = n->x;

    // in the special case of 0, you draw 0
    if (!num)
	V_DrawPatch(x - w, /*n->*/y, FG, n->p[ 0 ]);

    // draw the new number
    while (num && numdigits--)
    {
	x -= w;
	V_DrawPatch(x, /*n->*/y, FG, n->p[ num % 10 ]);
	num /= 10;
    }

    // draw a minus sign if necessary
    if (neg)
	V_DrawPatch(x - 8, /*n->*/y, FG, sttminus);
}
예제 #25
0
파일: st_lib.c 프로젝트: fragglet/mbf
//
// STlib_drawNum()
// 
// A fairly efficient way to draw a number based on differences from the 
// old number.
//
// Passed a st_number_t widget, a color range for output, and a flag
// indicating whether refresh is needed.
// Returns nothing
//
void STlib_drawNum
( st_number_t*  n,
  char *outrng,        //jff 2/16/98 add color translation to digit output
  boolean refresh )
{

  int   numdigits = n->width;
  int   num = *n->num;

  int   w = SHORT(n->p[0]->width);
  int   h = SHORT(n->p[0]->height);
  int   x = n->x;

  int   neg;

  n->oldnum = *n->num;

  neg = num < 0;

  if (neg)
  {
    if (numdigits == 2 && num < -9)
      num = -9;
    else if (numdigits == 3 && num < -99)
      num = -99;

    num = -num;
  }

  // clear the area
  x = n->x - numdigits*w;

  if (n->y - ST_Y < 0)
    I_Error("drawNum: n->y - ST_Y < 0");

  V_CopyRect(x, n->y - ST_Y, BG, w*numdigits, h, x, n->y, FG);

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

  x = n->x;

  //jff 2/16/98 add color translation to digit output
  // in the special case of 0, you draw 0
  if (!num)
    {
      if (outrng && !sts_always_red)
	V_DrawPatchTranslated(x - w, n->y, FG, n->p[ 0 ],outrng,0);
      else //jff 2/18/98 allow use of faster draw routine from config
	V_DrawPatch(x - w, n->y, FG, n->p[ 0 ]);
    }
  
  // draw the new number
  //jff 2/16/98 add color translation to digit output
  while (num && numdigits--)
  {
    x -= w;
    if (outrng && !sts_always_red)
      V_DrawPatchTranslated(x, n->y, FG, n->p[ num % 10 ],outrng,0);
    else //jff 2/18/98 allow use of faster draw routine from config
      V_DrawPatch(x, n->y, FG, n->p[ num % 10 ]);
    num /= 10;
  }

  // draw a minus sign if necessary
  //jff 2/16/98 add color translation to digit output
  if (neg)
    {
      if (outrng && !sts_always_red)
	V_DrawPatchTranslated(x - 8, n->y, FG, sttminus,outrng,0);
      else //jff 2/18/98 allow use of faster draw routine from config
	V_DrawPatch(x - 8, n->y, FG, sttminus);
    }
}
예제 #26
0
파일: f_wipe.c 프로젝트: WinterMute/dsdoom
int wipe_StartScreen(int x, int y, int width, int height)
{
  wipe_scr_start = screens[SRC_SCR] = malloc(SCREENWIDTH * SCREENHEIGHT);
  V_CopyRect(x, y, 0,       width, height, x, y, SRC_SCR, VPT_NONE ); // Copy start screen to buffer
  return 0;
}