示例#1
0
static void DrawAndBlit(void)
{
    // Change the view size if needed
    if (setsizeneeded)
    {
        R_ExecuteSetViewSize();
    }

    // Do buffered drawing
    switch (gamestate)
    {
        case GS_LEVEL:
            if (!gametic)
            {
                break;
            }
            if (automapactive)
            {
                AM_Drawer();
            }
            else
            {
                R_RenderPlayerView(&players[displayplayer]);
            }
            CT_Drawer();
            UpdateState |= I_FULLVIEW;
            SB_Drawer();
            break;
        case GS_INTERMISSION:
            IN_Drawer();
            break;
        case GS_FINALE:
            F_Drawer();
            break;
        case GS_DEMOSCREEN:
            PageDrawer();
            break;
    }

    if (testcontrols)
    {
        V_DrawMouseSpeedBox(testcontrols_mousespeed);
    }

    if (paused && !MenuActive && !askforquit)
    {
        if (!netgame)
        {
            V_DrawPatch(160, (viewwindowy >> hires) + 5, W_CacheLumpName("PAUSED",
                                                              PU_CACHE));
        }
        else
        {
示例#2
0
void G_Drawer(void)
{
	player_t *vplayer = &players[displayplayer];
	boolean iscam = (vplayer->plr->flags & DDPF_CAMERA) != 0;	// $democam

	// $democam: can be set on every frame
	if(cfg.setblocks > 10 || iscam)
	{
		// Full screen.
		R_ViewWindow(0, 0, 320, 200);
	}
	else
	{
		int     w = cfg.setblocks * 32;
		int     h =
			cfg.setblocks * (200 - SBARHEIGHT * cfg.sbarscale / 20) / 10;
		R_ViewWindow(160 - (w >> 1),
					 (200 - SBARHEIGHT * cfg.sbarscale / 20 - h) >> 1, w, h);
	}

	// Do buffered drawing
	switch (gamestate)
	{
	case GS_LEVEL:
		// Clients should be a little careful about the first frames.
		if(IS_CLIENT && (!Get(DD_GAME_READY) || !Get(DD_GOTFRAME)))
			break;

		// Good luck trying to render the view without a viewpoint...
		if(!vplayer->plr->mo)
			break;

		if(leveltime < 2)
		{
			// Don't render too early; the first couple of frames 
			// might be a bit unstable -- this should be considered
			// a bug, but since there's an easy fix...
			break;
		}
		if(automapactive)
		{
			AM_Drawer();
		}
		else
		{
			boolean special200 = false;

			R_HandleSectorSpecials();
			// Set flags for the renderer.
			if(IS_CLIENT)
				R_SetAllDoomsdayFlags();
			GL_SetFilter(vplayer->plr->filter);	// $democam
			// Check for the sector special 200: use sky2.
			// I wonder where this is used?
			if(vplayer->plr->mo->subsector->sector->special == 200)
			{
				special200 = true;
				Rend_SkyParams(0, DD_DISABLE, 0);
				Rend_SkyParams(1, DD_ENABLE, 0);
			}
			// How about a bit of quake?
			if(localQuakeHappening[displayplayer] && !paused)
			{
				int     intensity = localQuakeHappening[displayplayer];

				Set(DD_VIEWX_OFFSET,
					((M_Random() % (intensity << 2)) -
					 (intensity << 1)) << FRACBITS);
				Set(DD_VIEWY_OFFSET,
					((M_Random() % (intensity << 2)) -
					 (intensity << 1)) << FRACBITS);
			}
			else
			{
				Set(DD_VIEWX_OFFSET, 0);
				Set(DD_VIEWY_OFFSET, 0);
			}
			// The view angle offset.
			Set(DD_VIEWANGLE_OFFSET, ANGLE_MAX * -lookOffset);
			// Render the view.
			if(!dontrender)
			{
				R_RenderPlayerView(vplayer->plr);
			}
			if(special200)
			{
				Rend_SkyParams(0, DD_ENABLE, 0);
				Rend_SkyParams(1, DD_DISABLE, 0);
			}
			if(!iscam)
				X_Drawer();		// Draw the crosshair.
			R_DrawMapTitle();
		}
		GL_Update(DDUF_FULLSCREEN);
		if(!iscam)
			SB_Drawer();		// $democam
		// We'll draw the chat text *after* the status bar to
		// be a bit clearer.
		CT_Drawer();

		// Also update view borders?
		if(Get(DD_VIEWWINDOW_HEIGHT) != 200)
			GL_Update(DDUF_BORDER);
		break;

	case GS_INTERMISSION:
		IN_Drawer();
		break;

	case GS_INFINE:
		GL_Update(DDUF_FULLSCREEN);
		break;

	case GS_WAITING:
		GL_DrawRawScreen(W_GetNumForName("TITLE"), 0, 0);
		gl.Color3f(1, 1, 1);
		MN_DrCenterTextA_CS("WAITING... PRESS ESC FOR MENU", 160, 188);
		GL_Update(DDUF_FULLSCREEN);
		break;

	default:
		break;
	}

	if(paused && !MenuActive && !askforquit && !fi_active)
	{
		if(!netgame)
		{
			GL_DrawPatch(160, Get(DD_VIEWWINDOW_Y) + 5,
						 W_GetNumForName("PAUSED"));
		}
		else
		{
			GL_DrawPatch(160, 70, W_GetNumForName("PAUSED"));
		}
	}

	FI_Drawer();
}