xp_comm_proj/cine/imgcache.c
/* routine: SetCacheCapture
 * purpose: Start or Stop capture, cleaning up as required
 */
SetCacheCapture
purpose: Start or Stop capture, cleaning up as required
SetCacheCapture purpose : Start or Stop capture cleaning up as required
static void SetCacheCapture( int capture, CacheInfo *cache )
{
  if( capture && (cache->mode == 0) && !cache->capture )
    {
      int i;
      for( i = 0; i < cache->num_frames; i++ )
	DestroyPixmap( cache, i );
      memset( cache->pixmaps, 0, sizeof(cache->pixmaps) );
      cache->num_frames = 0;
    }
  if( !capture && (cache->mode == 1) && cache->capture )
    {
      int i;
      for( i = 0; i < cache->num_frames; i++ )
	DestroyPixmap( cache, i );
      memset( cache->pixmaps, 0, sizeof(cache->pixmaps) );
      cache->num_frames = 0;
    }
  if( capture && cache->playback )
    {
      OMset_name_int_val( cache->object_id, OMstr_to_name("playback"), 0 );
      cache->playback = 0;
    }
  cache->capture = capture;
}
static void SetCacheCapture ( int capture , CacheInfo * cache ) { if ( capture && ( cache -> mode == 0 ) && ! cache -> capture ) { int i ; for ( i = 0 ; i < cache -> num_frames ; i ++ ) DestroyPixmap ( cache , i ) ; memset ( cache -> pixmaps , 0 , sizeof ( cache -> pixmaps ) ) ; cache -> num_frames = 0 ; } if ( ! capture && ( cache -> mode == 1 ) && cache -> capture ) { int i ; for ( i = 0 ; i < cache -> num_frames ; i ++ ) DestroyPixmap ( cache , i ) ; memset ( cache -> pixmaps , 0 , sizeof ( cache -> pixmaps ) ) ; cache -> num_frames = 0 ; } if ( capture && cache -> playback ) { OMset_name_int_val ( cache -> object_id , OMstr_to_name ( " " ) , 0 ) ; cache -> playback = 0 ; } cache -> capture = capture ; }
routine: SetCacheCapture
 purpose: Start or Stop capture, cleaning up as required
routine : SetCacheCapture purpose : Start or Stop capture cleaning up as required
/* For mode 0 clean up from previous capture if required
   */ /* Clean up from previous capture
       */ /* For mode 1 clean up as soon as we leave capture mode
   */ /* Clean up from previous capture
       */ /* If currently in playback mode, turn it off
   */