Beispiel #1
0
static void I_AVDrawVideoStream(void)
{
    SDL_Surface *screen;
    int ws, hs;
    
    dglClearColor(0, 0, 0, 1);
    RB_ClearBuffer(GLCB_COLOR);

    I_AVProcessNextVideoFrame();

    ws = screen_width;
    hs = screen_height;

    RB_SetMaxOrtho(ws, hs);
    RB_DrawScreenTexture(&texture, reqWidth, reqHeight);
    RB_SwapBuffers();
}
Beispiel #2
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();
}
Beispiel #3
0
//
// Render the frontend.
//
static void FE_Drawer(void)
{
    boolean wipe = false;

    if(frontend_wipe)
    {
        frontend_wipe = false;
        wipe = true;
        wipe_StartScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);
    }

    if(use3drenderer)
    {
        dglClearColor(0, 0, 0, 1);
        RB_ClearBuffer(GLCB_COLOR);
    }

    if(frontend_done) // exiting?
        FE_ClearScreen();
    else
    {
        // draw current menu
        FE_MenuDraw(currentFEMenu);
    }

    // special state drawing
    switch(frontend_state)
    {
    case FE_STATE_KEYINPUT:
        FE_DrawBox(64, 84, 192, 32);
        FE_WriteYellowTextCentered(90,  "Press a key...");
        FE_WriteYellowTextCentered(102, "(Backspace to unbind)");
        break;
    case FE_STATE_MBINPUT:
        FE_DrawBox(64, 84, 192, 32);
        FE_WriteYellowTextCentered(90,  "Click a button...");
        FE_WriteYellowTextCentered(102, "(Backspace to unbind)");
        break;
    case FE_STATE_JBINPUT:
        FE_JoyBindDrawer();
        break;
    case FE_STATE_JAINPUT:
        FE_JoyAxisBindDrawer();
        break;
    case FE_STATE_EXITING:
        // draw character to ask quit question
        FE_DrawChar();
        break;
    default:
        // draw modal net state message?
        if(FE_InModalNetState() && frontend_modalmsg)
        {
            FE_DrawBox(64, 84, 192, 32);
            FE_WriteYellowTextCentered(90, frontend_modalmsg);
            FE_WriteYellowTextCentered(102, "(Please wait)");
        }
        break;
    }

    // wipe, or just finish update if not wiping
    if(wipe)
        FE_DoWipe();
    else
    {
        I_FinishUpdate();
        frontend_waitframe = false;
    }
}
Beispiel #4
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);        
    }
}