Exemple #1
0
static void DrawStatus(void)
{
    int w;

    if (m_servers.pingstage == PING_STAGES)
        w = m_servers.pingindex * uis.width / m_servers.list.numItems;
    else
        w = uis.width;

    R_DrawFill8(0, uis.height - CHAR_HEIGHT, w, CHAR_HEIGHT, 4);
    R_DrawFill8(w, uis.height - CHAR_HEIGHT, uis.width - w, CHAR_HEIGHT, 0);

    if (m_servers.status_c)
        UI_DrawString(uis.width / 2, uis.height - CHAR_HEIGHT, UI_CENTER, m_servers.status_c);

    if (uis.width < 800)
        return;

    if (m_servers.list.numItems)
        UI_DrawString(uis.width, uis.height - CHAR_HEIGHT, UI_RIGHT, m_servers.status_r);

    if (m_servers.list.numItems && m_servers.list.curvalue >= 0) {
        serverslot_t *slot = m_servers.list.items[m_servers.list.curvalue];
        if (slot->status > SLOT_PENDING) {
            UI_DrawString(0, uis.height - CHAR_HEIGHT, UI_LEFT, slot->hostname);
        }
    }
}
Exemple #2
0
/*
===============
R_SetupFrame
===============
*/
void R_SetupFrame(void)
{
    int         i;
    vrect_t     vrect;

    if (r_fullbright->modified) {
        r_fullbright->modified = qfalse;
        D_FlushCaches();    // so all lighting changes
    }

    r_framecount++;


// build the transformation matrix for the given view angles
    VectorCopy(r_newrefdef.vieworg, modelorg);
    VectorCopy(r_newrefdef.vieworg, r_origin);

    AngleVectors(r_newrefdef.viewangles, vpn, vright, vup);

// current viewleaf
    if (!(r_newrefdef.rdflags & RDF_NOWORLDMODEL)) {
        r_viewleaf = BSP_PointLeaf(r_worldmodel->nodes, r_origin);
        r_viewcluster = r_viewleaf->cluster;
    }

    if (sw_waterwarp->integer && (r_newrefdef.rdflags & RDF_UNDERWATER))
        r_dowarp = qtrue;
    else
        r_dowarp = qfalse;

    if (r_dowarp) {
        // warp into off screen buffer
        vrect.x = 0;
        vrect.y = 0;
        vrect.width = r_newrefdef.width < WARP_WIDTH ? r_newrefdef.width : WARP_WIDTH;
        vrect.height = r_newrefdef.height < WARP_HEIGHT ? r_newrefdef.height : WARP_HEIGHT;

        d_viewbuffer = r_warpbuffer;
        d_screenrowbytes = WARP_WIDTH * VID_BYTES;
    } else {
        vrect.x = r_newrefdef.x;
        vrect.y = r_newrefdef.y;
        vrect.width = r_newrefdef.width;
        vrect.height = r_newrefdef.height;

        d_viewbuffer = (void *)vid.buffer;
        d_screenrowbytes = vid.rowbytes;
    }

    R_ViewChanged(&vrect);

// start off with just the four screen edge clip planes
    R_TransformFrustum();
    R_SetUpFrustumIndexes();

// save base values
    VectorCopy(vpn, base_vpn);
    VectorCopy(vright, base_vright);
    VectorCopy(vup, base_vup);

// clear frame counts
    c_faceclip = 0;
    r_polycount = 0;
    r_drawnpolycount = 0;
    r_wholepolycount = 0;
    r_amodels_drawn = 0;
    r_outofsurfaces = 0;
    r_outofedges = 0;

// d_setup
    for (i = 0; i < vid.height; i++) {
        d_spantable[i] = d_viewbuffer + i * d_screenrowbytes;
        d_zspantable[i] = d_pzbuffer + i * d_zwidth;
    }

// clear Z-buffer and color-buffers if we're doing the gallery
    if (r_newrefdef.rdflags & RDF_NOWORLDMODEL) {
        memset(d_pzbuffer, 0xff, vid.width * vid.height * sizeof(d_pzbuffer[0]));
#if 0
        R_DrawFill8(r_newrefdef.x, r_newrefdef.y, r_newrefdef.width, r_newrefdef.height, /*(int)sw_clearcolor->value & 0xff*/0);
#endif
    }

    d_minmip = Cvar_ClampInteger(sw_mipcap, 0, NUM_MIPS - 1);

    for (i = 0; i < (NUM_MIPS - 1); i++)
        d_scalemip[i] = basemip[i] * sw_mipscale->value;
}