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; }
void Model::togglePin(int index) { if (_running) return; if (!hasFrames()) return; _current->togglePin(index); emit currentFrameChanged(); }
void Model::start() { if (_running) return; if (!hasFrames()) return; _running = true; QTimer::singleShot(100, this, SLOT(frameTimeout())); }
void Model::goPrev() { if (_running) return; if (!hasFrames()) return; if (_current == _frames.begin()) return; _current--; _index--; emit currentFrameChanged(); }
void Model::goFirst() { if (_running) return; if (!hasFrames()) return; if (_current == _frames.begin()) return; _current = _frames.begin(); _index = 0; emit currentFrameChanged(); }
void Model::addBlankFrame() { if (_running) return; Frame frame(0x00, 100); if (hasFrames()) { _current++; _index++; } _current = _frames.insert(_current, frame); _total++; emit currentFrameChanged(); }
void Model::goNext() { if (_running) return; if (!hasFrames()) return; Frames::iterator next = _current; if (++next == _frames.end()) return; _current++; _index++; emit currentFrameChanged(); }
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(); }
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(); }