Beispiel #1
0
void Blinky_OnClientTerminate(edict_t *self)
{
// disconnect any cams
	edict_t * player;
	BlinkyClient_t * bdata;
	
	for (player = &g_edicts[0]+1; player< &g_edicts[0]+(int)(maxclients->value)+1; player++)
	{
		if (!player->client || !player->inuse)
			continue;
		bdata = &player->client->blinky_client;
		if (bdata->cam_target == self)
			StopCam(player);
	}
#if 0
	StopCam(self);
#endif
}
Beispiel #2
0
void mexFunction( int nlhs, mxArray *plhs[],
                  int nrhs, const mxArray *prhs[] )
              
{
   double *dContext;
          
  /* Assign pointers to input. */
  dContext = mxGetPr(prhs[0]);
    
  /* Call the bridging function to stop camera */
  if( !StopCam(dContext) )
  {
     mexErrMsgTxt( "matStopFly failed !!" );
  }
}
Beispiel #3
0
void Cmd_Cam_f(edict_t *ent)
{
	char * name = gi.args();
 // obj1 is how to tell when we've looped
	edict_t * obj1;
	edict_t * target;
	BlinkyClient_t * bdata;

	bdata = &ent->client->blinky_client;
	obj1 = bdata->cam_target;

	if (!coop->value || IsSpectator(ent))
		return;

	if (!obj1)
		obj1 = ent;
	target = obj1;
	while(1)
	{
		// advance loop thru edicts
		// to do - this ought to cycle at maxclients instead of num_edicts
		if (target < &g_edicts[0]+(int)(maxclients->value)+1)
			target++;
		else
			target = g_edicts+1;
		if (target == obj1)
			break;
		// only look at (in use) players
		if (!target->inuse || !target->client || IsSpectator(target))
			continue;
		// if a specific name requested & doesn't match, skip
		if (name[0] && Q_stricmp(name, target->client->pers.netname))
			continue;

		// found cam target
		if (target == ent)
		{
			StopCam(ent);
		}
		else
		{
			StartCam(ent, target);
			ShowStats(ent, target);
		}
		break;
	}

}
CWebCam::~CWebCam()
{
	if (m_hCam)
		StopCam();
}