int SaveConverter_v3::isOldSave(Common::InSaveFile **save) const { uint32 varSize = SaveHandler::getVarSize(_vm); if (varSize == 0) return 0; uint32 saveSize = getActualSize(save); if (saveSize == 0) return 0; // The size of the old save always follows one of these rules if (saveSize == (varSize * 2 + kSlotNameLength + 1000)) return 1; // No screenshot if (saveSize == (varSize * 2 + kSlotNameLength + 1000 + 19968)) return 2; // Big screenshot, Goblins 3 if (saveSize == (varSize * 2 + kSlotNameLength + 1000 + 4768)) return 3; // Small screenshot, Lost in Time // Not an old save, clean up if (save) { delete *save; *save = 0; } return 0; }
ARender::ARender(ARenderPrivate *data, QObject *parent) : QObject(parent), d_ptr(data) { Q_D(ARender); d->time = 0; connect(lApp, &Local::aboutToQuit, this, &ARender::deleteLater); if (Config::getValue("/Interface/Version", true)){ d->tv.setFileName(":/Picture/tv.gif"); d->tv.setCacheMode(QMovie::CacheAll); d->tv.start(); d->me = QImage(":/Picture/version.png"); connect(APlayer::instance(), &APlayer::begin, &d->tv, &QMovie::stop); connect(APlayer::instance(), &APlayer::reach, &d->tv, &QMovie::start); connect(&d->tv, &QMovie::updated, [=](){ QImage cf = d->tv.currentImage(); QPoint ps = QRect(QPoint(0, 0), getActualSize()).center() - cf.rect().center(); ps.ry() -= 40; draw(QRect(ps, cf.size())); }); } QString path = Config::getValue("/Interface/Background", QString()); if (!path.isEmpty()){ d->background = QImage(path); } d->sound = QImage(":/Picture/sound.png"); d->music = 1; d->dirty = 0; d->videoAspectRatio = 0; d->pixelAspectRatio = 1; connect(APlayer::instance(), &APlayer::stateChanged, [d](){d->last = QTime(); }); }
void ARender::setDisplayTime(double t) { Q_D(ARender); d->time = t; QSize s = getActualSize(); draw(QRect(0, s.height() - 2, s.width()*d->time, 2)); }
int SaveConverter_Notes::isOldSave(Common::InSaveFile **save) const { if (_size == 0) return 0; uint32 saveSize = getActualSize(save); if (saveSize == 0) return 0; // The size of the old save always follows that rule if (saveSize == (_size * 2)) return 1; // Not an old save, clean up if (save) { delete *save; *save = 0; } return 0; }
int SaveConverter_v4::isOldSave(Common::InSaveFile **save) const { uint32 varSize = SaveHandler::getVarSize(_vm); if (varSize == 0) return 0; uint32 saveSize = getActualSize(save); if (saveSize == 0) return 0; // The size of the old save always follows that rule if (saveSize == (varSize * 2 + kSlotNameLength + 1000 + 512000)) return 1; // Not an old save, clean up if (save) { delete *save; *save = 0; } return 0; }
void RasterRender::draw(QRect rect) { Q_D(RasterRender); d->widget->update(rect.isValid() ? rect : QRect(QPoint(0, 0), getActualSize())); }
void OpenGLRender::draw(QRect rect) { Q_D(OpenGLRender); d->draw(rect.isValid() ? rect : QRect(QPoint(0, 0), getActualSize())); }