Esempio n. 1
0
static void stateMachine3_cellCalculate(StateMachine *sM, double *current, double *lower, double *middle, double *upper,
        Symbol cX, Symbol cY, void (*doTransition)(double *, double *, int64_t, int64_t, double, double, void *),
        void *extraArgs) {
    symbol_check(cX);
    symbol_check(cY);
    StateMachine3 *sM3 = (StateMachine3 *) sM;
    if (lower != NULL) {
        double eP = emission_getGapProb(sM3->EMISSION_GAP_X_PROBS, cX);
        doTransition(lower, current, match, shortGapX, eP, sM3->TRANSITION_GAP_OPEN_X, extraArgs);
        doTransition(lower, current, shortGapX, shortGapX, eP, sM3->TRANSITION_GAP_EXTEND_X, extraArgs);
        doTransition(lower, current, shortGapY, shortGapX, eP, sM3->TRANSITION_GAP_SWITCH_TO_X, extraArgs);
    }
    if (middle != NULL) {
        double eP = emission_getMatchProb(sM3->EMISSION_MATCH_PROBS, cX, cY);  //symbol_matchProb(cX, cY);
        doTransition(middle, current, match, match, eP, sM3->TRANSITION_MATCH_CONTINUE, extraArgs);
        doTransition(middle, current, shortGapX, match, eP, sM3->TRANSITION_MATCH_FROM_GAP_X, extraArgs);
        doTransition(middle, current, shortGapY, match, eP, sM3->TRANSITION_MATCH_FROM_GAP_Y, extraArgs);

    }
    if (upper != NULL) {
        double eP = emission_getGapProb(sM3->EMISSION_GAP_Y_PROBS, cY);
        doTransition(upper, current, match, shortGapY, eP, sM3->TRANSITION_GAP_OPEN_Y, extraArgs);
        doTransition(upper, current, shortGapY, shortGapY, eP, sM3->TRANSITION_GAP_EXTEND_Y, extraArgs);
        doTransition(upper, current, shortGapX, shortGapY, eP, sM3->TRANSITION_GAP_SWITCH_TO_Y, extraArgs);
    }
}
Esempio n. 2
0
void GfxTransitions::doit(Common::Rect picRect) {
	const GfxTransitionTranslateEntry *translationEntry = _translationTable;

	_picRect = picRect;

	if (_translationTable) {
		// We need to translate the ID
		translationEntry = translateNumber(_number, _translationTable);
		if (translationEntry) {
			_number = translationEntry->newId;
			_blackoutFlag = translationEntry->blackoutFlag;
		} else {
			warning("Transitions: old ID %d not supported", _number);
			_number = SCI_TRANSITIONS_NONE;
			_blackoutFlag = false;
		}
	}

	if (_blackoutFlag) {
		// We need to find out what transition we are supposed to use for
		// blackout
		translationEntry = translateNumber(_number, blackoutTransitionIDs);
		if (translationEntry) {
			doTransition(translationEntry->newId, true);
		} else {
			warning("Transitions: ID %d not listed in blackoutTransitionIDs", _number);
		}
	}

	_palette->palVaryPrepareForTransition();

	// Now we do the actual transition to the new screen
	doTransition(_number, false);

	if (picRect.bottom != _screen->getHeight()) {
		// TODO: this is a workaround for lsl6 not showing menubar when playing
		//  There is some new code in the sierra sci in ShowPic that seems to do
		//  something similar to this
		_screen->copyToScreen();
		g_system->updateScreen();
	}

	_screen->_picNotValid = 0;
}
Esempio n. 3
0
le_uint8 ThaiShaping::getNextState(LEUnicode ch, le_uint8 prevState, le_int32 inputIndex, le_uint8 glyphSet, LEUnicode errorChar,
                              le_uint8 &charClass, LEUnicode *output, LEGlyphStorage &glyphStorage, le_int32 &outputIndex)
{
    StateTransition transition;

    charClass = getCharClass(ch);
    transition = getTransition(prevState, charClass);
    
    return doTransition(transition, ch, inputIndex, glyphSet, errorChar, output, glyphStorage, outputIndex);
}
Esempio n. 4
0
void Slide::draw(){
	// cout << "DRAW 0" << endl;

	// Set default alpha.
	ofSetColor(255, 255, 255, 255);

	// Draw background color.
	ofBackground(backgroundColor);

	// cout << "DRAW 1" << endl;

	// Draw background image.
	if(bgImage.isAllocated()){
		bgImage.draw((ofGetWindowWidth() - bgImage.getWidth()) / 2, (ofGetWindowHeight() - bgImage.getHeight()) / 2);
	}

	// Draw background video.
#if defined(TARGET_RASPBERRY_PI)
	// Load video on Raspberry Pi.
	if(bgVideo.isPlaying()){
		int vHeight = ofGetWindowWidth() / bgVideo.getWidth() * bgVideo.getHeight();
		bgVideo.draw(0, 0, ofGetWindowWidth(), vHeight);
	}
#else
	if(bgVideo.isLoaded()){
		int vHeight = ofGetWindowWidth() / bgVideo.getWidth() * bgVideo.getHeight();
		bgVideo.draw(0, 0, ofGetWindowWidth(), vHeight);
	}
#endif

	// cout << "DRAW 2" << endl;

	// Items.
	if(items.size() > 0 && currentItem > -1){
		items[currentItem]->draw();
	}
	
	// cout << "DRAW 3" << endl;

	// Do slide transition.
	if(transition != PRESENTER_TRANSITION_NONE){
		ofImage screen;
		screen.grabScreen(0, 0, ofGetWindowWidth(), ofGetWindowHeight());
		doTransition(&screen);
	}

	// cout << "DRAW 4" << endl;

}
Esempio n. 5
0
void GfxTransitions::doit(Common::Rect picRect) {
	const GfxTransitionTranslateEntry *translationEntry = _translationTable;

	_picRect = picRect;

	if (_translationTable) {
		// We need to translate the ID
		translationEntry = translateNumber(_number, _translationTable);
		if (translationEntry) {
			_number = translationEntry->newId;
			_blackoutFlag = translationEntry->blackoutFlag;
		} else {
			warning("Transitions: old ID %d not supported", _number);
			_number = SCI_TRANSITIONS_NONE;
			_blackoutFlag = false;
		}
	}

	if (_blackoutFlag) {
		// We need to find out what transition we are supposed to use for
		// blackout
		translationEntry = translateNumber(_number, blackoutTransitionIDs);
		if (translationEntry) {
			doTransition(translationEntry->newId, true);
		} else {
			warning("Transitions: ID %d not listed in blackoutTransitionIDs", _number);
		}
	}

	_palette->palVaryPrepareForTransition();

	// Now we do the actual transition to the new screen
	doTransition(_number, false);

	_screen->_picNotValid = 0;
}