void gmGarbageCollector::FullCollect()
{
  m_fullThrottle = true;

  if(IsOff()) // If GC is off
  {
    ReclaimObjectsAndRestartCollection(); // Do flip and turn it back on
  }

  while(!Collect())
  {
    // Do the collect phase
  }
  ReclaimObjectsAndRestartCollection(); // Do flip and turn it back on

  // Collect a second time to catch floating black objects
  while(!Collect())
  {
    // Do the collect phase
  }
  ReclaimObjectsAndRestartCollection(); // Do flip and turn it back on

  // NOTE: The GC is now restarted and in an 'On' state, meaning it will now collect again from the machine.
  //       This behavior may not be desirable, so this function really needs more analysis to determine the
  //       optimum sequence for a full collect with minimal redundancy.

  // Free memory of garbage objects
  while(ReclaimSomeFreeObjects())
  {
    // Reclaim all garbage
  }
  m_fullThrottle = false;
}
void ChapterCWriter::notifyCommand ( MidiEvPtr command )
{

  /* CtrlChange */
  if ( EvType ( command ) == typeCtrlChange ) {

    list<TCtrlInfo>::iterator i;
    for ( i = _history.begin ( ) ; i != _history.end ( ) ; i++ ) {
      if ( ( * i ).number == Data ( command ) [0] ) {
	TCtrlInfo ctrlInfo;
	ctrlInfo.number = ( * i ).number;
	if ( ( IsOn ( ( * i ).value ) && IsOff ( Data ( command ) [1] ) ) ||
	     ( IsOff ( ( * i ).value ) && IsOn ( Data ( command ) [1] ) ) ) {
	  ctrlInfo.toggle = ( ( * i ).toggle + 1 ) % 64;
	}
	else {
	  ctrlInfo.toggle = ( * i ).toggle;
	}
	ctrlInfo.value = Data ( command ) [1];
	ctrlInfo.count = ( ( * i ).count + 1 ) % 64;
	ctrlInfo.payload = currentPayloadNumber ( );
	_history.erase ( i );
	_history.push_back ( ctrlInfo );
	break;
      }
    }
    if ( i == _history.end ( ) ) {
	TCtrlInfo ctrlInfo;
	ctrlInfo.number = Data ( command ) [0];
	ctrlInfo.value = Data ( command ) [1];
	ctrlInfo.toggle = IsOn ( Data ( command ) [1] );
	ctrlInfo.count = 1;
	ctrlInfo.payload = currentPayloadNumber ( );
	_history.push_back ( ctrlInfo );
    }

  }

}
Exemple #3
0
void CPda::OnH_A_Chield() 
{
	VERIFY(IsOff());

	//включить PDA только если оно находится у первого владельца
	if(H_Parent()->ID() == m_idOriginalOwner){
		TurnOn					();
		if(m_sFullName.empty()){
			m_sFullName.assign( NameItem() );
			m_sFullName += " ";
			m_sFullName += (smart_cast<CInventoryOwner*>(H_Parent()))->Name();
		}
	};
	inherited::OnH_A_Chield		();
}
Exemple #4
0
bool CGmObjSplash::Move()
{
	return IsOff();
}
Exemple #5
0
void Segment::Redraw () {
    if (!IsOff()) {
	Draw();
    }
}
Exemple #6
0
boolean Segment::Off () {
    if (!IsOff()) {
	FadeDown();
    }
    return IsOff();
}