示例#1
0
文件: cl_cin.c 项目: postfix/quake2vr
qboolean SCR_DrawCinematic (void)
{
	if (cl.cinematictime <= 0)
		return false;

	if (cin.isStaticPic) // Knightmare- HACK to show JPG endscreens
	{
		R_DrawStretchPic (0, 0, viddef.width, viddef.height, cin.picName, 1.0);
		return true;
	}

	// Knightmare- pause if reloading video
	if (cls.key_dest == key_menu || vid_ref->modified)
	{	// blank screen and pause if menu is up
		R_SetPalette(NULL);
		cl.cinematicpalette_active = false;
		return true;
	}

	if (!cl.cinematicpalette_active)
	{
		R_SetPalette(cl.cinematicpalette);
		cl.cinematicpalette_active = true;
	}

	if (!cin.pic)
		return true;

	// fix odd-colored lines at top and bottom of screen
	//R_DrawStretchRaw (0, 0, viddef.width, viddef.height,
	//	cin.width, cin.height, cin.pic);
	R_DrawStretchRaw (-2, -2, viddef.width +4, viddef.height +4,
		cin.width, cin.height, cin.pic);
	return true;
}
示例#2
0
void
SCR_StopCinematic(void)
{
	cl.cinematictime = 0; /* done */

	if (cin.pic)
	{
		Z_Free(cin.pic);
		cin.pic = NULL;
	}

	if (cin.pic_pending)
	{
		Z_Free(cin.pic_pending);
		cin.pic_pending = NULL;
	}

	if (cl.cinematicpalette_active)
	{
		R_SetPalette(NULL);
		cl.cinematicpalette_active = false;
	}

	if (cl.cinematic_file)
	{
		FS_FCloseFile(cl.cinematic_file);
		cl.cinematic_file = 0;
	}

	if (cin.hnodes1)
	{
		Z_Free(cin.hnodes1);
		cin.hnodes1 = NULL;
	}

	/* switch back down to 11 khz sound if necessary */
	if (cin.restart_sound)
	{
		cin.restart_sound = false;
		CL_Snd_Restart_f();
	}
}
示例#3
0
/*
 * Returns true if a cinematic is active, meaning the
 * view rendering should be skipped
 */
qboolean
SCR_DrawCinematic(void)
{
	int x, y, w, h;

	if (cl.cinematictime <= 0)
	{
		return false;
	}

	/* blank screen and pause if menu is up */
	if (cls.key_dest == key_menu)
	{
		R_SetPalette(NULL);
		cl.cinematicpalette_active = false;
		return true;
	}

	if (!cl.cinematicpalette_active)
	{
		R_SetPalette(cl.cinematicpalette);
		cl.cinematicpalette_active = true;
	}

	if (!cin.pic)
	{
		return true;
	}

	if (cin_force43->value)
	{
		w = viddef.height * 4 / 3;
		if (w > viddef.width)
		{
			w = viddef.width;
		}
		w &= ~3;
		h = w * 3 / 4;
		x = (viddef.width - w) / 2;
		y = (viddef.height - h) / 2;
	}
	else
	{
		x = y = 0;
		w = viddef.width;
		h = viddef.height;
	}

	if (x > 0)
	{
		Draw_Fill(0, 0, x, viddef.height, 0);
	}
	if (x + w < viddef.width)
	{
		Draw_Fill(x + w, 0, viddef.width - (x + w), viddef.height, 0);
	}
	if (y > 0)
	{
		Draw_Fill(x, 0, w, y, 0);
	}
	if (y + h < viddef.height)
	{
		Draw_Fill(x, y + h, w, viddef.height - (y + h), 0);
	}

	Draw_StretchRaw(x, y, w, h, cin.width, cin.height, cin.pic);

	return true;
}