void Screen::slamRect(const Common::Rect &r) { if (r.width() && r.height() > 0) { Common::Rect srcRect = r, destRect = r; destRect.translate(-_currentScroll.x, -_currentScroll.y); if (destRect.left < 0) { srcRect.left += -destRect.left; destRect.left = 0; } if (destRect.top < 0) { srcRect.top += -destRect.top; destRect.top = 0; } if (destRect.right > SHERLOCK_SCREEN_WIDTH) { srcRect.right -= (destRect.left - SHERLOCK_SCREEN_WIDTH); destRect.right = SHERLOCK_SCREEN_WIDTH; } if (destRect.bottom > SHERLOCK_SCREEN_HEIGHT) { srcRect.bottom -= (destRect.bottom - SHERLOCK_SCREEN_HEIGHT); destRect.bottom = SHERLOCK_SCREEN_HEIGHT; } if (srcRect.isValidRect()) SHblitFrom(_backBuffer, Common::Point(destRect.left, destRect.top), srcRect); } }
void Screen::randomTransition() { Events &events = *_vm->_events; const int TRANSITION_MULTIPLIER = 0x15a4e35; clearDirtyRects(); assert(IS_SERRATED_SCALPEL); for (int idx = 0; idx <= 65535 && !_vm->shouldQuit(); ++idx) { _transitionSeed = _transitionSeed * TRANSITION_MULTIPLIER + 1; int offset = _transitionSeed & 0xFFFF; if (offset < (this->width() * this->height())) *((byte *)getPixels() + offset) = *((const byte *)_backBuffer.getPixels() + offset); if (idx != 0 && (idx % 300) == 0) { // Ensure there's a full screen dirty rect for the next frame update if (!isDirty()) addDirtyRect(Common::Rect(0, 0, this->w, this->h)); events.pollEvents(); events.delay(1); } } // Make sure everything has been transferred SHblitFrom(_backBuffer); }
void Screen::verticalTransition() { Events &events = *_vm->_events; byte table[640]; Common::fill(&table[0], &table[640], 0); for (int yp = 0; yp < this->height(); ++yp) { for (int xp = 0; xp < this->width(); ++xp) { int temp = (table[xp] >= (this->height() - 3)) ? this->height() - table[xp] : _vm->getRandomNumber(3) + 1; if (temp) { SHblitFrom(_backBuffer1, Common::Point(xp, table[xp]), Common::Rect(xp, table[xp], xp + 1, table[xp] + temp)); table[xp] += temp; } } events.delay(10); } }
void Scalpel3DOScreen::SHblitFrom(const Graphics::Surface &src, const Common::Point &destPos) { SHblitFrom(src, Common::Point(0, 0), Common::Rect(0, 0, src.w, src.h)); }
void Scalpel3DOScreen::SHblitFrom(const Graphics::Surface &src) { SHblitFrom(src, Common::Point(0, 0)); }