コード例 #1
0
void cVnsiOsd::SetActive(bool On)
{
  if (On != Active())
  {
    cOsd::SetActive(On);
    if (On)
    {
      // must clear all windows here to avoid flashing effects - doesn't work if done
      // in Flush() only for the windows that are actually used...
      for (int i = 0; i < MAXNUMWINDOWS; i++)
      {
        Cmd(VNSI_OSD_CLEAR, i);
      }
      if (GetBitmap(0)) // only flush here if there are already bitmaps
        Flush();
    }
    else if (shown)
    {
      for (int i = 0; GetBitmap(i); i++)
      {
        Cmd(VNSI_OSD_CLOSE, i);
      }
      shown = false;
    }
  }
}
コード例 #2
0
ファイル: _diskitem.cpp プロジェクト: Ambrevar/fr_public
sDiskItem *sDiskItem::Find(sChar *path,sInt mode)
{
  sChar name[sDI_NAMESIZE];
  sChar buffer[sDI_NAMESIZE];
  sChar *p;
  sDiskItem *di;
  sInt i;
  
  p = name;
  i = 0;
  while(*path && *path!='/')
  {
    *p++ = *path++;
    i++;
    if(i>sDI_NAMESIZE-1)
      return 0;
  }
  *p++ = 0;

  if(GetBool(sDIA_INCOMPLETE))
    Cmd(sDIC_FINDALL,0,0);

  for(i=0;;i++)
  {
    di = GetChild(i);
    if(!di)
      break;
    di->GetString(sDIA_NAME,buffer,sizeof(buffer));
    if(sCmpStringI(buffer,name)==0)
    {
      if(*path==0)
      {
        if(mode==sDIF_NEW)
          return 0;
        if(di->GetBool(sDIA_INCOMPLETE))
          di->Cmd(sDIC_FINDALL,0,0);
        return di;
      }
      else
        return di->Find(path+1,mode);
    }
  }

  if(mode==sDIF_CREATE)
  {
    if(*path==0)
    {
      if(Cmd(sDIC_CREATEFILE,name,0))
      {
        return Find(name,sDIF_EXISTING);
      }
    }
  }
  return 0;
}
コード例 #3
0
ファイル: dvbsdffosd.c プロジェクト: backtrack2016/tdt
eOsdError cDvbSdFfOsd::SetAreas(const tArea *Areas, int NumAreas)
{
  if (shown) {
     cBitmap *Bitmap;
     for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
         Cmd(OSD_SetWindow, 0, i + 1);
         Cmd(OSD_Close);
         }
     shown = false;
     }
  return cOsd::SetAreas(Areas, NumAreas);
}
コード例 #4
0
// In serial mode, RPF is identified by an address, so that up to 8 devices can be linked
// Each device connected must have an input address (even if only one is connected)
// This functions sets the address, 0 by default
bool Revolver::SetIdentity(int nId)
{
	char	buf[80];

	sprintf(buf, "D3F%04X", nId);
	return Cmd(buf);
}
コード例 #5
0
int CGraphics_Threaded::GetVideoModes(CVideoMode *pModes, int MaxModes, int Screen)
{
	if(g_Config.m_GfxDisplayAllModes)
	{
		int Count = sizeof(g_aFakeModes)/sizeof(CVideoMode);
		mem_copy(pModes, g_aFakeModes, sizeof(g_aFakeModes));
		if(MaxModes < Count)
			Count = MaxModes;
		return Count;
	}

	// add videomodes command
	CImageInfo Image;
	mem_zero(&Image, sizeof(Image));

	int NumModes = 0;
	CCommandBuffer::SCommand_VideoModes Cmd(Screen);
	Cmd.m_pModes = pModes;
	Cmd.m_MaxModes = MaxModes;
	Cmd.m_pNumModes = &NumModes;
	m_pCommandBuffer->AddCommand(Cmd);

	// kick the buffer and wait for the result and return it
	KickCommandBuffer();
	WaitForIdle();
	return NumModes;
}
コード例 #6
0
ファイル: command.hpp プロジェクト: institution/cc94
		void add(Cmd cmd) {	
			cmds.push_back(Cmd(InsNone));
			for (auto i = cmds.size(); i >= 2; --i)
			{
				cmds[i-1] = cmds[i-2];
			}				
			cmds[0] = cmd;
		}
