Пример #1
0
//
// haleyjd: As above, but for the situation of a client waiting for the initial
// startup info packet from the server.
//
void NET_RenderSteamServerStart(void)
{
    const char *strConn = "Connecting Netgame";
    const char *strWait = "Waiting for server...";
    int strConnWidth    = V_BigFontStringWidth(strConn);
    int strWaitWidth    = M_StringWidth(strWait);

    if(use3drenderer)
        RB_ClearBuffer(GLCB_COLOR);

    V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, 0);
    V_WriteBigText(strConn, (SCREENWIDTH - strConnWidth)/2, 60);
    
    if(net_SteamNodeType != NET_STEAM_SERVER)
        M_WriteText((SCREENWIDTH - strWaitWidth)/2, 100, strWait);

    I_FinishUpdate();
}
Пример #2
0
//
// D_IntroBackground
//
// [STRIFE] New function
// haleyjd 20110206: Strife only drew this once, but for supporting double-
// buffered or page-flipped surfaces it is best to redraw the entire screen
// every frame.
//
static void D_IntroBackground(void)
{
    if(!showintro)
        return;

    // Fill the background entirely (wasn't needed in vanilla)
    V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, 0);

    // Strife cleared the screen somewhere in the low-level code between the
    // intro and the titlescreen, so this is to take care of that and get
    // proper fade-in behavior on the titlescreen
    if(introprogress >= MAXINTROPROGRESS)
    {
        I_FinishUpdate();
        return;
    }

    // Draw a 95-pixel rect from STARTUP0 starting at y=57 to (0,41) on the
    // screen (this was a memcpy directly to 0xA3340 in low DOS memory)
    V_DrawBlock(0, 41, 320, 95, rawgfx_startup0 + (320*57));
}
Пример #3
0
//
// haleyjd 20141022: [SVE] Alternate waiting on Steam clients
//
void NET_WaitForSteamLaunch(void)
{
    boolean isServer = (net_SteamNodeType == NET_STEAM_SERVER);
    const char *strConn = "Connecting Netgame";
    char numConn[64];
    char pressStr[64];
    char pressStr2[64];
    int strConnWidth, pressStrWidth, pressStrX, numConnWidth;
    const char *keyActivateName = GetNameForKey(key_menu_activate);
    const char *keyForwardName  = GetNameForKey(key_menu_forward);

    if(!keyActivateName)
        keyActivateName = "key_menu_activate";
    if(!keyForwardName)
        keyForwardName  = "key_menu_forward";

    M_snprintf(pressStr, sizeof(pressStr), "(Press %s to cancel%c",
               keyActivateName, isServer ? ',' : ')');
    if(isServer)
    {
        M_snprintf(pressStr2, sizeof(pressStr2), "%s to start now)",
                   keyForwardName);
    }
    strConnWidth  = V_BigFontStringWidth(strConn);
    pressStrWidth = M_StringWidth(pressStr);
    pressStrX     = (SCREENWIDTH - pressStrWidth) / 2;

    expected_nodes = net_SteamNumNodes;

    while(net_waiting_for_launch)
    {
        event_t *ev;

        CheckAutoLaunch();

        I_StartTic();
        
        while((ev = D_PopEvent()))
        {
            switch(ev->type)
            {
            case ev_keydown:
                if(ev->data1 == key_menu_activate)
                    I_Quit();
                if(ev->data1 == key_menu_forward && isServer)
                    StartGame(NULL, NULL);
                break;
            default:
                break;
            }
        }

        if(use3drenderer)
            RB_ClearBuffer(GLCB_COLOR);

        M_snprintf(numConn, sizeof(numConn), "%d of %d nodes connected",
                   NumConnected(), net_SteamNumNodes);
        numConnWidth = M_StringWidth(numConn);

        V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, 0);
        V_WriteBigText(strConn, (SCREENWIDTH - strConnWidth)/2, 60);
        M_WriteText((SCREENWIDTH - numConnWidth)/2, 100, numConn);
        M_WriteText(pressStrX, 112, pressStr);
        if(isServer)
            M_WriteText(pressStrX+12, 124, pressStr2);

        NET_CL_Run();
        NET_SV_Run();

        if(!net_client_connected)
            I_Error("Lost connection to server");

        I_FinishUpdate();
        I_Sleep(100);        
    }
}