Exemple #1
0
//////////////////////////////////////////////////////////////////////////
// Player
//////////////////////////////////////////////////////////////////////////
FighterPlayerIvo::FighterPlayerIvo(LastExpressEngine *engine) : Fighter(engine) {
	_sequences.push_back(loadSequence("2003cr.seq"));
	_sequences.push_back(loadSequence("2003car.seq"));
	_sequences.push_back(loadSequence("2003cal.seq"));
	_sequences.push_back(loadSequence("2003cdr.seq"));
	_sequences.push_back(loadSequence("2003cdm.seq"));
	_sequences.push_back(loadSequence("2003chr.seq"));
	_sequences.push_back(loadSequence("2003chl.seq"));
	_sequences.push_back(loadSequence("2003ckr.seq"));
	_sequences.push_back(loadSequence("2003lbk.seq"));
	_sequences.push_back(loadSequence("2003fbk.seq"));

	_countdown = 5;
}
bool ofxTLDepthImageSequence::loadSequence(){
	ofFileDialogResult r = ofSystemLoadDialog("Load Depth Sequence Directory", true);
	if(r.bSuccess){
		return loadSequence(r.getPath());
	}
	return false;
}
Exemple #3
0
//////////////////////////////////////////////////////////////////////////
// Opponent
//////////////////////////////////////////////////////////////////////////
FighterOpponentIvo::FighterOpponentIvo(LastExpressEngine *engine) : Opponent(engine) {
	_sequences.push_back(loadSequence("2003or.seq"));
	_sequences.push_back(loadSequence("2003oal.seq"));
	_sequences.push_back(loadSequence("2003oar.seq"));
	_sequences.push_back(loadSequence("2003odm.seq"));
	_sequences.push_back(loadSequence("2003okl.seq"));
	_sequences.push_back(loadSequence("2003okj.seq"));
	_sequences.push_back(loadSequence("blank.seq"));
	_sequences.push_back(loadSequence("csdr.seq"));
	_sequences.push_back(loadSequence("2003l.seq"));

	getSound()->playSound(kEntityTables0, "MUS032", kVolumeFull);

	_countdown = 5;
	_field_38 = 15;
}
Exemple #4
0
//////////////////////////////////////////////////////////////////////////
// Player
//////////////////////////////////////////////////////////////////////////
FighterPlayerMilos::FighterPlayerMilos(LastExpressEngine *engine) : Fighter(engine) {
	_sequences.push_back(loadSequence("2001cr.seq"));
	_sequences.push_back(loadSequence("2001cdl.seq"));
	_sequences.push_back(loadSequence("2001cdr.seq"));
	_sequences.push_back(loadSequence("2001cdm.seq"));
	_sequences.push_back(loadSequence("2001csgr.seq"));
	_sequences.push_back(loadSequence("2001csgl.seq"));
	_sequences.push_back(loadSequence("2001dbk.seq"));
}
void THISSequence::loadSequence()
{
    ofFileDialogResult result = ofSystemLoadDialog("Load Sequence", true);
    if(result.bSuccess) {
        directory = result.getPath();
        loadSequence(directory);
    }
    else {
        ofLog(OF_LOG_ERROR, "THIS_Sequence -- ERROR -- attempted loaded invalid directory '" + directory + "'.");
    }
}
//////////////////////////////////////////////////////////////////////////
// Player
//////////////////////////////////////////////////////////////////////////
FighterPlayerVesna::FighterPlayerVesna(LastExpressEngine *engine) : Fighter(engine) {
	_sequences.push_back(loadSequence("2005cr.seq"));
	_sequences.push_back(loadSequence("2005cdr.seq"));
	_sequences.push_back(loadSequence("2005cbr.seq"));
	_sequences.push_back(loadSequence("2005bk.seq"));
	_sequences.push_back(loadSequence("2005cdm1.seq"));
	_sequences.push_back(loadSequence("2005chl.seq"));
}
//////////////////////////////////////////////////////////////////////////
// Opponent
//////////////////////////////////////////////////////////////////////////
FighterOpponentVesna::FighterOpponentVesna(LastExpressEngine *engine) : Opponent(engine) {
	_sequences.push_back(loadSequence("2005or.seq"));
	_sequences.push_back(loadSequence("2005oam.seq"));
	_sequences.push_back(loadSequence("2005oar.seq"));
	_sequences.push_back(loadSequence("2005okml.seq"));
	_sequences.push_back(loadSequence("2005okr.seq"));
	_sequences.push_back(loadSequence("2005odm1.seq"));
	_sequences.push_back(loadSequence("2005csbm.seq"));
	_sequences.push_back(loadSequence("2005oam4.seq"));

	getSound()->playSound(kEntityTables0, "MUS038", kVolumeFull);

	_countdown = 4;
	_field_38 = 30;
}
void THISSequence::loadSequence()
{
	ofxFileDialogCocoa fileDialog;
    fileDialog.canChooseDirectory = true;
    fileDialog.canChooseFile = false;
	fileDialog.open("/", "", directory, pathToDirectory);
    
	if(directory == ""){
		ofLog(OF_LOG_ERROR, "THIS_Sequence -- ERROR -- attempted loaded invalid directory '" + directory + "'.");
		return;
	}
	
    loadSequence(directory);
}
Exemple #9
0
//////////////////////////////////////////////////////////////////////////
// Opponent
//////////////////////////////////////////////////////////////////////////
FighterOpponentMilos::FighterOpponentMilos(LastExpressEngine *engine) : Opponent(engine) {
	_sequences.push_back(loadSequence("2001or.seq"));
	_sequences.push_back(loadSequence("2001oal.seq"));
	_sequences.push_back(loadSequence("2001oam.seq"));
	_sequences.push_back(loadSequence("2001okl.seq"));
	_sequences.push_back(loadSequence("2001okm.seq"));
	_sequences.push_back(loadSequence("2001dbk.seq"));
	_sequences.push_back(loadSequence("2001wbk.seq"));

	getSound()->playSound(kEntityTables0, "MUS027", kFlagDefault);

	_field_38 = 35;
}
Exemple #10
0
//////////////////////////////////////////////////////////////////////////
// Setup
void Menu::setup() {

	// Clear drawing queue
	getScenes()->removeAndRedraw(&_frames[kOverlayAcorn], false);
	SAFE_DELETE(_seqAcorn);

	// Load Menu scene
	// + 1 = normal menu with open egg / clock
	// + 2 = shield menu, when no savegame exists (no game has been started)
	_isGameStarted = _lowerTime >= kTimeStartGame;
	getScenes()->loadScene((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2));
	getFlags()->shouldRedraw = true;
	getLogic()->updateCursor();

	//////////////////////////////////////////////////////////////////////////
	// Load Acorn sequence
	_seqAcorn = loadSequence(getAcornSequenceName(_isGameStarted ? getNextGameId() : kGameBlue));

	//////////////////////////////////////////////////////////////////////////
	// Check if we loaded sequences before
	if (_seqTooltips && _seqTooltips->count() > 0)
		return;

	// Load all static data
	_seqTooltips = loadSequence("helpnewr.seq");
	_seqEggButtons = loadSequence("buttns.seq");
	_seqButtons = loadSequence("quit.seq");
	_seqCity1 = loadSequence("jlinetl.seq");
	_seqCity2 = loadSequence("jlinecen.seq");
	_seqCity3 = loadSequence("jlinebr.seq");
	_seqCredits = loadSequence("credits.seq");

	_frames[kOverlayTooltip] = new SequenceFrame(_seqTooltips);
	_frames[kOverlayEggButtons] = new SequenceFrame(_seqEggButtons);
	_frames[kOverlayButtons] = new SequenceFrame(_seqButtons);
	_frames[kOverlayAcorn] = new SequenceFrame(_seqAcorn);
	_frames[kOverlayCity1] = new SequenceFrame(_seqCity1);
	_frames[kOverlayCity2] = new SequenceFrame(_seqCity2);
	_frames[kOverlayCity3] = new SequenceFrame(_seqCity3);
	_frames[kOverlayCredits] = new SequenceFrame(_seqCredits);
}
void ofxImageSequence::loadSequence(string prefix, string filetype,  int startDigit, int endDigit)
{
	loadSequence(prefix, filetype, startDigit, endDigit, 0);
}
int
main (int argc, char** argv)
{	
 	Sint optindex, c;
	unsigned char depictsw=0;
	unsigned char wurst=1;
	unsigned char gnuplot=0;

	Uint i, j, noofseqs=0, nooffreqs=0, noofqueries=0;
	Uint noofhits=100;
	Uint substrlen = 10;
	Uint minseeds = 5;
	Uint maxmatches = 10000;
	char *seq, *vec, *bin;
	imbissinfo *imbiss;
	void *space = NULL;	
	double *scores = NULL;

	int swscores[2]={3,-2};
	char *pveclistfile=NULL;
	char *alphabetfile=NULL;	
	char *inputfile=NULL;
	char *batchfile = NULL;
	char *subfile=NULL;
	char *reportfile = NULL;

	 int (*handler)
	   (void *, Matchtype *, IntSequence **, Uint, 
		Uint, void *) = allscores;
	 
	 double (*filter) 
	   (void *, Matchtype *, IntSequence *, IntSequence *,
		 Uint *, Uint, Uint, void *) = swconstfilter;

	 Matchtype* (*select)
	   (void *, Matchtype *, Uint k, 
		IntSequence *, IntSequence **, void *) = selectSW;
  

	stringset_t **fn, **freq, *queryurl, **queries=NULL;
	Suffixarray *arr = NULL;	
	IntSequence **sequences = NULL;
	IntSequence *input = NULL;
	FAlphabet *alphabet = NULL;		
    PairSint *matches=NULL;
	Uint percent=0;
	
	time_t startsuf, endsuf; 
	double difsuf, difmatch, difrank;	

#ifdef MEMMAN_H 	
	Spacetable spacetab;
	initmemoryblocks(&spacetab, 100000);
	space = &spacetab;
#endif
	
	while(1) 
	{
		c=getopt_long(argc, argv, "SAghFGBLM:D:r:m:x:n:p:b:s:a:q:l:c:dvw", 
						long_options, &optindex);
		if (c==-1) break;
		
		switch(c) {
		    case 'r':
			  reportfile=optarg;
			  break;
		    case 'v':
			  verbose_flag=1;	
			  break;
		    case 'd':
			  	depictsw = 1;
				break;
		    case 's':
				pveclistfile = optarg;	
				break;
			case 'a':
				alphabetfile = optarg;	
				break;
			case 'q':
				inputfile = optarg;
				noofqueries = 1;
				break;
			case 'l':
				substrlen = atoi(optarg);
				break;
			case 'c':
			  	minseeds = atoi(optarg);
			    break;
			case 'b':
				batchfile = optarg;
				break;
			case 'p':
				percent = atoi(optarg);
				break;
			case 'x':
				subfile = optarg;
				break;
			case 'n':
				noofhits = atoi(optarg);
				break;
			case 'w':
				wurst = 0;
				break;
			case 'B':
				filter = scorefilter;
				select = selectBlastScore;
				break;
			case 'S':
				filter = scorefilter;
				select = selectScore;
				break;
			case 'A':
				filter = swconstfilter;
				select = selectSW;
				break;
			case 'F':
				filter = scorefilter;
				select = selectScoreSWconst;
				break;
			case 'G':
				filter = scorefilter;
				select = selectBlastScoreSWconst;
				break;
			case 'M':
				swscores[0]=atoi(optarg);
				break;
			case 'L':
				handler = latexscores;
				break;
			case 'D':
				swscores[1]=atoi(optarg);
				break;
			case 'g':
				gnuplot = 1;
				break;
			case 'm':
				maxmatches=atoi(optarg);
				break;
			case 'h':
			default:
				usage(argv[0]);
				exit (EXIT_FAILURE);
		}
	}
	if (pveclistfile==NULL || (inputfile == NULL && batchfile==NULL)
		|| alphabetfile == NULL) {
		usage(argv[0]);
		exit (EXIT_FAILURE);
	}
	
	imbiss = ALLOCMEMORY(space, NULL, imbissinfo, 1);
	imbiss->reportfile = reportfile;
	imbiss->swscores = swscores;
	imbiss->noofhits = noofhits;
	imbiss->minseeds = minseeds; 	
	imbiss->wurst = wurst; 
	
	/*read batch file*/
	if (batchfile) {
		queries = readcsv(space, batchfile, "", &noofqueries);	
	}

	/*read substitution matrix*/
	if (subfile) {
		freq=readcsv(space, subfile,",", &nooffreqs);
		scores = ALLOCMEMORY(space, NULL, double, ((nooffreqs-1)*(nooffreqs-1)) );
		for(i=1; i < nooffreqs; i++) {
			for(j=1; j < nooffreqs; j++) {
				if(strcmp(SETSTR(freq[i],j),"inf")==0){
					MATRIX2D(scores, nooffreqs-1, i, j)=0;
				}else{
					MATRIX2D(scores, nooffreqs-1, i, j)=atof(SETSTR(freq[i],j));
				}
			}
		}
	}
	
	/*read alphabet*/	
	if (alphabetfile != NULL) {
		alphabet = loadCSValphabet(space, alphabetfile);
		sortMapdomain(space, alphabet);
    }

	
	/*load sequence database*/
	fn=readcsv(space, pveclistfile, "", &noofseqs);
	sequences = ALLOCMEMORY(space, NULL, IntSequence *, noofseqs);
	for(i=0; i < noofseqs; i++) 
	{		  
		sequences[i] = loadSequence(space, SETSTR(fn[i],0));		
	}

	for (i=0; i < noofseqs; i++) {	
	  	destructStringset(space, fn[i]);
	}
	FREEMEMORY(space, fn);
	
	
	/*construct the suffix array*/
	time (&startsuf);
	arr = constructSufArr(space, sequences, noofseqs, NULL);
        constructLcp(space, arr); 	
   	time (&endsuf);
	difsuf = difftime (endsuf, startsuf);


	/*do search*/
    for (i=0; i < noofqueries; i++) {
	  
	    /*get query form batchfile*/
	  	if (queries) {
			inputfile = SETSTR(queries[i],0);
		}	
		
		/*typically only used with batchfile*/
		if (percent != 0) {
			substrlen = 
			  ((double)((double)input->length/100)*(double) percent);
		}
			
		input = loadSequence(space, inputfile);
		//seq = printSequence (space, input, 60); 
		printf(">IMBISS order delivered\n");	
		//printf("%s\n",seq);
		printf("%s\n", input->url); 
		//FREEMEMORY(space, seq);	
		
		time (&startsuf);
		matches=sufSubstring(space, arr, input->sequence, input->length, substrlen);	 
		time (&endsuf);
		difmatch = difftime (endsuf, startsuf);

		/*get prob vector url for salami/wurst*/
        //printf("%.*s\n", 5, input->url + 58);
        vec = malloc(sizeof(char)*66);
        sprintf(vec, "/smallfiles/public/no_backup/bm/pdb_all_vec_6mer_struct/%5s.vec\0", input->url+56);
        bin = malloc(sizeof(char)*54);
        sprintf(bin, "/smallfiles/public/no_backup/bm/pdb_all_bin/%5s.bin\0", input->url+56);

		queryurl = initStringset(space);
		addString(space, queryurl, bin, strlen(bin));
		addString(space, queryurl, vec, strlen(vec));

		
        getimbissblast(space, input, sequences, noofseqs, alphabet, imbiss);
	

		imbiss->query = queryurl;
		imbiss->substrlen = substrlen;
		imbiss->alphabet = alphabet;
		
		/*if a substition file was given ...*/
		if (subfile) {
			imbiss->sub = createsubmatrix(scores, imbiss->score, nooffreqs-1);
		}
		
		/*match 'n' report*/
		time (&startsuf);
		
		imbiss->consensus = ALLOCMEMORY(space, NULL, Uint, (input->length-substrlen));
		memset(imbiss->consensus, 0, (sizeof(Uint)*(input->length-substrlen)));
	
		rankSufmatch(space, arr, matches, input->length-substrlen,
			maxmatches, substrlen, 
			sequences, noofseqs, filter, select, handler,
			input, imbiss, scores, depictsw);
		
		if (gnuplot) {	
			consensus (space, imbiss->consensus, input->length-substrlen, 
				input, substrlen, imbiss);
		}

		time (&endsuf);
		difrank = difftime (endsuf, startsuf);
	
		printf ("Building  the suffixtree has taken %f seconds.\n", difsuf);
		printf ("Match the suffixtree has taken %f seconds.\n", difmatch);
    		printf ("Rank  the suffixtree has taken %f seconds.\n", difrank);
	
		/*partial cleanup*/
		//destructStringset(space, queryurl);
		destructSequence(space, input);
		if(subfile) {
			FREEMEMORY(space, imbiss->sub);
		}

		FREEMEMORY(space, imbiss->consensus);
		FREEMEMORY(space, imbiss->score);
		FREEMEMORY(space, matches);
        free(bin);
        free(vec);
	}
	
	/*final cleanup*/
	for (i=0; i < noofseqs; i++) {
		destructSequence(space, sequences[i]);
	}
    FREEMEMORY(space, sequences);	
	destructSufArr(space, arr);
	
#ifdef MEMMAN_H
	activeblocks(space);
#endif
	
	printf("Goodbye.\n");	
	return EXIT_SUCCESS;
}
Exemple #13
0
TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(NULL), _frameLine2(NULL) {
	_frameLine1 = new SequenceFrame(loadSequence("line1.seq"), 0, true);
	_frameLine2 = new SequenceFrame(loadSequence("line2.seq"), 0, true);
}
Exemple #14
0
void Beetle::load() {
	// Only load in chapter 2 & 3
	if (getProgress().chapter != kChapter2 &&  getProgress().chapter != kChapter3)
		return;

	// Already loaded
	if (_data)
		return;

	// Do not load if beetle is in the wrong location
	if (getInventory()->get(kItemBeetle)->location != kObjectLocation3)
		return;

	///////////////////////
	// Load Beetle data
	_data = new BeetleData();

	// Load sequences
	_data->sequences.push_back(loadSequence("BW000.seq"));        // 0
	_data->sequences.push_back(loadSequence("BT000045.seq"));
	_data->sequences.push_back(loadSequence("BT045000.seq"));
	_data->sequences.push_back(loadSequence("BW045.seq"));
	_data->sequences.push_back(loadSequence("BT045090.seq"));
	_data->sequences.push_back(loadSequence("BT090045.seq"));     // 5
	_data->sequences.push_back(loadSequence("BW090.seq"));
	_data->sequences.push_back(loadSequence("BT090135.seq"));
	_data->sequences.push_back(loadSequence("BT135090.seq"));
	_data->sequences.push_back(loadSequence("BW135.seq"));
	_data->sequences.push_back(loadSequence("BT135180.seq"));     // 10
	_data->sequences.push_back(loadSequence("BT180135.seq"));
	_data->sequences.push_back(loadSequence("BW180.seq"));
	_data->sequences.push_back(loadSequence("BT180225.seq"));
	_data->sequences.push_back(loadSequence("BT225180.seq"));
	_data->sequences.push_back(loadSequence("BW225.seq"));        // 15
	_data->sequences.push_back(loadSequence("BT225270.seq"));
	_data->sequences.push_back(loadSequence("BT270225.seq"));
	_data->sequences.push_back(loadSequence("BW270.seq"));
	_data->sequences.push_back(loadSequence("BT270315.seq"));
	_data->sequences.push_back(loadSequence("BT315270.seq"));     // 20
	_data->sequences.push_back(loadSequence("BW315.seq"));
	_data->sequences.push_back(loadSequence("BT315000.seq"));
	_data->sequences.push_back(loadSequence("BT000315.seq"));
	_data->sequences.push_back(loadSequence("BA135.seq"));
	_data->sequences.push_back(loadSequence("BL045.seq"));        // 25
	_data->sequences.push_back(loadSequence("BL000.seq"));
	_data->sequences.push_back(loadSequence("BL315.seq"));
	_data->sequences.push_back(loadSequence("BL180.seq"));

	// Init fields
	_data->field_74 = 0;

	// Check that all sequences are loaded properly
	_data->isLoaded = true;
	for (int i = 0; i < (int)_data->sequences.size(); i++) {
		if (!_data->sequences[i]->isLoaded()) {
			_data->isLoaded = false;
			break;
		}
	}

	_data->field_D9 = 10;
	_data->coordOffset = 5;
	_data->coordY = 178;
	_data->currentSequence = 0;
	_data->offset = 0;
	_data->frame = NULL;
	_data->field_D5 = 0;
	_data->indexes[0] = 29;
	_data->field_DD = 0;
}
Exemple #15
0
Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(NULL), _frameHour(NULL), _frameSun(NULL), _frameDate(NULL) {
	_frameMinutes = new SequenceFrame(loadSequence("eggmin.seq"), 0, true);
	_frameHour = new SequenceFrame(loadSequence("egghour.seq"), 0, true);
	_frameSun = new SequenceFrame(loadSequence("sun.seq"), 0, true);
	_frameDate = new SequenceFrame(loadSequence("datenew.seq"), 0, true);
}