[Scummvm-cvs-logs] SF.net SVN: scummvm: [29582] scummvm/trunk/backends/platform/iphone/ osys_iphone.cpp
vinterstum at users.sourceforge.net
vinterstum at users.sourceforge.net
Tue Nov 20 20:42:42 CET 2007
Revision: 29582
http://scummvm.svn.sourceforge.net/scummvm/?rev=29582&view=rev
Author: vinterstum
Date: 2007-11-20 11:42:41 -0800 (Tue, 20 Nov 2007)
Log Message:
-----------
Cleaned up some formatting
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-20 19:15:11 UTC (rev 29581)
+++ scummvm/trunk/backends/platform/iphone/osys_iphone.cpp 2007-11-20 19:42:41 UTC (rev 29582)
@@ -148,9 +148,9 @@
_overlayBuffer = (OverlayColor *)malloc(fullSize);
clearOverlay();
- if (_fullscreen) {
+ if (_fullscreen)
free(_fullscreen);
- }
+
_fullscreen = (uint16 *)malloc(fullSize);
bzero(_fullscreen, fullSize);
@@ -161,6 +161,7 @@
_dirtyRects.push_back(Common::Rect(0, 0, width, height));
_mouseVisible = false;
+ updateScreen();
}
int16 OSystem_IPHONE::getHeight() {
@@ -216,9 +217,9 @@
_dirtyRects.push_back(Common::Rect(x, y, x + w + 1, y + h + 1));
byte *dst = _offscreen + y * _screenWidth + x;
- if (_screenWidth == pitch && pitch == w) {
+ if (_screenWidth == pitch && pitch == w)
memcpy(dst, buf, h * w);
- } else {
+ else {
do {
memcpy(dst, buf, w);
buf += pitch;
@@ -253,15 +254,13 @@
void OSystem_IPHONE::updateScreen() {
//printf("updateScreen(): %i dirty rects.\n", _dirtyRects.size());
- if (_dirtyRects.size() == 0) {
+ if (_dirtyRects.size() == 0)
return;
- }
- if (_landscapeMode) {
+ if (_landscapeMode)
internUpdateScreen<true>();
- } else {
- internUpdateScreen<false>();
- }
+ else
+ internUpdateScreen<false>();
iPhone_updateScreen();
}
@@ -408,13 +407,11 @@
y = 0;
}
- if (w > _screenWidth - x) {
+ if (w > _screenWidth - x)
w = _screenWidth - x;
- }
- if (h > _screenHeight - y) {
+ if (h > _screenHeight - y)
h = _screenHeight - y;
- }
if (w <= 0 || h <= 0)
return;
@@ -422,9 +419,9 @@
_dirtyRects.push_back(Common::Rect(x, y, x + w + 1, y + h + 1));
OverlayColor *dst = _overlayBuffer + (y * _screenWidth + x);
- if (_screenWidth == pitch && pitch == w) {
+ if (_screenWidth == pitch && pitch == w)
memcpy(dst, buf, h * w * sizeof(OverlayColor));
- } else {
+ else {
do {
memcpy(dst, buf, w * sizeof(OverlayColor));
buf += pitch;
@@ -471,9 +468,8 @@
_mouseBuf = NULL;
}
- if (_mouseBuf == NULL) {
+ if (_mouseBuf == NULL)
_mouseBuf = (byte *)malloc(w * h);
- }
_mouseWidth = w;
_mouseHeight = h;
@@ -484,7 +480,7 @@
_mouseKeyColour = keycolor;
memcpy(_mouseBuf, buf, w * h);
-
+
dirtyMouseCursor();
}
@@ -557,9 +553,8 @@
_queuedInputEvent.mouse.y = _mouseY;
_lastMouseTap = curTime;
_needEventRestPeriod = true;
- } else {
+ } else
return false;
- }
}
break;
@@ -611,12 +606,10 @@
} else if (vecXNorm < -0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe left
return false;
- } else {
+ } else
return false;
- }
- } else {
- return false;
- }
+ } else
+ return false;
} else {
event.type = Common::EVENT_MOUSEMOVE;
event.mouse.x = x;
@@ -652,20 +645,19 @@
_lastSecondaryTap = curTime;
_needEventRestPeriod = true;
}
- } else {
+ } else
return false;
- }
break;
case kInputOrientationChanged:
bool newModeIsLandscape = (int)xUnit != 1;
//printf("Orientation: %i", (int)xUnit);
if (_landscapeMode != newModeIsLandscape) {
_landscapeMode = newModeIsLandscape;
- if (_landscapeMode) {
+ if (_landscapeMode)
iPhone_initSurface(_screenHeight, _screenWidth, true);
- } else {
+ else
iPhone_initSurface(_screenWidth, _screenHeight, false);
- }
+
_dirtyRects.push_back(Common::Rect(0, 0, _screenWidth, _screenHeight));
}
break;
@@ -780,9 +772,8 @@
outQB->mAudioDataByteSize = 4 * s_AudioQueue.frameCount;
s_soundCallback(s_soundParam, (byte *)outQB->mAudioData, outQB->mAudioDataByteSize);
AudioQueueEnqueueBuffer(inQ, outQB, 0, NULL);
- } else {
+ } else
AudioQueueStop(s_AudioQueue.queue, false);
- }
}
bool OSystem_IPHONE::setSoundCallback(SoundProc proc, void *param) {
@@ -840,13 +831,11 @@
_timerCallbackTimer = interval;
_timerCallbackNext = getMillis() + interval;
_timerCallback = callback;
- } else {
+ } else
_timerCallback = NULL;
- }
}
void OSystem_IPHONE::quit() {
-
}
void OSystem_IPHONE::setWindowCaption(const char *caption) {
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