Exemple #1
0
//
// IN_Start
//
// Sets up intermission cameras, sets the game to use the proper
// intermission object for the current gamemode, and then calls the
// gamemode's start function.
//
void IN_Start(wbstartstruct_t *wbstartstruct)
{
    // haleyjd 09/10/12: record high scores
    INStatsManager::Get().recordStats(wbstartstruct);

    // haleyjd 03/24/05: allow skipping stats intermission
    if(LevelInfo.killStats)
    {
        G_WorldDone();
        return;
    }

    if(!in_font)
    {
        if(!(in_font = E_FontForName(in_fontname)))
            I_Error("IN_Start: bad EDF font name %s\n", in_fontname);
        if(!(in_bigfont = E_FontForName(in_bigfontname)))
            I_Error("IN_Start: bad EDF font name %s\n", in_bigfontname);
        if(!(in_bignumfont = E_FontForName(in_bignumfontname)))
            I_Error("IN_Start: bad EDF font name %s\n", in_bignumfontname);
    }

    IN_StartCamera();  //set up camera

    InterFuncs = GameModeInfo->interfuncs;

    InterFuncs->Start(wbstartstruct);
}
Exemple #2
0
//
// V_TextFPSDrawer
//
void V_TextFPSDrawer(void)
{
   static char fpsStr[16];
   static int  fhistory[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
   static int  lasttic = 0, slot = 0;
   vfont_t *font;
   
   float fps = 0;
   int   i, thistic, totaltics = 0;
   
   thistic = I_GetTime();
   
   fhistory[slot & 15] = thistic != lasttic ? thistic - lasttic : 1;
   slot++;

   for(i = 0; i < 16; i++)
      totaltics += fhistory[i];
   
   if(totaltics)
      fps = (float)TICRATE / (totaltics / 16.0f);
   
   psnprintf(fpsStr, sizeof(fpsStr), FC_GRAY "FPS: %.2f", fps);
   
   lasttic = thistic;

   font = E_FontForName("ee_smallfont");
      
   V_FontWriteText(font, fpsStr, 5, 10);
}
Exemple #3
0
//
// HU_Init
//
// Called once at game startup to initialize the HUD system.
//
void HU_Init()
{
   shiftxform = english_shiftxform;

   if(!(hud_font = E_FontForName(hud_fontname)))
      I_Error("HU_Init: bad EDF font name %s\n", hud_fontname);

   HU_LoadFont(); // overlay font
   HU_InitNativeWidgets();
}
Exemple #4
0
//
// V_DrawLoading
//
void V_DrawLoading(void)
{
   int x, y;
   int linelen;
   vfont_t *font;

   // haleyjd 11/30/02: get palette indices from GameModeInfo
   int white = GameModeInfo->whiteIndex;
   int black = GameModeInfo->blackIndex;

   // haleyjd 01/29/09: not if -nodraw was used
   if(nodrawers)
      return;

   if(!loading_message)
      return;

   // 05/02/10: update console
   C_Drawer();
  
   V_DrawBox((SCREENWIDTH/2)-50, (SCREENHEIGHT/2)-30, 100, 40);

   font = E_FontForName("ee_smallfont");
   
   V_FontWriteText(font, loading_message, (SCREENWIDTH/2)-30, 
                   (SCREENHEIGHT/2)-20, &subscreen43);
  
   x = ((SCREENWIDTH/2)-45);
   y = (SCREENHEIGHT/2);
   linelen = (90*loading_amount) / loading_total;

   // White line
   if(linelen > 0)
      V_ColorBlockScaled(&subscreen43, (byte)white, x, y, linelen, 1);
   // Black line
   if(linelen < 90)
      V_ColorBlockScaled(&subscreen43, (byte)black, x + linelen, y, 90 - linelen, 1);

   I_FinishUpdate();
}