コード例 #7
0
ファイル: ipmi_con.cpp プロジェクト: openhpi1/testrepo
SaErrorT
cIpmiCon::ExecuteCmd( const cIpmiAddr &addr, const cIpmiMsg &msg,
                      cIpmiMsg &rsp_msg, int retries )
{
  cIpmiAddr rsp_addr;

  return Cmd( addr, msg, rsp_addr, rsp_msg, retries );
}
コード例 #8
0
ファイル: cmd.cpp プロジェクト: NGenetzky/particle-projects
int cmd_setup(){
    bool success;
    #ifdef DO_VARAIBLE
        Particle.variable("cmds", cmds_var);
    #endif
    #ifdef DO_FUNCTION
        Particle.function("do", do_function);
    #endif
    #ifdef DO_SUBSCRIBE
        success = Particle.subscribe("do", do_handler, MY_DEVICES); // Requires --private flag.
        if( !success ){ error(1000); }
    #endif
    
    cmds.push_back( Cmd(0, "ndef", ndef) ); // Default function defined for ndef commands.
    cmds.push_back( Cmd(1, "cmd_publish", cmd_publish) ); // Outputs cmds
    return success;
}
コード例 #9
0
ファイル: wxe_impl.cpp プロジェクト: Tony1928/erlang
void meta_command(int what, wxe_data *sd) {  
  if(what == PING_PORT) {
    wxWakeUpIdle();
  } else {
    wxeMetaCommand Cmd(sd, what);
    wxTheApp->AddPendingEvent(Cmd);
  }
}
コード例 #10
0
ファイル: macro.cpp プロジェクト: PNCG/neuron
void MacroCmd::Remove (Iterator& i) {
    UList* doomed = Elem(i);
    Command* cmd = Cmd(doomed);

    Next(i);
    _cmds->Remove(doomed);
    delete doomed;
}
コード例 #11
0
ファイル: command.hpp プロジェクト: institution/cc94
		Cmd get() const { 
			auto l = cmds.size();
			if (l > 0) {
				return cmds.at(l-1); 
			}
			else {
				return Cmd(InsNone);
			}				
		}
