Exemplo n.º 1
0
void uiVideoNode::drawOverWindow (uiNode_t *node)
{
	if (EXTRADATA(node).cin.status == CIN_STATUS_INVALID) {
		/** @todo Maybe draw a black screen? */
		return;
	}

	if (EXTRADATA(node).cin.status == CIN_STATUS_NONE) {
		vec2_t pos;
		bool nosound = UI_VIDEOEXTRADATACONST(node).nosound;

		CIN_OpenCinematic(&(EXTRADATA(node).cin), va("videos/%s", EXTRADATA(node).source));
		if (EXTRADATA(node).cin.status == CIN_STATUS_INVALID) {
			UI_ExecuteEventActions(node, EXTRADATA(node).onEnd);
			return;
		}

		UI_GetNodeAbsPos(node, pos);
		CIN_SetParameters(&(EXTRADATA(node).cin), pos[0], pos[1], node->box.size[0], node->box.size[1], CIN_STATUS_PLAYING, nosound);
	}

	if (EXTRADATA(node).cin.status == CIN_STATUS_PLAYING || EXTRADATA(node).cin.status == CIN_STATUS_PAUSE) {
		/* only set replay to true if video was found and is running */
		CIN_RunCinematic(&(EXTRADATA(node).cin));
		if (EXTRADATA(node).cin.status == CIN_STATUS_NONE) {
			UI_ExecuteEventActions(node, EXTRADATA(node).onEnd);
		}
	}
}
Exemplo n.º 2
0
/**
 * @sa CL_Frame
 */
void CIN_RunCinematic (cinematic_t* cin)
{
	assert(cin->status != CIN_STATUS_NONE);

	/* Decode chunks until the desired frame is reached */
	if (cin->cinematicType == CINEMATIC_TYPE_ROQ && CIN_ROQ_RunCinematic(cin))
		return;
	else if (cin->cinematicType == CINEMATIC_TYPE_OGM && CIN_OGM_RunCinematic(cin))
		return;

	/* If we get here, the cinematic has either finished or failed */
	if (cin->replay) {
		char name[MAX_QPATH];
		Q_strncpyz(name, cin->name, sizeof(name));
		CIN_OpenCinematic(cin, name);
		cin->replay = true;
	} else {
		CIN_CloseCinematic(cin);
	}
}