/*
==============
CG_StartCamera
==============
*/
void CG_StartCamera( const char *name, qboolean startBlack ) {
	char lname[MAX_QPATH];

	//if ( cg.predictedPlayerState.stats[STAT_HEALTH] <= 0 )	// don't allow camera to start if you're dead
	//	return;

	COM_StripExtension(name, lname);	//----(SA)	added
	strcat( lname, ".camera" );

	if (trap_loadCamera(CAM_PRIMARY, va("cameras/%s", lname))) {
		cg.cameraMode = qtrue;					// camera on in cgame
		if(startBlack)
			CG_Fade(0, 0, 0, 255, cg.time, 0);	// go black
		trap_Cvar_Set( "cg_letterbox", "1" );	// go letterbox
		//trap_SendClientCommand("startCamera");	// camera on in game
		trap_startCamera(CAM_PRIMARY, cg.time);	// camera on in client
	} else {
//----(SA)	removed check for cams in main dir
		cg.cameraMode = qfalse;					// camera off in cgame
		trap_SendClientCommand("stopCamera");	// camera off in game
		trap_stopCamera(CAM_PRIMARY);			// camera off in client
		CG_Fade(0, 0, 0, 0, cg.time, 0);		// ensure fadeup
		trap_Cvar_Set( "cg_letterbox", "0" );
		CG_Printf ("Unable to load camera %s\n",lname);
	}
}
Beispiel #2
0
/*
==============
CG_StartCamera
==============
*/
void CG_StartCamera(const char *name, qboolean startBlack)
{
	char lname[MAX_QPATH];

	COM_StripExtension(name, lname, sizeof(lname));
	strcat(lname, ".camera");

	if (trap_loadCamera(CAM_PRIMARY, va("cameras/%s", lname)))
	{
		cg.cameraMode = qtrue;                    // camera on in cgame
		if (startBlack)
		{
			CG_Fade(0, 0, 0, 255, cg.time, 0);    // go black
		}
		trap_Cvar_Set("cg_letterbox", "1");       // go letterbox
		//trap_SendClientCommand("startCamera");  // camera on in game
		trap_startCamera(CAM_PRIMARY, cg.time);   // camera on in client
	}
	else
	{
		// removed check for cams in main dir
		cg.cameraMode = qfalse;                 // camera off in cgame
		trap_SendClientCommand("stopCamera");   // camera off in game
		trap_stopCamera(CAM_PRIMARY);           // camera off in client
		CG_Fade(0, 0, 0, 0, cg.time, 0);        // ensure fadeup
		trap_Cvar_Set("cg_letterbox", "0");
		CG_Printf("Unable to load camera %s\n", lname);
	}
}
Beispiel #3
0
/*
==============
CG_StartCamera
==============
*/
void CG_StartCamera( const char *name, qboolean startBlack ) {
	char lname[MAX_QPATH];

	if ( cgs.gametype != GT_SINGLE_PLAYER ) {
		return;
	}

	COM_StripExtension( name, lname );    //----(SA)	added
	strcat( lname, ".camera" );

	if ( trap_loadCamera( CAM_PRIMARY, va( "cameras/%s", lname ) ) ) {
		cg.cameraMode = qtrue;
		if ( startBlack ) {
			CG_Fade( 0, 0, 0, 255, 0 );           // go black
		}
		trap_Cvar_Set( "cg_letterbox", "1" ); // go letterbox
		trap_SendClientCommand( "startCamera" );
		trap_startCamera( CAM_PRIMARY, cg.time );
	} else {

		//----(SA)	temp until radiant stores cameras in own directory
		//			check cameras dir then main dir
		if ( trap_loadCamera( CAM_PRIMARY, name ) ) {
			cg.cameraMode = qtrue;
			trap_SendClientCommand( "startCamera" );
			trap_startCamera( CAM_PRIMARY, cg.time );
			return;
		}
		//----(SA)	end (remove when radiant stores cameras...)

		trap_SendClientCommand( "stopCamera" );
		CG_Fade( 0, 0, 0, 0, 0 );             // ensure fadeup
		trap_Cvar_Set( "cg_letterbox", "0" );
		cg.cameraMode = qfalse;
		CG_Printf( "Unable to load camera %s\n",lname );
	}
}