Esempio n. 1
0
bool FliPlayer::play(bool intro, Font *pIntroFont) {
    if (!fli_data_)
        return false;

    g_Screen.clear(0);
    int cur_frame = 0;
    while (hasFrames()) {
        // Consumes events now so they won't be piled up after the animation
        g_App.menus().handleEvents();

        if (!decodeFrame())
            break;
        copyCurrentFrameToScreen();

        cur_frame++;

        g_System.updateScreen();
        g_System.delay(1000 / (intro ? 10 : 15));      //fps
    }

    //clear the backscreen
    //bzero(Screen::pixels(), GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT);

    return true;
}
Esempio n. 2
0
void Model::togglePin(int index) {
    if (_running)
        return;
    if (!hasFrames())
        return;
    _current->togglePin(index);
    emit currentFrameChanged();
}
Esempio n. 3
0
void Model::start() {
    if (_running)
        return;
    if (!hasFrames())
        return;

    _running = true;
    QTimer::singleShot(100, this, SLOT(frameTimeout()));
}
Esempio n. 4
0
void Model::goPrev()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    if (_current == _frames.begin())
        return;

    _current--;
    _index--;
    emit currentFrameChanged();
}
Esempio n. 5
0
void Model::goFirst()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    if (_current == _frames.begin())
        return;

    _current = _frames.begin();
    _index = 0;
    emit currentFrameChanged();
}
Esempio n. 6
0
void Model::addBlankFrame()
{
    if (_running)
        return;
    Frame frame(0x00, 100);
    if (hasFrames()) {
        _current++;
        _index++;
    }
    _current = _frames.insert(_current, frame);
    _total++;
    emit currentFrameChanged();
}
Esempio n. 7
0
void Model::goNext()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    Frames::iterator next = _current;
    if (++next == _frames.end())
        return;

    _current++;
    _index++;
    emit currentFrameChanged();
}
Esempio n. 8
0
void Model::goLast()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    Frames::iterator next = _current;
    if (++next == _frames.end())
        return;

    _current = _frames.end();
    _current--;
    _index = _total - 1;
    emit currentFrameChanged();
}
Esempio n. 9
0
void Model::deleteCurrentFrame()
{
    if (_running)
        return;
    if (!hasFrames())
        return;

    _current = _frames.erase(_current);
    if (_current == _frames.end() && _frames.begin() != _frames.end()) {

        _current--;
        _index--;
    }

    _total--;
    emit currentFrameChanged();
}