コード例 #12
0
ファイル: macro.cpp プロジェクト: PNCG/neuron
MacroCmd::~MacroCmd () { 
    while (!_cmds->IsEmpty()) {
	UList* cur = _cmds->First();
	_cmds->Remove(cur);
        Command* cmd = Cmd(cur);
	delete cmd;
	delete cur;
    }
    delete _cmds;
}
コード例 #13
0
ファイル: GlobalCommands.cpp プロジェクト: hzjslm/pcsx2
KeyAcceleratorCode::KeyAcceleratorCode( const wxKeyEvent& evt )
{
	val32 = 0;

	keycode = evt.GetKeyCode();

	if( evt.AltDown() ) Alt();
	if( evt.CmdDown() ) Cmd();
	if( evt.ShiftDown() ) Shift();
}
コード例 #14
0
void cVnsiOsd::Flush(void)
{
  if (!Active())
     return;
  cBitmap *Bitmap;
  bool full = cVnsiOsdProvider::IsRequestFull();
  for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++)
  {
    uint8_t reset = !shown || full;
    Cmd(VNSI_OSD_OPEN, i, Bitmap->Bpp(), Left() + Bitmap->X0(), Top() + Bitmap->Y0(), Left() + Bitmap->X0() + Bitmap->Width() - 1, Top() + Bitmap->Y0() + Bitmap->Height() - 1, (void *)&reset, 1);
    int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
    if (!shown || Bitmap->Dirty(x1, y1, x2, y2) || full)
    {
      if (!shown || full)
      {
        x1 = y1 = 0;
        x2 = Bitmap->Width() - 1;
        y2 = Bitmap->Height() - 1;
      }
      // commit colors:
      int NumColors;
      const tColor *Colors = Bitmap->Colors(NumColors);
      if (Colors)
      {
        Cmd(VNSI_OSD_SETPALETTE, i, 0, NumColors, 0, 0, 0, Colors, NumColors*sizeof(tColor));
      }
      // commit modified data:
      int size = (y2-y1) * Bitmap->Width() + (x2-x1+1);
      Cmd(VNSI_OSD_SETBLOCK, i, Bitmap->Width(), x1, y1, x2, y2, Bitmap->Data(x1, y1), size);
    }
    Bitmap->Clean();
  }
  if (!shown)
  {
    // Showing the windows in a separate loop to avoid seeing them come up one after another
    for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++)
    {
      Cmd(VNSI_OSD_MOVEWINDOW, i, 0, Left() + Bitmap->X0(), Top() + Bitmap->Y0());
    }
    shown = true;
  }
}
コード例 #15
0
// Performs the adjusting by placing on filter number 0
// On success, true is returned
bool Revolver::Calibrate()
{
	bool	er = false;

	er = Cmd("1");
	
	if (er == true)
		m_currentFilter = 0;
		
	return er;

}
コード例 #16
0
// Places the wheel in filter number 'nFilter' [0..MAX_FILTROS_DTA]
// Once the placement has been donde, true is returned
// If nFilter is out of range, there is a hardware failure or the recalibration has not taken place
// false is returned
bool Revolver::ChangeFilter(int nFilter)
{
	bool	bOk = false;
	char	buf[80];

	if (nFilter >= 0 && nFilter < m_RPF_parameters.nfilt)
	{
		sprintf(buf, "2%2X", nFilter);
		bOk = Cmd(buf);

        // HACER: quitar, esto retrasa innecesariamente
        // If torque is enabled, position again (trick to solve the sound problem)
        if(bOk && this->m_RPF_parameters.hold == 1)
		    bOk = Cmd(buf);
	}

	if (bOk)
		m_currentFilter = nFilter;

	return bOk;
}
コード例 #17
0
eOsdError cVnsiOsd::SetAreas(const tArea *Areas, int NumAreas)
{
  if (shown)
  {
    for (int i = 0; GetBitmap(i); i++)
    {
      Cmd(VNSI_OSD_CLOSE, i);
    }
    shown = false;
  }
  return cOsd::SetAreas(Areas, NumAreas);
}
コード例 #18
0
ファイル: con_000.cpp プロジェクト: openhpi1/openhpitest
  virtual void *Run()
  {
    num_threads++;

    for( int i = 0; i < dNumCmdsPerThread; i++ )
         Cmd();

    num_threads--;

    delete this;

    return 0;
  }
