コード例 #1
0
ファイル: Manager.c プロジェクト: barroca/Anthill
/// Init a ds pipeline.
///	\param confFile XML file configuration, NULL if we want to make things by hand
///	\param argc argc received by main function that will be forwarded to filter processes
///	\param argv argv received by main function that will be forwarded to filter processes
///	\return Layout of the pipeline
Layout *initDs(char *confFile, int argc, char **argv) {
    int err;

    //configura pvm pra enviar dado diretamente(IMPORTANTE!!!!)
    pvm_setopt(PvmRoute, PvmRouteDirect);

    //err == 0, OK
    err = pvm_start_pvmd(0, NULL, 0);
    switch (err) {
    case PvmSysErr:
        printf("Manager.c: error starting PVM, aborting\n");
        exit(1);
        break;
    }

    //start random number generator
    srandom(getpid());

    // config DS to use signals
//	signal(SIGSEGV, &captureSignal);
//	signal(SIGINT, &captureSignal);
//	signal(SIGILL, &captureSignal);
//	signal(SIGHUP, &captureSignal);
//	signal(SIGTERM, &captureSignal);

    if (I_AM_THE_MANAGER) {
        return initManager(confFile, argc, argv);
    } else {
        runFilter(argc, argv);
        exit(0);
    }
}
コード例 #2
0
ファイル: kbfirmware.cpp プロジェクト: 0----0/ckb
bool KbFirmware::_checkUpdates(){
    initManager();
    quint64 now = QDateTime::currentMSecsSinceEpoch();
    if(now < lastCheck + AUTO_CHECK_TIME)
        return false;
    tableDownload = networkManager->get(QNetworkRequest(QUrl("https://raw.githubusercontent.com/ccMSC/ckb/master/FIRMWARE")));
    connect(tableDownload, SIGNAL(finished()), this, SLOT(downloadFinished()));
    lastCheck = now;
    return true;
}
コード例 #3
0
ファイル: airportsim.c プロジェクト: kyuhyunc/csci350
void init() {
	initGlobalData();
	initPassengers();
	initLiaisons();
	initManager();
	initCargoHandlers();
	initScreeningOfficers();
	initSecurityInspectors();
	initAirlines();

}
コード例 #4
0
void initCatLoveDogTitle(CatLoveDogTitle * myself,Rect DF_Windows_Rect,DF_PictureLibrary * picLib)
{
       initManager(&manager);
	initDFWindows(&myself->windows,DF_Windows_Rect,myself,myself,5);
	myself->windows.RenderCallBack=CatLoveDog_Title_Windows_Render;
	myself->windows.UpdateCallBack=CatLoveDog_Title_Windows_Update;
	myself->picLib=picLib;
	myself->timer = 0;
	CatLoveDog_Loading_UpdateStep();
	myself->imgTitle=myself->picLib->GetImage(myself->picLib,"logo_176.gif");
	
	CatLoveDog_Loading_UpdateStep();
}	
コード例 #5
0
ファイル: io.c プロジェクト: neosam/s3d
char *handleS3D(char *server, int port, char *rest, int *size)
{
	char *res;

	THROWIF(port != -1, -1, "Sorry s3d just works with port -1");
	THROWIF(strcmp(server, "localhost"), -1,
		"Sorry, s3d just with localhost");

	initManager();
	res = getCurrent(rest);
	quitManager();
	*size = *((int *)res);

	return res;
}
コード例 #6
0
FileManager::FileManager( QSizeF size, OpenGLScene* scene, OpenManager* open )
: BarBase( size, 10, 60 )
, _FileTrans( 0, 0 )
, _heightPercent( 0 )
, _DRAGFILE( false )
, _Control( size.width()/3, 0, size.width()/3, 18 )
, _ONMOVE( false )
, _HIGHLIGHTCONTROL( false )
, _VISINDEX( -1 )
, _EllipseMove( size.width()/3*2 - 36, 0 , 18, 18)
, _EllipseHide( size.width()/3*2 - 18, 0 , 18, 18)
, _EllipseMap( size.width()/3*2 - 54, 0 , 18, 18)
, _EllipseColor( size.width()/3*2 - 72, 0 , 18, 18)
, SHIFTFILEVIEW( false )
, _DIRECTPREOPEN( false )
, _ONCONTROLTYPE( -1 )
, CLICKINDEX(-1)
, COLORBAR( false )
, _CurrentFileName( "" )
, _CTRL( false )
{
	setFlag( QGraphicsItem::ItemIsMovable, true);
	setFlag( QGraphicsItem::ItemIsSelectable, true);
	setFlag( QGraphicsItem::ItemIsFocusable, true);
	initViewRect();
	initIcons();
	this->_scene = scene;
	this->_open = open;
	controlName[0] = QString( tr("") );
	controlName[1] = QString( tr("") );
	controlName[2] = QString( tr("") );
	controlName[3] = QString( tr("") );
	//
	initManager();
	return;
}
コード例 #7
0
void MemoryBox_enter(void)
{
	gm_s8 i;
#ifdef GAME_240_320
	DF_InitMemory(150*1024);	//设定游戏内存空间
#endif
#ifdef GAME_176_220
	DF_InitMemory(140*1024);
#endif
	initMemoryBlock(getMemoryBlockPtr(),1024*50);
	initDreamFactoryEngine();
	initDFDataPackage(&dataPackage,5);//游戏的资源包	
	dataPackage.DP_LoadPackage(&dataPackage,0);
#ifdef WIN32
	dataPackage.DP_DoLoading(&dataPackage,MemoryBox_TResource_Data,0);
#else
	dataPackage.DP_DoLoading(&dataPackage,MemoryBox_TResource_Data,1);
#endif
	DF_SetDataPackage(&dataPackage);

	memoryblock_my=getMemoryBlockPtr();
	manager_my=getManagerPtr();
    initManager(manager_my);
	
	initDFPictureLibrary(&allPicLib,20);
	initDFRecord(&memoryBoxRecord,"memoryBoxRecord",1024,5);
	memoryBoxRecord.Open(&memoryBoxRecord);
	if(memoryBoxRecord.recordNum != 4)
	{
		memoryBoxRecord.ResetData(&memoryBoxRecord);//无效数据初始化记录
		memoryBoxRecord.AddRecord(&memoryBoxRecord,50);
		memoryBoxRecord.pointer = 0;
		for(i=0;i<9;i++)
		{
			memoryBoxHighTimeValue[i]=300;
		}
			memoryBoxHighTimeValue[9]=700;
		for(i=0;i<10;i++)
		{
			memoryBoxHighScoreYear[i]=0;
		}
		for(i=0;i<10;i++)
		{
			memoryBoxHighScoreMonth[i]=0;
		}
		for(i=0;i<10;i++)
		{
			memoryBoxHighScoreDate[i]=0;
		}
		MemoryBox_Save_Record();
	}
	MemoryBox_Read_Record();
	memoryBoxTitleState=MEMORYBOX_TITLE_STATE_SHOW_TITLE;
	memoryBoxLoadingStep=0;
	memoryBoxLoadingStepTotal=16;
	
	vmtScreenInit(&MemoryBox_Screen_InGame,
	MemoryBox_InGame_Init,
	MemoryBox_InGame_Destory,
	MemoryBox_InGame_Logic,
	MemoryBox_InGame_Render,
	MemoryBox_InGame_Pause,
	MemoryBox_InGame_Resume,
	MemoryBox_InGame_LoadResource
	);
	
	vmtScreenInit(&MemoryBox_Screen_Loading,
	MemoryBox_Loading_Init,
	MemoryBox_Loading_Destory,
	MemoryBox_Loading_Logic,
	MemoryBox_Loading_Render,
	MemoryBox_Loading_Pause,
	MemoryBox_Loading_Resume,
	MemoryBox_Loading_LoadResource
	);
	
	vmtScreenInit(&MemoryBox_Screen_Title,
	MemoryBox_Title_init,
	MemoryBox_Title_Destroy,
	MemoryBox_Title_Logic,
	MemoryBox_Title_Render,
	MemoryBox_Title_Pause,
	MemoryBox_Title_Resume,
	MemoryBox_Title_LoadResource
	);
	MemoryBox_Screen_Next=&MemoryBox_Screen_Title;//记录下个屏幕点
	SCREEN_ChangeScreen(&MemoryBox_Screen_Loading);//切换屏幕

}
コード例 #8
0
CpgSuperCoupling_t* HCCpgManager_createCoupling(short fromLabel, short toLabel, float strength, float phaseDiff) {
	if(manager == NULL) initManager();
	CpgSuperCoupling_t* coupling =  _CpgSuperManager_createCoupling(fromLabel, toLabel, strength, phaseDiff, manager);
	return coupling;
}
コード例 #9
0
HCCpg_t* HCCpgManager_createCpg(short label, float hz) {
	if(manager == NULL) initManager();
	HCCpg_t* cpg = (HCCpg_t*) _CpgSuperManager_createCpg(label, hz, manager);
	HCCpg_initialize(cpg);
	return cpg;
}
コード例 #10
0
ファイル: MapManager.cpp プロジェクト: NBGate/LinkLiner
MapManager::MapManager(int level):m_score(0),m_time(0) {
    initMap(level);
    initManager();
}
コード例 #11
0
ファイル: MapManager.cpp プロジェクト: NBGate/LinkLiner
MapManager::MapManager():m_score(0),m_time(0) {
    initMap(1);
    initManager();
}
コード例 #12
0
void CatLoveDog_enter(void)
{
#ifdef GAME_240_320
	DF_InitMemory(150*1024);	
#endif
#ifdef GAME_176_220
	DF_InitMemory(140*1024);
#endif
	initMemoryBlock(getMemoryBlockPtr(),1024*50);
	initDreamFactoryEngine();
	initDFDataPackage(&dataPackage,5);
	dataPackage.DP_LoadPackage(&dataPackage,0);
#ifdef WIN32
	dataPackage.DP_DoLoading(&dataPackage,CatLoveDog_TResource_Data,1);
#else
	dataPackage.DP_DoLoading(&dataPackage,CatLoveDog_TResource_Data,1);
#endif
	DF_SetDataPackage(&dataPackage);

	memoryblock_my=getMemoryBlockPtr();

	manager_my=getManagerPtr();
    initManager(manager_my);
	
	initDFPictureLibrary(&catLoveDogPicLib,20);
	CatLoveDogTitleState=CatLoveDog_TITLE_STATE_SHOW_TITLE;
	catLoveDogLoadingStep=0;
	catLoveDogLoadingStepTotal=16;

	vmtScreenInit(&CatLoveDog_Screen_InGame,
	CatLoveDog_InGame_Init,
	CatLoveDog_InGame_Destory,
	CatLoveDog_InGame_Logic,
	CatLoveDog_InGame_Render,
	CatLoveDog_InGame_Pause,
	CatLoveDog_InGame_Resume,
	CatLoveDog_InGame_LoadResource
	);
	
	vmtScreenInit(&CatLoveDog_Screen_Loading,
	CatLoveDog_Loading_Init,
	CatLoveDog_Loading_Destory,
	CatLoveDog_Loading_Logic,
	CatLoveDog_Loading_Render,
	CatLoveDog_Loading_Pause,
	CatLoveDog_Loading_Resume,
	CatLoveDog_Loading_LoadResource
	);
	
	vmtScreenInit(&CatLoveDog_Screen_Title,
	CatLoveDog_Title_init,
	CatLoveDog_Title_Destroy,
	CatLoveDog_Title_Logic,
	CatLoveDog_Title_Render,
	CatLoveDog_Title_Pause,
	CatLoveDog_Title_Resume,
	CatLoveDog_Title_LoadResource
	);
	CatLoveDog_Screen_Next=&CatLoveDog_Screen_Title;
	SCREEN_ChangeScreen(&CatLoveDog_Screen_Loading);

}
コード例 #13
0
/*********************************ShowGame中protected void paint(Graphics g)方法********************************/
void initCatLoveDog_InGame(CatLoveDog_InGame * myself,Rect windows_Rect,DF_PictureLibrary * picLib,gm_s16 repaintMax)
{
	extVmSysManager->VmSetFPS(50);
	initManager(&manager);
	initDFWindows(&myself->windows,windows_Rect,myself,myself,repaintMax);
	myself->windows.RenderCallBack=CatLoveDog_InGame_Windows_Render;
    myself->windows.UpdateCallBack=CatLoveDog_InGame_Windows_Update;
	myself->picLib=picLib;
	
	myself->windImg = myself->picLib->GetImage(picLib,"win.gif");
	CatLoveDog_Loading_UpdateStep();
	
	if(level == 1)
		myself->beijing = myself->picLib->GetImage(picLib,"beijing_0.gif");
	if(level == 2)
		myself->beijing = myself->picLib->GetImage(picLib,"beijing_1.gif");
	if(level == 3)
		myself->beijing = myself->picLib->GetImage(picLib,"beijing_2.gif");
	myself->catImg = myself->picLib->GetImage(picLib,"cat.gif");
	
	myself->dogImg = myself->picLib->GetImage(picLib,"dog.gif");
	
	CatLoveDog_Loading_UpdateStep();

	myself->fishImg = myself->picLib->GetImage(picLib,"yuci.gif");
	myself->boneImg = myself->picLib->GetImage(picLib,"gutou.gif");
	CatLoveDog_Loading_UpdateStep();

	myself->loseImg = myself->picLib->GetImage(picLib,"lose.gif");
	myself->bombImg = myself->picLib->GetImage(picLib,"baozha.gif");
	CatLoveDog_Loading_UpdateStep();
	
	myself->windImg = myself->picLib->GetImage(picLib,"wind.gif");
	myself->buttonImg = myself->picLib->GetImage(picLib,"button.gif");
	CatLoveDog_Loading_UpdateStep();

	myself->lifeImageD = myself->picLib->GetImage(picLib,"LifeD.gif");
	myself->lifeImageC = myself->picLib->GetImage(picLib,"LifeC.gif");
	CatLoveDog_Loading_UpdateStep();

	myself->liliangImg = myself->picLib->GetImage(picLib,"liliang.gif");
	
	myself->gameWin = false;
	myself->gameOver = false;
	myself->catBlood = 60;
	myself->cattu = 0;
	myself->dogBlood = 60;
	myself->dogtu = 0;
 	myself->SleepTimer = 50;
	myself->changelifeD = 0;
	myself->changelifeC = 0;
	myself->setColor = 30;
	CatLoveDog_Loading_UpdateStep();
	myself->bombRun = false;
	myself->bombFrame = 0;
	myself->bombShow = false;
	myself->angle =48;
	myself->catPX = 5;
	myself->alive = true;
	myself->isPause = false;
	CatLoveDog_Loading_UpdateStep();

	myself->windn = 0;
	myself->Wind_left = 10;
  	myself->Wind_right = 10;
  	myself->Wind_change = 0;
  	myself->Wind_v = 0;
	CatLoveDog_Loading_UpdateStep();

	myself->fishPX = 50;
	myself->fishPY = 500;
	myself->fishFrame = 0;
	myself->fish_v0 = 0;
	myself->fish_i = 0;
	myself->fishGo = false;
	myself->fish_t1 = 0;
	myself->fish_add1 = 3;
	myself->fishShow = false;
	myself->isFire = 0;
	CatLoveDog_Loading_UpdateStep();
	
	myself->bonePX = 500;
	myself->bonePY = 500;
	myself->boneFrame = 0;
	myself->bone_v02 = 0;
	myself->bone_add2 = 3;
	myself->boneGo = false;
	myself->bone_r = 0;
	myself->boneShow = false;
	myself->bone_i=0;
	myself->bombPX = 0;
	myself->bombPY = 0;
	myself->teshu = false;
	//myself->fish_tTemp = 0;
	//myself->bone_tTemp2 = 0;
	CatLoveDog_Loading_UpdateStep();
}