[Scummvm-cvs-logs] SF.net SVN: scummvm: [29620] scummvm/trunk/backends/platform/iphone/ osys_iphone.cpp
vinterstum at users.sourceforge.net
vinterstum at users.sourceforge.net
Fri Nov 23 20:46:03 CET 2007
Revision: 29620
http://scummvm.svn.sourceforge.net/scummvm/?rev=29620&view=rev
Author: vinterstum
Date: 2007-11-23 11:46:03 -0800 (Fri, 23 Nov 2007)
Log Message:
-----------
Cleaned up some screen drawing offsetting issues
Modified Paths:
--------------
scummvm/trunk/backends/platform/iphone/osys_iphone.cpp
Modified: scummvm/trunk/backends/platform/iphone/osys_iphone.cpp
===================================================================
--- scummvm/trunk/backends/platform/iphone/osys_iphone.cpp 2007-11-23 18:28:40 UTC (rev 29619)
+++ scummvm/trunk/backends/platform/iphone/osys_iphone.cpp 2007-11-23 19:46:03 UTC (rev 29620)
@@ -211,7 +211,7 @@
return;
if (!_fullScreenIsDirty) {
- _dirtyRects.push_back(Common::Rect(x, y, x + w + 1, y + h + 1));
+ _dirtyRects.push_back(Common::Rect(x, y, x + w, y + h));
}
@@ -279,7 +279,7 @@
//printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom);
int row;
if (_overlayVisible) {
- for (int x = dirtyRect.left; x < dirtyRect.right - 1; x++) {
+ for (int x = dirtyRect.left; x < dirtyRect.right; x++) {
if (landscapeMode) {
row = (_screenWidth - x - 1) * _screenHeight;
for (int y = dirtyRect.top; y < dirtyRect.bottom; y++)
@@ -290,7 +290,7 @@
}
}
} else {
- for (int x = dirtyRect.left; x < dirtyRect.right - 1; x++) {
+ for (int x = dirtyRect.left; x < dirtyRect.right; x++) {
if (landscapeMode) {
row = (_screenWidth - x - 1) * _screenHeight;
for (int y = dirtyRect.top; y < dirtyRect.bottom; y++)
@@ -305,12 +305,12 @@
//draw mouse on top
int mx, my;
if (_mouseVisible && dirtyRect.intersects(mouseRect)) {
- for (uint x = 0; x < _mouseWidth - 1; x++) {
+ for (uint x = 0; x < _mouseWidth; x++) {
mx = _mouseX + x - _mouseHotspotX;
row = (_screenWidth - mx - 1) * _screenHeight;
if (mx >= 0 && mx < _screenWidth) {
- for (uint y = 0; y < _mouseHeight; ++y) {
+ for (uint y = 0; y < _mouseHeight; y++) {
if (_mouseBuf[y * _mouseWidth + x] != _mouseKeyColour) {
my = _mouseY + y - _mouseHotspotY;
@@ -330,15 +330,18 @@
if (dirtyRect.right == _screenWidth && dirtyRect.bottom == _screenHeight)
memcpy(surface, _fullscreen, _screenWidth * _screenHeight * 2);
else {
- for (int x = dirtyRect.left; x < dirtyRect.right - 1; x++) {
- if (landscapeMode) {
+ if (landscapeMode) {
+ for (int x = dirtyRect.left; x < dirtyRect.right; x++) {
row = (_screenWidth - x - 1) * _screenHeight;
for (int y = dirtyRect.top; y < dirtyRect.bottom; y++)
surface[row + y] = _fullscreen[row + y];
- } else {
- for (int y = dirtyRect.top; y < dirtyRect.bottom; y++)
- surface[y * _screenWidth + x] = _fullscreen[y * _screenWidth + x];
}
+ } else {
+ int width = dirtyRect.right - dirtyRect.left;
+ for (int y = dirtyRect.top; y < dirtyRect.bottom; y++) {
+ int offset = y * _screenWidth;
+ memcpy(surface + offset, _fullscreen + offset, width);
+ }
}
}
}
@@ -421,7 +424,7 @@
return;
if (!_fullScreenIsDirty) {
- _dirtyRects.push_back(Common::Rect(x, y, x + w + 1, y + h + 1));
+ _dirtyRects.push_back(Common::Rect(x, y, x + w, y + h));
}
OverlayColor *dst = _overlayBuffer + (y * _screenWidth + x);
@@ -461,7 +464,7 @@
}
void OSystem_IPHONE::dirtyMouseCursor() {
- addDirtyRect(_mouseX - _mouseHotspotX, _mouseY - _mouseHotspotY, _mouseX + _mouseWidth - _mouseHotspotX + 1, _mouseY + _mouseHeight - _mouseHotspotY + 1);
+ addDirtyRect(_mouseX - _mouseHotspotX, _mouseY - _mouseHotspotY, _mouseX + _mouseWidth - _mouseHotspotX, _mouseY + _mouseHeight - _mouseHotspotY);
}
void OSystem_IPHONE::dirtyFullScreen() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list