コード例 #19
0
ファイル: Console.cpp プロジェクト: berezhkovskaya/Carousel3D
void clConsole::RegisterCommand( const LString& CMDName, const clConsoleProc& CmdProc )
{
	guard();

	LString Command = LStr::GetUpper( CMDName );

	FATAL( FCommandsList.find( Command ) != FCommandsList.end(),
	       "Duplicate command registraction: " + CMDName );

	clConsoleCommand Cmd( Command, CmdProc );
	FCommandsList[Command] = Cmd;

	unguard();
}
コード例 #20
0
ファイル: sun_section.cpp プロジェクト: vpa1977/lock_free_mt
void
CSunSection::Reaction( long in_SrcSectionID, const CPreloaderSection_DecodeResponse& in_rDecodeResponse )
{
	CLog::Print("CSunSection::Reaction( const CPreloaderSection_DecodeResponse& )\n");
	CRenderSection_CreateTexture_Request Cmd(in_rDecodeResponse.m_Width,in_rDecodeResponse.m_Height,true);
	Cmd.m_Data = in_rDecodeResponse.m_ARGBData;
	CLog::Print("  sending CreateTexture\n");
	CTCommandSender<CRenderSection_CreateTexture_Request>::SendCommand(
		m_RenderSectionID,
		Cmd
	);
	CVFSSection_CloseRequest cmd;
	cmd.m_Handle = 	in_rDecodeResponse.m_Handle;
	CTCommandSender<CVFSSection_CloseRequest>::SendCommand(m_VfsSectionID, cmd);
}
コード例 #21
0
ファイル: dvbsdffosd.c プロジェクト: backtrack2016/tdt
void cDvbSdFfOsd::SetActive(bool On)
{
  if (On != Active()) {
     cOsd::SetActive(On);
     if (On) {
        // must clear all windows here to avoid flashing effects - doesn't work if done
        // in Flush() only for the windows that are actually used...
        for (int i = 0; i < MAXNUMWINDOWS; i++) {
            Cmd(OSD_SetWindow, 0, i + 1);
            Cmd(OSD_Clear);
            }
        if (GetBitmap(0)) // only flush here if there are already bitmaps
           Flush();
        }
     else if (shown) {
        cBitmap *Bitmap;
        for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
            Cmd(OSD_SetWindow, 0, i + 1);
            Cmd(OSD_Close);
            }
        shown = false;
        }
     }
}
コード例 #22
0
void CObjUSER::Set_JOB (int iValue)
{		
	SetCur_JOB (iValue);
	if( GetClanID() )
		g_pNet->Send_cli_CLAN_MEMBER_JOBnLEV( Get_LEVEL(), iValue ) ;

	//20050823 If you change jobs in order to cheat MAX HP now display changes.
	UpdateAbility();

	//DlgSkill Tab change.
	CTCmdSetSkillDlg Cmd( iValue );
	Cmd.Exec(NULL);


}
コード例 #23
0
ファイル: wxe_impl.cpp プロジェクト: hmgibson23/otp
void meta_command(int what, wxe_data *sd) {
  if(what == PING_PORT) {
    erl_drv_mutex_lock(wxe_batch_locker_m);
    if(wxe_batch_caller > 0) {
      wxeCommand *Cmd = new wxeCommand(WXE_DEBUG_PING, NULL, 0, sd);
      wxe_batch->Append(Cmd);
      erl_drv_cond_signal(wxe_batch_locker_c);
    }
    wxWakeUpIdle();
    erl_drv_mutex_unlock(wxe_batch_locker_m);
  } else {
    if(sd) {
      wxeMetaCommand Cmd(sd, what);
      wxTheApp->AddPendingEvent(Cmd);
    }
  }
}
コード例 #24
0
ファイル: cmd.cpp プロジェクト: NGenetzky/particle-projects
// Exposed to other files.
int cmd_set(unsigned int uid, const char *s, int (*f) (void) ){
    if(cmds.size() <= uid){
        // Assign the command to the next open index.
        cmds.push_back( Cmd(uid, s, f) );
        return cmds.size();

    } else if(uid < 0){ // Check if its negative.
        return -1;
        
    } else { 
        // Replace the commmand at a particular index.
        cmds[uid].uid = uid;
        cmds[uid].name = s;
        cmds[uid].f = f;
        return uid;
    }
}
コード例 #25
0
ファイル: GMenu.cpp プロジェクト: FEI17N/Lgi
bool GMenu::OnKey(GView *v, GKey &k)
{
	GMenuItem *m = MatchShortcut(k);
	if (m)
	{
		if (!k.Down() && Window)
		{
			BMessage Cmd(M_COMMAND);
			Cmd.AddInt32("Cmd", m->Id());
			BMessenger Mess(Window->Handle());
			status_t Status = Mess.SendMessage(&Cmd);
		}
		return true;
	}

	return false;
}
コード例 #26
0
ファイル: ui.cpp プロジェクト: simedcn/fityk
UiApi::Status UserInterface::exec_and_log(const string& c)
{
    if (strip_string(c).empty())
        return UiApi::kStatusOk;

    // we want to log the input before the output
    if (!ctx_->get_settings()->logfile.empty()) {
        FILE* f = fopen(ctx_->get_settings()->logfile.c_str(), "a");
        if (f) {
            fprintf(f, "%s\n", c.c_str());
            fclose(f);
        }
    }

    UiApi::Status r = this->exec_command(c);
    cmds_.push_back(Cmd(c, r));
    ++cmd_count_;
    return r;
}
コード例 #27
0
ファイル: wxe_impl.cpp プロジェクト: NaughtyCode/otp
void meta_command(int what, wxe_data *sd) {
  if(what == PING_PORT && wxe_status == WXE_INITIATED) {
    erl_drv_mutex_lock(wxe_batch_locker_m);
    if(wxe_needs_signal) {
      wxe_queue->Add(WXE_DEBUG_PING, NULL, 0, sd);
      erl_drv_cond_signal(wxe_batch_locker_c);
    }
    wxWakeUpIdle();
    erl_drv_mutex_unlock(wxe_batch_locker_m);
  } else {
    if(sd && wxe_status == WXE_INITIATED) {
      wxeMetaCommand Cmd(sd, what);
      wxTheApp->AddPendingEvent(Cmd);
      if(what == DELETE_PORT) {
	driver_free(sd->bin);
	free(sd);
      }
    }
  }
}
コード例 #28
0
ファイル: m3_starfield.cpp プロジェクト: vpa1977/lock_free_mt
void
CStarField::vUpdateBeforeChildren( unsigned long in_Time )
{
	if(!m_bPreloadError)
	{
//		CLog::Print("CStarField::vUpdateBeforeChildren( %lu );\n",in_Time);
		m_Matrix.ConstructScaling( CVector(5.0f,5.0f,5.0f) );
		float AngleSelf = CONST_2PI*float(in_Time%(10000))/10000.0f;
//		CLog::Print("  AngleSelf = %f\n",AngleSelf);
		CMatrix RotationSelf; RotationSelf.ConstructRotationY(AngleSelf);
		CMatrix RotationTilt; RotationTilt.ConstructRotationZ(CONST_PI_6);
		float AngleAxisDrift = -CONST_2PI*float(in_Time%(40000))/40000.0f;
		CMatrix RotationDrift; RotationDrift.ConstructRotationY(AngleAxisDrift);
		m_Matrix *= RotationSelf;
		m_Matrix *= RotationTilt;
		m_Matrix *= RotationDrift;

		CRenderSection_RenderVB Cmd( m_Matrix, m_VBHandle, m_PSHandle, 0, m_PrimitiveType, m_PrimitiveCount );
		CRenderProxy::getInstance().RenderVB( Cmd );
	}
}
コード例 #29
0
void
CTest5Section::Reaction( long in_SrcSectionID, const CRenderSection_InitRenderResult& in_rResult )
{
	CLog::Print("CTest5Section::Reaction( const CRenderSection_InitRenderResult& in_rResult )\n");
	CLog::Print("  init %s\n", (in_rResult.m_Result==IRR_OK)? "SUCCEEDED":"FAILED" );
	assert(in_rResult.m_Result==IRR_OK);

	// create VB
//	CVBFormat VBFormat;
//	VBFormat.m_XYZ = true;
//	VBFormat.m_Diffuse = true;
//	CRenderSection_CreateVertexBuffer_Request Cmd( VBFormat, false );
//	Cmd.m_Data.resize( 6*sizeof(CCustomVertex) );
//	memcpy( (unsigned char*)&(Cmd.m_Data[0]), vertices, 6*sizeof(CCustomVertex) );
//	CTCommandSender<CRenderSection_CreateVertexBuffer_Request>::SendCommand(
//		m_RenderSectionID,
//		Cmd
//	);
	CVBFormat VBFormat;
	std::vector<unsigned char> Data;
	m_PrimitiveType = 0;
	bool Success = LoadDataFromFile("cube.txt",VBFormat,Data,m_PrimitiveType,m_NVertices);
	assert(Success);
CLog::Print("  m_PrimitiveType=%lu\n",m_PrimitiveType);
CLog::Print("  m_NVertices=%lu\n",m_NVertices);
	m_NPrimitives = CalcNPrimitives(m_PrimitiveType,m_NVertices);
CLog::Print("  m_NPrimitives=%lu\n",m_NPrimitives);
	CRenderSection_CreateVertexBuffer_Request Cmd( VBFormat, false );
	Cmd.m_Data = Data;
	CTCommandSender<CRenderSection_CreateVertexBuffer_Request>::SendCommand(
		m_RenderSectionID,
		Cmd
	);

	CLog::Print("CTest5Section::Reaction( const CRenderSection_InitRenderResult& in_rResult ) end\n");
}
コード例 #30
0
ファイル: macro.cpp プロジェクト: PNCG/neuron
Command* MacroCmd::GetCommand (Iterator& i) { return Cmd(Elem(i)); }