void GraphicsMan::update() { if (_fading) { // Set the start time uint32 time = _vm->_system->getMillis() - _fadeStartTime; // Scale the time int step = (time * 15 << 3) / 1000; if (step > 256) { step = 256; } // Apply the current fading applyFading(step); // Check for the end if (step == 256) { _fading = 0; // Clear the buffer when ending the fade out if (_fading == 2) _foreground.fillRect(Common::Rect(640, 320), 0); } } // Update the screen if needed and reset the status if (_changed) { _vm->_system->updateScreen(); _changed = false; } }
void RatingWidget::paintEvent(QPaintEvent*) { QPainter p(this); d->offset = (width() - RatingMax * (d->disPixmap.width()+1)) / 2; // Widget is disable : drawing grayed frame. if (!isEnabled()) { int x = d->offset; for (int i = 0; i < RatingMax; ++i) { p.drawPixmap(x, 0, d->disPixmap); x += d->disPixmap.width()+1; } } else { int x = d->offset; int rate = d->rating != NoRating ? d->rating : 0; QPixmap sel = d->selPixmap; applyFading(sel); for (int i = 0; i < rate; ++i) { p.drawPixmap(x, 0, sel); x += sel.width()+1; } QPixmap reg = d->regPixmap; applyFading(reg); for (int i = rate; i < RatingMax; ++i) { p.drawPixmap(x, 0, reg); x += reg.width()+1; } } p.end(); }
void GraphicsMan::fadeIn(byte *pal) { // Set the start time _fadeStartTime = _vm->_system->getMillis(); // Copy the target palette memcpy(_paletteFull, pal, 3 * 256); // Set the current fading _fading = 1; // Apply a black palette right now applyFading(0); }
void GraphicsMan::fadeIn(byte *pal) { // Set the start time _fadeStartTime = _vm->_system->getMillis(); // Copy the target palette for (int i = 0; i < 256; i++) { _paletteFull[(i * 4) + 0] = pal[(i * 3) + 0]; _paletteFull[(i * 4) + 1] = pal[(i * 3) + 1]; _paletteFull[(i * 4) + 2] = pal[(i * 3) + 2]; } // Set the current fading _fading = 1; // Apply a black palette right now applyFading(0); }