From 2ab5958c93c19a0ea23b76c2360ca8ef4d905b94 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 23 Feb 2012 21:20:24 +0100 Subject: IPHONE: Move screen and overlay texture buffer to VideoContext. --- backends/platform/iphone/osys_video.mm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'backends/platform/iphone/osys_video.mm') diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm index a40fcae78c..45f62377d4 100644 --- a/backends/platform/iphone/osys_video.mm +++ b/backends/platform/iphone/osys_video.mm @@ -228,11 +228,23 @@ void OSystem_IPHONE::drawDirtyRect(const Common::Rect &dirtyRect) { } void OSystem_IPHONE::drawDirtyOverlayRect(const Common::Rect &dirtyRect) { - iPhone_updateOverlayRect(_overlayBuffer, dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom, _videoContext->overlayWidth); + const int x1 = dirtyRect.left; + const int y1 = dirtyRect.top; + const int x2 = dirtyRect.right; + const int y2 = dirtyRect.bottom; + + for (int y = y1; y < y2; ++y) + memcpy(_videoContext->overlayTexture.getBasePtr(x1, y), &_overlayBuffer[y * _videoContext->overlayWidth + x1], (x2 - x1) * 2); } void OSystem_IPHONE::updateHardwareSurfaceForRect(const Common::Rect &updatedRect) { - iPhone_updateScreenRect(_gameScreenConverted, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom, _videoContext->screenWidth); + const int x1 = updatedRect.left; + const int y1 = updatedRect.top; + const int x2 = updatedRect.right; + const int y2 = updatedRect.bottom; + + for (int y = y1; y < y2; ++y) + memcpy(_videoContext->screenTexture.getBasePtr(x1, y), &_gameScreenConverted[y * _videoContext->screenWidth + x1], (x2 - x1) * 2); } Graphics::Surface *OSystem_IPHONE::lockScreen() { -- cgit v1.2.3