diff options
| -rw-r--r-- | engines/zvision/render_manager.cpp | 14 | ||||
| -rw-r--r-- | engines/zvision/render_manager.h | 1 | 
2 files changed, 15 insertions, 0 deletions
| diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp index 04163fab61..38807a7457 100644 --- a/engines/zvision/render_manager.cpp +++ b/engines/zvision/render_manager.cpp @@ -311,6 +311,20 @@ void RenderManager::copyRectToWorkingWindow(const uint16 *buffer, int32 destX, i  		sourceOffset += imageWidth;  	} +void RenderManager::copyWorkingWindowSubRectToSurface(Graphics::Surface *destSurface, uint16 destX, uint16 destY, Common::Rect subRect) const { +	uint32 destOffset = 0; +	uint32 sourceOffset = 0; +	uint16 *workingWindowBufferPtr = (uint16 *)_workingWindowBuffer.getBasePtr(subRect.left, subRect.top); +	uint16 *destPtr = (uint16 *)destSurface->getBasePtr(destX, destY); + +	for (int32 y = 0; y < subRect.height(); y++) { +		for (int32 x = 0; x < subRect.width(); x++) { +			destPtr[destOffset + x] = workingWindowBufferPtr[sourceOffset + x]; +		} + +		destOffset += destSurface->w; +		sourceOffset += _workingWidth; +	}  	_workingWindowDirtyRect.extend(Common::Rect(destX, destY, destX + width, destY + height));  } diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h index 51636ef682..ce5c774917 100644 --- a/engines/zvision/render_manager.h +++ b/engines/zvision/render_manager.h @@ -194,6 +194,7 @@ public:  	RenderTable *getRenderTable();  	uint32 getCurrentBackgroundOffset();  	const Graphics::Surface *getBackBuffer() { return &_backBuffer; } +	void copyWorkingWindowSubRectToSurface(Graphics::Surface *destSurface, uint16 destX, uint16 destY, Common::Rect subRect) const;  	/**  	 * Creates a copy of surface and transposes the data. | 
