diff options
Diffstat (limited to 'engines/access/asurface.cpp')
-rw-r--r-- | engines/access/asurface.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index 1029c355da..526690807a 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -108,7 +108,7 @@ void ImageEntryList::addToList(ImageEntry &ie) { int ASurface::_clipWidth; int ASurface::_clipHeight; -ASurface::ASurface() { +ASurface::ASurface(): Graphics::Surface() { _leftSkip = _rightSkip = 0; _topSkip = _bottomSkip = 0; _lastBoundsX = _lastBoundsY = 0; @@ -116,6 +116,7 @@ ASurface::ASurface() { _orgX1 = _orgY1 = 0; _orgX2 = _orgY2 = 0; _lColor = 0; + _maxChars = 0; } ASurface::~ASurface() { @@ -192,7 +193,7 @@ void ASurface::plotImage(SpriteResource *sprite, int frameNum, const Common::Poi } } -void ASurface::transCopyFrom(ASurface *src, const Common::Point &destPos) { +void ASurface::transBlitFrom(ASurface *src, const Common::Point &destPos) { if (getPixels() == nullptr) create(w, h); @@ -207,7 +208,7 @@ void ASurface::transCopyFrom(ASurface *src, const Common::Point &destPos) { } } -void ASurface::transCopyFrom(ASurface *src, const Common::Rect &bounds) { +void ASurface::transBlitFrom(ASurface *src, const Common::Rect &bounds) { const int SCALE_LIMIT = 0x100; int scaleX = SCALE_LIMIT * bounds.width() / src->w; int scaleY = SCALE_LIMIT * bounds.height() / src->h; @@ -253,11 +254,12 @@ void ASurface::transCopyFrom(ASurface *src, const Common::Rect &bounds) { } } -void ASurface::transCopyFrom(ASurface &src) { - copyFrom(src); +void ASurface::transBlitFrom(ASurface &src) { + blitFrom(src); } -void ASurface::copyFrom(Graphics::Surface &src) { +void ASurface::blitFrom(Graphics::Surface &src) { + assert(w >= src.w && h >= src.h); for (int y = 0; y < src.h; ++y) { const byte *srcP = (const byte *)src.getBasePtr(0, y); byte *destP = (byte *)getBasePtr(0, y); @@ -266,7 +268,7 @@ void ASurface::copyFrom(Graphics::Surface &src) { } void ASurface::copyBuffer(Graphics::Surface *src) { - copyFrom(*src); + blitFrom(*src); } void ASurface::plotF(SpriteFrame *frame, const Common::Point &pt) { @@ -278,14 +280,14 @@ void ASurface::plotB(SpriteFrame *frame, const Common::Point &pt) { } void ASurface::sPlotF(SpriteFrame *frame, const Common::Rect &bounds) { - transCopyFrom(frame, bounds); + transBlitFrom(frame, bounds); } void ASurface::sPlotB(SpriteFrame *frame, const Common::Rect &bounds) { ASurface flippedFrame; frame->flipHorizontal(flippedFrame); - transCopyFrom(&flippedFrame, bounds); + transBlitFrom(&flippedFrame, bounds); } void ASurface::copyBlock(ASurface *src, const Common::Rect &bounds) { |