Esempio n. 1
0
void RadioButton::Draw()
{
     SDL_Rect Rect = GetRect();
     SDL_Rect TexPos = mPositionTex[0];
     switch(GetMode())
     {
      case normal:
         mText->setColor(mColor[0].a,mColor[0].b,mColor[0].c);
         SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[0],&Rect);
      break;
      case clicked:
         mText->setColor(mColor[0].a,mColor[0].b,mColor[0].c);
         SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[1],&Rect);
      break;
      case hover_normal:
         mText->setColor(mColor[1].a,mColor[1].b,mColor[1].c);
         SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[2],&Rect);
      break;
      case hover_clicked:
         mText->setColor(mColor[1].a,mColor[1].b,mColor[1].c);
         SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[3],&Rect);
      break;

     }
    mText->Draw();
}
void CDXVADecoderMpeg2::Init()
{
	TRACE(_T("CDXVADecoderMpeg2::Init()\n"));

	memset (&m_PictureParams,	0, sizeof(m_PictureParams));
	memset (&m_SliceInfo,		0, sizeof(m_SliceInfo));
	memset (&m_QMatrixData,		0, sizeof(m_QMatrixData));

	m_PictureParams.bMacroblockWidthMinus1			= 15;	// This is equal to "15" for MPEG-1, MPEG-2, H.263, and MPEG-4
	m_PictureParams.bMacroblockHeightMinus1			= 15;	// This is equal to "15" for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4
	m_PictureParams.bBlockWidthMinus1				= 7;	// This is equal to "7" for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4
	m_PictureParams.bBlockHeightMinus1				= 7;	// This is equal to "7" for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4
	m_PictureParams.bBPPminus1						= 7;	// It is equal to "7" for MPEG-1, MPEG-2, H.261, and H.263

	m_PictureParams.bChromaFormat					= 0x01;	// For MPEG-1, MPEG-2 "Main Profile," H.261 and H.263 bitstreams, this value shall always be set to "01", indicating "4:2:0" format


	m_nMaxWaiting			= 5;
	m_wRefPictureIndex[0]	= NO_REF_FRAME;
	m_wRefPictureIndex[1]	= NO_REF_FRAME;
	m_nSliceCount			= 0;

	switch (GetMode()) {
		case MPEG2_VLD :
			AllocExecuteParams (4);
			break;
		default :
			ASSERT(FALSE);
	}

	m_pMPEG2Buffer			= NULL;
	m_nMPEG2BufferSize		= 0;

	NewSegment();
}
void PhonemeEditor::CloseCaption_SeparatePhrases( void )
{
	if ( GetMode() != MODE_CLOSECAPTION )
		return;

	// Three pixels
	double time_epsilon = ( 1.0f / GetPixelsPerSecond() ) * 6;

	for ( int i = 0; i < m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1; i++ )
	{
		CCloseCaptionPhrase *current = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i );
		CCloseCaptionPhrase *next = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i + 1 );

		if ( !current->GetSelected() || !next->GetSelected() )
			continue;

		// Close enough?
		if ( fabs( current->GetEndTime() - next->GetStartTime() ) > time_epsilon )
		{
			Con_Printf( "Can't split %s and %s, already split apart\n",
				current->GetStream(), next->GetStream() );
			continue;
		}

		// Offset next phrase start time a bit
		next->SetStartTime( next->GetStartTime() + time_epsilon );

		break;
	}

	redraw();
}
int CEMExaminationListReport::OnEditCEMExaminationListReport(){
 	if(GetMode() != VM_VIEW)
 		return -1;
 	CHMSMainFrame  *pMF = (CHMSMainFrame  *) AfxGetMainWnd();
 	SetMode(VM_EDIT);
	return 0;  
}
int CRptDanhsachBNVaoVien::OnEditRptDanhsachBNVaoVien(){
 	if(GetMode() != VM_VIEW) 
 		return -1; 
 	CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd(); 
 	SetMode(VM_EDIT);
	return 0;  
}
Esempio n. 6
0
void GW_Game_DKong::clock_update(int mode)
{
    if (mode==-1) mode=GetMode();

    // display clock
    data().position_get(PS_NUMBER, 1)->show();
    data().position_get(PS_NUMBER, 2)->show();
    data().position_get(PS_NUMBER, 3)->show();
    data().position_get(PS_NUMBER, 4)->show();


    GW_Platform_Time time=platform_get()->time_get();

    //GW_Device::devtime_t time;
    //device_get()->GetTime(&time);

    data().position_get(PS_SEMICOLON)->visible_set(time.s % 2 == 0);
    if (mode==MODE_TIME)
    {
        // show current time
        data().position_get(PS_AM)->visible_set(time.h<12);
        data().position_get(PS_PM)->visible_set(time.h>=12);

        setnumber((time.h>12?time.h-12:time.h), 1, 2, false);
        setnumber(time.n, 3, 4);
    } else if (mode==MODE_ALARM) {
        // show 12:00 AM
        data().position_get(PS_AM)->show();
        setnumber(12, 1, 2);
        setnumber(0, 3, 4);
    }
}
void PhonemeEditor::CloseCaption_ExtendSelectedPhraseEndTime( int direction )
{
	if ( GetMode() != MODE_CLOSECAPTION )
		return;

	CountSelected();

	if ( m_nSelectedPhraseCount != 1 )
		return;

	RECT rc;
	GetWorkspaceRect( rc );

	// Determine start/stop positions
	int totalsamples = (int)( m_pWaveFile->GetRunningLength() * m_pWaveFile->SampleRate() );

	float starttime = m_nLeftOffset / GetPixelsPerSecond();
	float endtime = w2() / GetPixelsPerSecond() + starttime;

	float timeperpixel = ( endtime - starttime ) / (float)( rc.right - rc.left );

	float movetime = timeperpixel * (float)direction;

	SetDirty( true );

	PushUndo();

	TraversePhrases( ITER_ExtendSelectedPhraseEndTimes, movetime );

	PushRedo();

	redraw();

	Con_Printf( "Extend phrase end %s\n", direction == -1 ? "left" : "right" );
}
int CPMSProductSupplyPlan::SetMode(int nMode){
 		int nOldMode = GetMode();
 		CGuiView::SetMode(nMode);
 		CMainFrame_E10 *pMF = (CMainFrame_E10 *) AfxGetMainWnd();
 		CString szSQL;
 		CRecord rs(&pMF->m_db);
  		switch(nMode){
 		case VM_ADD: 
 			EnableControls(TRUE);
 			EnableButtons(TRUE, 3, 4, -1);
 			SetDefaultValues();
 			break;
 		case VM_EDIT: 
 			EnableControls(TRUE);
 			EnableButtons(TRUE, 3, 4, -1);
 			break;
 		case VM_VIEW: 
 			EnableControls(FALSE);
 			EnableButtons(FALSE, 3, 4, -1);
 			break;
 		case VM_NONE: 
 			EnableControls(FALSE);
 			EnableButtons(TRUE, 0, 6, -1);
 			SetDefaultValues();
 			break;
 		};
 		UpdateData(FALSE);
 		return nOldMode;
}
void PhonemeEditor::CloseCaption_EditDelete( void )
{
	if ( GetMode() != MODE_CLOSECAPTION )
		return;

	CountSelected();

	if ( m_nSelectedPhraseCount < 1 )
		return;

	SetDirty( true );

	PushUndo();

	for ( int i = m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1; i >= 0; i-- )
	{
		CCloseCaptionPhrase *phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i );
		if ( !phrase || !phrase->GetSelected() )
			continue;

		m_Tags.RemoveCloseCaptionPhrase( CC_ENGLISH, i );
	}

	PushRedo();

	redraw();
}
Esempio n. 10
0
int
GTerm::TranslateKeyCode(int keyCode, int *len, char *data, int shift,
                        int ctrl, int alt)
{
  int
    mode = GetMode();

#ifdef GTERM_PC
  unsigned short
    pcKeySeq;
#endif // GTERM_PC

  VTKeySeq
    *keySeq;

//printf("keycode = %d, shift = %d, ctrl = %d, alt = %d\n", keyCode, shift, ctrl, alt);
//printf("GTerm::TranslateKeyCode(): mode = %x\n", mode);
#ifdef GTERM_PC
  if(mode & PC)
  {
    pcKeySeq = translate_pc_keycode(keyCode, shift, ctrl, alt);
    if(pcKeySeq)
    {
//printf("keySeq = %x\n", pcKeySeq);
      *(unsigned char *)data++ = pcKeySeq >> 8;
      *(unsigned char *)data = pcKeySeq & 0xff;
      *len = 2;
      return 1;
    }
    return 0;
  }
Esempio n. 11
0
already_AddRefed<IDBObjectStore>
IDBTransaction::GetOrCreateObjectStore(const nsAString& aName,
                                       ObjectStoreInfo* aObjectStoreInfo,
                                       bool aCreating)
{
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
  NS_ASSERTION(aObjectStoreInfo, "Null pointer!");
  NS_ASSERTION(!aCreating || GetMode() == IDBTransaction::VERSION_CHANGE,
               "How else can we create here?!");

  nsRefPtr<IDBObjectStore> retval;

  for (PRUint32 index = 0; index < mCreatedObjectStores.Length(); index++) {
    nsRefPtr<IDBObjectStore>& objectStore = mCreatedObjectStores[index];
    if (objectStore->Name() == aName) {
      retval = objectStore;
      return retval.forget();
    }
  }

  retval = IDBObjectStore::Create(this, aObjectStoreInfo, mDatabaseInfo->id,
                                  aCreating);

  mCreatedObjectStores.AppendElement(retval);

  return retval.forget();
}
int CFMFoodSummaryByLevel::SetMode(int nMode){
 		int nOldMode = GetMode();
 		CGuiView::SetMode(nMode);
 		CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
 		CString szSQL;
 		CRecord rs(&pMF->m_db);
  		switch(nMode){
 		case VM_ADD: 
 			EnableControls(TRUE);
 			EnableButtons(TRUE, 3, 4, -1);
 			SetDefaultValues();
 			break;
 		case VM_EDIT: 
 			EnableControls(TRUE);
 			EnableButtons(TRUE, 3, 4, -1);
 			break;
 		case VM_VIEW: 
 			EnableControls(FALSE);
 			EnableButtons(FALSE, 3, 4, -1);
 			break;
 		case VM_NONE: 
 			EnableControls(FALSE);
 			EnableButtons(TRUE, 0, 6, -1);
 			SetDefaultValues();
 			break;
 		};
 		UpdateData(FALSE);
 		return nOldMode;
}
int CFMDischargedPaidPatientListByDay::OnEditFMDischargedPaidPatientListByDay(){
 	if(GetMode() != VM_VIEW)
 		return -1;
 	CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
 	SetMode(VM_EDIT);
	return 0;  
}
int CEMTestnParaRatebyRoom::OnEditEMStatisticsGeneralPatientReport(){
 	if(GetMode() != VM_VIEW) 
 		return -1; 
 	CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd(); 
 	SetMode(VM_EDIT);
	return 0;  
}
Esempio n. 15
0
bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
	if (!Connected())
		return false;
	eTCPMode tmp = GetMode();
	if (tmp != modePacket && tmp != modeTransition)
		return false;
	LockMutex lock(&MState);
	if (RemoteID)
		return RelayLink->SendPacket(pack, RemoteID);
	else if (pOldFormat) {
		#if TCPN_LOG_PACKETS >= 1
			if (pack && pack->opcode != 0) {
				struct in_addr	in;
				in.s_addr = GetrIP();
				CoutTimestamp(true);
				std::cout << ": Logging outgoing TCP OldPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
				#if TCPN_LOG_PACKETS == 2
					if (pack->size >= 32)
						DumpPacket(pack->pBuffer, 32);
					else
						DumpPacket(pack);
				#endif
				#if TCPN_LOG_PACKETS >= 3
					DumpPacket(pack);
				#endif
			}
		#endif
		SPackSendQueue* spsq = MakeOldPacket(pack);
		ServerSendQueuePushEnd(spsq->buffer, spsq->size);
		safe_delete_array(spsq);
	}
	else {
		EmuTCPNetPacket_Struct* tnps = MakePacket(pack, iDestination);
		if (tmp == modeTransition) {
			InModeQueuePush(tnps);
		}
		else {
			#if TCPN_LOG_PACKETS >= 1
				if (pack && pack->opcode != 0) {
					struct in_addr	in;
					in.s_addr = GetrIP();
					CoutTimestamp(true);
					std::cout << ": Logging outgoing TCP packet. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
					#if TCPN_LOG_PACKETS == 2
						if (pack->size >= 32)
							DumpPacket(pack->pBuffer, 32);
						else
							DumpPacket(pack);
					#endif
					#if TCPN_LOG_PACKETS >= 3
						DumpPacket(pack);
					#endif
				}
			#endif
			ServerSendQueuePushEnd((uchar**) &tnps, tnps->size);
		}
	}
	return true;
}
Esempio n. 16
0
string PlexRemoteHelper::GetConfigString()
{
  // Build a new config string.
  std::string strConfig;
  if (GetMode() == APPLE_REMOTE_UNIVERSAL)
    strConfig = "--universal ";
  else if (GetMode() == APPLE_REMOTE_MULTICODE)
    strConfig = "--multicode ";

  // Delay.
  char strDelay[64];
  sprintf(strDelay, "--timeout %d ", m_sequenceDelay);
  strConfig += strDelay;

  // Secure input.
  char strSecure[64];
  sprintf(strSecure, "--secureInput %d ", m_secureInput ? 1 : 0);
  strConfig += strSecure;
  
  // Find out where we're running from.
  char     given_path[2*MAXPATHLEN];
  uint32_t path_size = 2*MAXPATHLEN;

  int result = _NSGetExecutablePath(given_path, &path_size);
  if (result == 0)
  {
    char real_path[2*MAXPATHLEN];
    if (realpath(given_path, real_path) != NULL)
    {
      // Move backwards out to the application.
      for (int x=0; x<4; x++)
      {
        for (int n=strlen(real_path)-1; real_path[n] != '/'; n--)
          real_path[n] = '\0';
      
        real_path[strlen(real_path)-1] = '\0';
      }
    }
    
    strConfig += "--appLocation \"";
    strConfig += real_path;
    strConfig += "\"";
  }
  
  return strConfig + "\n";
}
Esempio n. 17
0
File: Utils.c Progetto: zhshr/CS502
void TestMode(char *str) {

	if (GetMode() == 0) {
		debug(GREY, "%s: User Mode", str);
	} else {
		debug(GREY, "%s: Kernel Mode", str);
	}
}
Esempio n. 18
0
uint32_t
RedQueue::GetQueueSize (void)
{
  NS_LOG_FUNCTION (this);
  if (GetMode () == QUEUE_MODE_BYTES)
    {
      return m_bytesInQueue;
    }
  else if (GetMode () == QUEUE_MODE_PACKETS)
    {
      return m_packets.size ();
    }
  else
    {
      NS_ABORT_MSG ("Unknown RED mode.");
    }
}
Esempio n. 19
0
void CCredits::AddCredits()
{
	// Sanity checks...

	if (!g_pLTClient) return;


	// Get the credits text buffer...

	char* sName = NULL;

	switch (GetMode())
	{
		case CM_INTRO:		sName = "INTRO"; break;
		case CM_CREDITS:	sName = "CREDITS"; break;
		case CM_DEMO_INFO:	sName = "DEMOINFO"; break;
		case CM_DEMO_INTRO:	sName = "DEMOINTRO"; break;
		case CM_DEMO_MULTI:	sName = "DEMOMULTI"; break;

		default: sName = "CREDITS";
	}

	char* sBuf = GetTextBuffer(sName);
	if (!sBuf) return;


	// Parse the credits text...

	char sCredit[1024];
	int  i = 0;

	while (*sBuf)
	{

		if (*sBuf == '#' && *(sBuf+1) == '#')
		{
			sCredit[i] = '\0';

			if (strncmp(sCredit, ">END", 4) == 0)	// end?
			{
				return;
			}

			AddCredit(sCredit);
			i = 0;

			sBuf+=2;

			while (*sBuf != '\0' && ((*sBuf == '\n') || (*sBuf == '\r'))) sBuf++;
		}
		else
		{
			memcpy(&sCredit[i], sBuf, 1);
			i++;
			sBuf++;
		}
	}
}
void PhonemeEditor::CloseCaption_SelectNextPhrase( int direction )
{
	if ( GetMode() != MODE_CLOSECAPTION )
		return;

	CountSelected();

	if ( m_nSelectedPhraseCount != 1 )
	{
		// Selected first phrase then
		if ( m_nSelectedPhraseCount == 0 && m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )> 0 )
		{
			CCloseCaptionPhrase *phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, direction ? m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1 : 0 );
			phrase->SetSelected( true );
			m_nSelectedPhraseCount = 1;
		}
		else
		{
			return;
		}
	}

	Con_Printf( "Move to next phrase %s\n", direction == -1 ? "left" : "right" );

	for ( int i = 0; i < m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH ); i++ )
	{
		CCloseCaptionPhrase *phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i );
		if ( !phrase )
			continue;

		if ( m_nSelectedPhraseCount == 1 )
		{
			if ( !phrase->GetSelected() )
				continue;
		}

		// Deselect phrase
		phrase->SetSelected( false );

		// Deselect this one and move 
		int nextphrase = i + direction;
		if ( nextphrase < 0 )
		{
			nextphrase = m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1;
		}
		else if ( nextphrase >= m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH ))
		{
			nextphrase = 0;
		}

		phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, nextphrase );
		phrase->SetSelected( true );

		redraw();
		return;
	}
}
Esempio n. 21
0
bool NativePlayer::PrevTrack()
{
    BYTE track = GetTrack() - 1;
    if ( track < 1 ) track = GetNumberOfTracks();
    if ( GetMode() == MCI_MODE_PLAY )
        return PlayTrack( track );
    else
        return SeekTrack( track );
}
// Returns value of given attribute.
int CGXDLMSAutoAnswer::GetValue(int index, unsigned char* parameters, int length, CGXDLMSVariant& value)
{    
    if (index == 1)
    {
        GXHelpers::AddRange(value.byteArr, m_LN, 6);
		value.vt = DLMS_DATA_TYPE_OCTET_STRING;
		return ERROR_CODES_OK;
    }
    if (index == 2)
    {
        value = GetMode();
		return ERROR_CODES_OK;
    }    
    if (index == 3)
    {
        int cnt = m_ListeningWindow.size();
		vector<unsigned char> data;
        data.push_back(DLMS_DATA_TYPE_ARRAY);
        //Add count            
        CGXOBISTemplate::SetObjectCount(cnt, data);
		for (std::vector<std::pair< CGXDateTime, CGXDateTime> >::iterator it = 
			m_ListeningWindow.begin(); it != m_ListeningWindow.end(); ++it)
        {
            data.push_back(DLMS_DATA_TYPE_STRUCTURE);
            data.push_back(2); //Count
            CGXOBISTemplate::SetData(data, DLMS_DATA_TYPE_OCTET_STRING, (*it).first); //start_time
            CGXOBISTemplate::SetData(data, DLMS_DATA_TYPE_OCTET_STRING, (*it).second); //end_time
        }
        value = data;                
		return ERROR_CODES_OK;
    }
    if (index == 4)
    {
        value = GetStatus();
		return ERROR_CODES_OK;
    }
    if (index == 5)
    {
        value = GetNumberOfCalls();
		return ERROR_CODES_OK;
    }
    if (index == 6)
    {
        vector<unsigned char> data;
		data.push_back(DLMS_DATA_TYPE_STRUCTURE);
        CGXOBISTemplate::SetObjectCount(2, data);
		int ret;
        if ((ret = CGXOBISTemplate::SetData(data, DLMS_DATA_TYPE_UINT8, m_NumberOfRingsInListeningWindow)) != ERROR_CODES_OK ||
			(ret = CGXOBISTemplate::SetData(data, DLMS_DATA_TYPE_UINT8, m_NumberOfRingsOutListeningWindow)) != ERROR_CODES_OK)
		{
			return ret;
		}
        value = data;
		return ERROR_CODES_OK;  
    }
    return ERROR_CODES_INVALID_PARAMETER;
}
Esempio n. 23
0
void CNoteDialog::SaveNoteID()
{
	if(GetMode() == eMode_StoredNote)
	{
		return;
	}

	DWORD IDs[NOTENUM_PER_PAGE];
	SelectedNoteIDChk(NOTENUM_PER_PAGE,NOTE_NOTELISTCHK1,m_pNoteListLCtrl,IDs);	
	
	int lastidx = 0;
	BOOL bHasUnRead = FALSE;
	BOOL bHasPackage = FALSE;
	for(int i=0;i<NOTENUM_PER_PAGE;++i)
	{
		if(IDs[i] != 0)
			lastidx = i;

		if( IDs[i] && FALSE==mNoteList.NoteList[i].bIsRead )
		{
			bHasUnRead = TRUE;
			break;
		}

		if( (IDs[i] && 0!=mNoteList.NoteList[i].PackageItemIdx) ||
			(IDs[i] && 0!=mNoteList.NoteList[i].PackageMoney) )
		{
			bHasPackage = TRUE;
			break;
		}
	}

	if(bHasUnRead)
	{
		CHATMGR->AddMsg(CTC_SYSMSG, CHATMGR->GetChatMsg(2239) );
		return;
	}
	else if(bHasPackage)
	{
		CHATMGR->AddMsg(CTC_SYSMSG, CHATMGR->GetChatMsg(2240) );
		return;
	}
	
	for(i=0;i<NOTENUM_PER_PAGE;++i)
	{
		if(IDs[i] != 0)
		{
			BOOL bLast;
			if(i==lastidx)
				bLast = TRUE;
			else
				bLast = FALSE;

			NOTEMGR->SaveNoteSyn(IDs[i],bLast);
		}
	} 
}
Esempio n. 24
0
void msr(int i)
{
	unsigned int n; 
	*((int *)(&moveToStatus)) = i;
	n=(unsigned int) moveToStatus.rn;
	if(Bad_Reg(n))
		printf("UNPREDICTABLE instruciton\n");
	else{
		unsigned sysmTemp=moveToStatus.sysm;
		sysmTemp=sysmTemp>>3;
		sysmTemp&=0x01F;
		if(sysmTemp==0){
			if(!(moveToStatus.sysm & 0x04))
				set_apsr(get_general_register(moveToStatus.rn)>>27);
		}
		else if(sysmTemp==1){
			if(CurrentModeIsPrivileged()){
				if((moveToStatus.sysm & 0x07)==0)
					set_msp(get_general_register(moveToStatus.rn));
				else if((moveToStatus.sysm & 0x07)==1)
					set_psp(get_general_register(moveToStatus.rn));

			}
		}
		else if(sysmTemp==2){
			unsigned int temp=(moveToStatus.sysm & 0x07);
			if(temp==0 && CurrentModeIsPrivileged()){
				set_primask(get_general_register(moveToStatus.rn)&0x01);
			}
			else if(temp==1 && CurrentModeIsPrivileged()){
				set_basepri(get_general_register(moveToStatus.rn)&0xFF);
			}
			else if(temp==2 && CurrentModeIsPrivileged()){
				if((get_general_register(moveToStatus.rn)&0xFF)!=0 && ((get_general_register(moveToStatus.rn)&0xFF)!=0) && 
					(((get_general_register(moveToStatus.rn)&0xFF)<get_basepri()) || get_basepri()==0))
					set_basepri(get_general_register(moveToStatus.rn)&0xFF);
			}
			else if(temp==3 && CurrentModeIsPrivileged() && (ExecutionPriority() > -1)){
					set_faultmask(get_general_register(moveToStatus.rn)&0x01);
			}
			else if(temp==4 && CurrentModeIsPrivileged()){
				/* when `100`
						if CurrentModeIsPrivileged() then
						CONTROL<0> = R[n]<1:0>;
						If Mode == Thread then CONTROL<1> = R[n]<1>;

				*/// question
				
				set_control((get_control()&0xFFFFFFFE)|(get_general_register(moveToStatus.rn)&0x01));
				if(GetMode()==THREAD)
					set_control((get_control()&0xFFFFFFFD)|(get_general_register(moveToStatus.rn)&0x02));

			}
		}

	}
void
avtOpenGLAtomTexturer3D::EndSphereTexturing()
{
    GetMode();

    if(mode == ShaderMode)
        ((ShaderModeData *)sData)->EndSphereTexturing();
    else if(mode == TextureMode)
        ((TextureModeData *)tData)->EndSphereTexturing();
}
void AirsideFollowMeCarInSim::ReturnVehiclePool( ProbabilityDistribution* pTurnAroundDistribute )
{
	if(GetMode() == OnBackPool || GetMode() == OnVehicleBirth || GetMode() == OnParkingPool)
		return;

	if (pTurnAroundDistribute)
		tMinTurnAroundTime = long( pTurnAroundDistribute->getRandomValue());
	else
		tMinTurnAroundTime = 0L;

	m_Route = m_ReturnRoute;
	m_Route.SetMode(OnBackPool);
	SetMode(OnBackPool);
	m_ReturnRoute.ClearRouteItems();

	VehicleMoveEvent* newEvent = new VehicleMoveEvent(this);
	newEvent->setTime(GetTime());
	newEvent->addEvent(); 
}
Esempio n. 27
0
void CInfoTextureHandler::DisableCurrentMode()
{
	if (returnToLOS && (GetMode() != "los")) {
		// return to LOS-mode if it was active before
		SetMode("los");
	} else {
		// otherwise disable overlay entirely
		SetMode("");
	}
}
// Plot a PCB Text, i;e. a text found on a copper or technical layer
void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
{
    double  orient;
    int     thickness;
    wxPoint pos;
    wxSize  size;
    wxString shownText( pt_texte->GetShownText() );

    if( shownText.IsEmpty() )
        return;

    if( !m_layerMask[pt_texte->GetLayer()] )
        return;

    m_plotter->SetColor( getColor( pt_texte->GetLayer() ) );

    size      = pt_texte->GetSize();
    pos       = pt_texte->GetTextPosition();
    orient    = pt_texte->GetOrientation();
    thickness = ( GetMode() == LINE ) ? -1 : pt_texte->GetThickness();

    if( pt_texte->IsMirrored() )
        size.x = -size.x;

    // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
    // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
    // (like bold text) and we manage the thickness.
    // So we set bold flag to true
    bool allow_bold = pt_texte->IsBold() || thickness;

    if( pt_texte->IsMultilineAllowed() )
    {
        std::vector<wxPoint> positions;
        wxArrayString* list = wxStringSplit( shownText, '\n' );
        positions.reserve( list->Count() );

        pt_texte->GetPositionsOfLinesOfMultilineText( positions, list->Count() );

        for( unsigned ii = 0; ii < list->Count(); ii++ )
        {
            wxString& txt = list->Item( ii );
            m_plotter->Text( positions[ii], UNSPECIFIED_COLOR, txt, orient, size,
                             pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
                             thickness, pt_texte->IsItalic(), allow_bold );
        }

        delete list;
    }
    else
    {
        m_plotter->Text( pos, UNSPECIFIED_COLOR, shownText, orient, size,
                         pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
                         thickness, pt_texte->IsItalic(), allow_bold );
    }
}
void PhonemeEditor::CloseCaption_EditPhrase( void )
{
	if ( GetMode() != MODE_CLOSECAPTION )
		return;

	CCloseCaptionPhrase *pPhrase = CloseCaption_GetClickedPhrase();
	if ( !pPhrase )
		return;

	CloseCaption_EditPhrase( pPhrase );
}
Esempio n. 30
0
bool NativePlayer::NextTrack()
{
    BYTE track = GetTrack() + 1;
    BYTE total = GetNumberOfTracks();
    if ( track > total )
        track = 1;
    if ( GetMode() == MCI_MODE_PLAY )
        return PlayTrack( track );
    else
        return SeekTrack( track );
}