diff options
author | Max Horn | 2009-09-30 16:16:53 +0000 |
---|---|---|
committer | Max Horn | 2009-09-30 16:16:53 +0000 |
commit | 8ba75fc522f16844524dd4d6f88c3851e2402969 (patch) | |
tree | df25c20389e3e706d508f37914dedc73c6479f00 /backends | |
parent | 25dde91c7c6c7da52636e3daa34bd9eee5d9dcb9 (diff) | |
download | scummvm-rg350-8ba75fc522f16844524dd4d6f88c3851e2402969.tar.gz scummvm-rg350-8ba75fc522f16844524dd4d6f88c3851e2402969.tar.bz2 scummvm-rg350-8ba75fc522f16844524dd4d6f88c3851e2402969.zip |
Fix code formatting (esp. 'if(' -> 'if (' etc., but also indention and other things)
svn-id: r44495
Diffstat (limited to 'backends')
27 files changed, 419 insertions, 429 deletions
diff --git a/backends/fs/abstract-fs.cpp b/backends/fs/abstract-fs.cpp index aa341e70d9..f110e862b7 100644 --- a/backends/fs/abstract-fs.cpp +++ b/backends/fs/abstract-fs.cpp @@ -26,7 +26,7 @@ const char *AbstractFSNode::lastPathComponent(const Common::String &str, const char sep) { // TODO: Get rid of this eventually! Use Common::lastPathComponent instead - if(str.empty()) + if (str.empty()) return ""; const char *start = str.c_str(); diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index 183558409e..9eababe60b 100644 --- a/backends/fs/amigaos4/amigaos4-fs.cpp +++ b/backends/fs/amigaos4/amigaos4-fs.cpp @@ -179,8 +179,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) { const char c = _sPath.lastChar(); if (c != '/' && c != ':') _sPath += '/'; - } - else { + } else { //_bIsDirectory = false; _bIsValid = true; } @@ -231,15 +230,13 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayNam const char c = _sPath.lastChar(); if (c != '/' && c != ':') _sPath += '/'; - } - else { + } else { //_bIsDirectory = false; _bIsValid = true; } IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd); - } - else { + } else { debug(6, "ExamineObject() returned NULL"); } @@ -268,7 +265,7 @@ AmigaOSFilesystemNode::~AmigaOSFilesystemNode() { bool AmigaOSFilesystemNode::exists() const { ENTER(); - if(_sPath.empty()) + if (_sPath.empty()) return false; bool nodeExists = false; @@ -352,16 +349,16 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b struct ExamineData * pExd = NULL; // NB: no need to free value after usage, all is dealt by the DirContext release AmigaOSFilesystemNode *entry ; - while( (pExd = IDOS->ExamineDir(context)) ) { - if( (EXD_IS_FILE(pExd) && ( Common::FSNode::kListFilesOnly == mode )) + while ( (pExd = IDOS->ExamineDir(context)) ) { + if ( (EXD_IS_FILE(pExd) && ( Common::FSNode::kListFilesOnly == mode )) || (EXD_IS_DIRECTORY(pExd) && ( Common::FSNode::kListDirectoriesOnly == mode )) || Common::FSNode::kListAll == mode ) { BPTR pLock = IDOS->Lock( pExd->Name, SHARED_LOCK ); - if( pLock ) { + if (pLock) { entry = new AmigaOSFilesystemNode( pLock, pExd->Name ); - if( entry ) { + if (entry) { myList.push_back(entry); } @@ -369,18 +366,17 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b } } } - if( ERROR_NO_MORE_ENTRIES != IDOS->IoErr() ) { + + if (ERROR_NO_MORE_ENTRIES != IDOS->IoErr() ) { debug(6, "An error occured during ExamineDir"); ret = false; - } - else { + } else { ret = true; } IDOS->ReleaseDirContext(context); - } - else { + } else { debug(6, "Unable to ObtainDirContext"); ret = false; } @@ -411,8 +407,7 @@ AbstractFSNode *AmigaOSFilesystemNode::getParent() const { if (parentDir) { node = new AmigaOSFilesystemNode(parentDir); IDOS->UnLock(parentDir); - } - else + } else node = new AmigaOSFilesystemNode(); LEAVE(); diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp index 0c53020d94..75a91e5802 100644 --- a/backends/fs/psp/psp-fs.cpp +++ b/backends/fs/psp/psp-fs.cpp @@ -96,7 +96,7 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p, bool verify) { if (verify) { struct stat st; - if(PowerMan.beginCriticalSection()==PowerManager::Blocked) + if (PowerMan.beginCriticalSection()==PowerManager::Blocked) PSPDebugSuspend("Suspended in PSPFilesystemNode::PSPFilesystemNode\n"); _isValid = (0 == stat(_path.c_str(), &st)); PowerMan.endCriticalSection(); diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp index 2fa5d7b142..5d4951e269 100644 --- a/backends/fs/symbian/symbian-fs.cpp +++ b/backends/fs/symbian/symbian-fs.cpp @@ -66,9 +66,9 @@ public: TPtrC8 ptr((const unsigned char*) _path.c_str(), _path.size()); fname.Copy(ptr); TBool fileExists = BaflUtils::FileExists(static_cast<OSystem_SDL_Symbian*> (g_system)->FsSession(), fname); - if(!fileExists) { + if (!fileExists) { TParsePtrC parser(fname); - if(parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { + if (parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { fileExists = ETrue; } } @@ -137,7 +137,7 @@ SymbianFilesystemNode::SymbianFilesystemNode(const Common::String &path) { _isValid = ETrue; _isDirectory = EFalse; TParsePtrC parser(fname); - if(parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { + if (parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { _isDirectory = ETrue; } } diff --git a/backends/fs/symbian/symbianstream.cpp b/backends/fs/symbian/symbianstream.cpp index 650bbd0dcd..c926cc65f8 100644 --- a/backends/fs/symbian/symbianstream.cpp +++ b/backends/fs/symbian/symbianstream.cpp @@ -71,7 +71,7 @@ TSymbianFileEntry* CreateSymbianFileEntry(const char* name, const char* mode) { fileMode = fileMode| EFileShareAny; - switch(mode[0]) { + switch (mode[0]) { case 'a': if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { if (fileEntry->_fileHandle.Create(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { @@ -160,7 +160,7 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry } } - if((numItems * size) != pointer.Length() && entry->_lastError == KErrNone) { + if ((numItems * size) != pointer.Length() && entry->_lastError == KErrNone) { entry->_eofReached = ETrue; } diff --git a/backends/platform/PalmOS/Src/base_event.cpp b/backends/platform/PalmOS/Src/base_event.cpp index 81eeb4e79c..ae93514e34 100644 --- a/backends/platform/PalmOS/Src/base_event.cpp +++ b/backends/platform/PalmOS/Src/base_event.cpp @@ -324,7 +324,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { if (SysHandleEvent(&ev)) continue; - switch(ev.eType) { + switch (ev.eType) { case penMoveEvent: get_coordinates(&ev, x, y); diff --git a/backends/platform/PalmOS/Src/base_gfx.cpp b/backends/platform/PalmOS/Src/base_gfx.cpp index 73a98909d6..2d2904bdec 100644 --- a/backends/platform/PalmOS/Src/base_gfx.cpp +++ b/backends/platform/PalmOS/Src/base_gfx.cpp @@ -53,7 +53,7 @@ int OSystem_PalmBase::getGraphicsMode() const { } bool OSystem_PalmBase::setGraphicsMode(int mode) { - switch(mode) { + switch (mode) { case GFX_NORMAL: case GFX_WIDE: _setMode = mode; diff --git a/backends/platform/gp2x/events.cpp b/backends/platform/gp2x/events.cpp index bc9a4ff26c..e0117e9313 100644 --- a/backends/platform/gp2x/events.cpp +++ b/backends/platform/gp2x/events.cpp @@ -282,7 +282,7 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { while (SDL_PollEvent(&ev)) { - switch(ev.type) { + switch (ev.type) { case SDL_KEYDOWN:{ b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState()); diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp index cf874323e0..27732007bc 100644 --- a/backends/platform/gp2x/graphics.cpp +++ b/backends/platform/gp2x/graphics.cpp @@ -179,7 +179,7 @@ bool OSystem_GP2X::setGraphicsMode(int mode) { int newScaleFactor = 1; - switch(mode) { + switch (mode) { case GFX_NORMAL: newScaleFactor = 1; break; diff --git a/backends/platform/gp2xwiz/gp2xwiz-events.cpp b/backends/platform/gp2xwiz/gp2xwiz-events.cpp index 48c9af00ff..2774efce1b 100644 --- a/backends/platform/gp2xwiz/gp2xwiz-events.cpp +++ b/backends/platform/gp2xwiz/gp2xwiz-events.cpp @@ -81,13 +81,13 @@ static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) { } void OSystem_GP2XWIZ::fillMouseEvent(Common::Event &event, int x, int y) { - if(_videoMode.mode == GFX_HALF && !_overlayVisible){ - event.mouse.x = x*2; - event.mouse.y = y*2; - } else { - event.mouse.x = x; - event.mouse.y = y; - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible){ + event.mouse.x = x*2; + event.mouse.y = y*2; + } else { + event.mouse.x = x; + event.mouse.y = y; + } // Update the "keyboard mouse" coords _km.x = x; @@ -216,7 +216,7 @@ bool OSystem_GP2XWIZ::pollEvent(Common::Event &event) { while (SDL_PollEvent(&ev)) { - switch(ev.type) { + switch (ev.type) { case SDL_KEYDOWN:{ b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState()); diff --git a/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp b/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp index 90f2c821aa..ad4b0fc6ef 100644 --- a/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp +++ b/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp @@ -58,13 +58,13 @@ bool OSystem_GP2XWIZ::setGraphicsMode(int mode) { int newScaleFactor = 1; - switch(mode) { + switch (mode) { case GFX_NORMAL: newScaleFactor = 1; break; - case GFX_HALF: - newScaleFactor = 1; - break; + case GFX_HALF: + newScaleFactor = 1; + break; default: warning("unknown gfx mode %d", mode); return false; @@ -90,9 +90,9 @@ void OSystem_GP2XWIZ::setGraphicsModeIntern() { case GFX_NORMAL: newScalerProc = Normal1x; break; - case GFX_HALF: - newScalerProc = HalfScale; - break; + case GFX_HALF: + newScalerProc = HalfScale; + break; default: error("Unknown gfx mode %d", _videoMode.mode); @@ -113,19 +113,19 @@ void OSystem_GP2XWIZ::setGraphicsModeIntern() { void OSystem_GP2XWIZ::initSize(uint w, uint h) { - assert(_transactionMode == kTransactionActive); + assert(_transactionMode == kTransactionActive); // Avoid redundant res changes if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) return; - _videoMode.screenWidth = w; + _videoMode.screenWidth = w; _videoMode.screenHeight = h; - if(w > 320 || h > 240){ - setGraphicsMode(GFX_HALF); - setGraphicsModeIntern(); - toggleMouseGrab(); - } + if (w > 320 || h > 240){ + setGraphicsMode(GFX_HALF); + setGraphicsModeIntern(); + toggleMouseGrab(); + } _cksumNum = (w * h / (8 * 8)); @@ -157,13 +157,13 @@ void OSystem_GP2XWIZ::drawMouse() { int width, height; int hotX, hotY; - if(_videoMode.mode == GFX_HALF && !_overlayVisible){ - dst.x = _mouseCurState.x/2; - dst.y = _mouseCurState.y/2; - } else { - dst.x = _mouseCurState.x; - dst.y = _mouseCurState.y; - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible){ + dst.x = _mouseCurState.x/2; + dst.y = _mouseCurState.y/2; + } else { + dst.x = _mouseCurState.x; + dst.y = _mouseCurState.y; + } if (!_overlayVisible) { scale = _videoMode.scaleFactor; @@ -214,7 +214,7 @@ void OSystem_GP2XWIZ::drawMouse() { // The screen will be updated using real surface coordinates, i.e. // they will not be scaled or aspect-ratio corrected. - addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); + addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); } void OSystem_GP2XWIZ::undrawMouse() { @@ -227,12 +227,12 @@ void OSystem_GP2XWIZ::undrawMouse() { return; if (_mouseBackup.w != 0 && _mouseBackup.h != 0){ - if(_videoMode.mode == GFX_HALF && !_overlayVisible){ - addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2); - } else { - addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); - } - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible){ + addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2); + } else { + addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); + } + } } void OSystem_GP2XWIZ::internUpdateScreen() { @@ -348,11 +348,11 @@ void OSystem_GP2XWIZ::internUpdateScreen() { for (r = _dirtyRectList; r != lastRect; ++r) { register int dst_y = r->y + _currentShakePos; register int dst_h = 0; - register int dst_w = r->w; + register int dst_w = r->w; register int orig_dst_y = 0; register int dst_x = r->x; - register int src_y; - register int src_x; + register int src_y; + register int src_x; if (dst_y < height) { dst_h = r->h; @@ -360,42 +360,42 @@ void OSystem_GP2XWIZ::internUpdateScreen() { dst_h = height - dst_y; orig_dst_y = dst_y; - src_x = dst_x; - src_y = dst_y; + src_x = dst_x; + src_y = dst_y; if (_videoMode.aspectRatioCorrection && !_overlayVisible) dst_y = real2Aspect(dst_y); assert(scalerProc != NULL); - if(_videoMode.mode == GFX_HALF && scalerProc == HalfScale){ - if(dst_x%2==1){ - dst_x--; - dst_w++; - } - if(dst_y%2==1){ - dst_y--; - dst_h++; - } - src_x = dst_x; - src_y = dst_y; - dst_x = dst_x / 2; - dst_y = dst_y / 2; - } - scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch, + if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale){ + if (dst_x%2==1){ + dst_x--; + dst_w++; + } + if (dst_y%2==1){ + dst_y--; + dst_h++; + } + src_x = dst_x; + src_y = dst_y; + dst_x = dst_x / 2; + dst_y = dst_y / 2; + } + scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch, (byte *)_hwscreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h); } - if(_videoMode.mode == GFX_HALF && scalerProc == HalfScale){ - r->w = r->w / 2; - r->h = dst_h / 2; - } else { - r->w = r->w; - r->h = dst_h; - } + if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale){ + r->w = r->w / 2; + r->h = dst_h / 2; + } else { + r->w = r->w; + r->h = dst_h; + } - r->x = dst_x; - r->y = dst_y; + r->x = dst_x; + r->y = dst_y; #ifndef DISABLE_SCALERS @@ -430,27 +430,27 @@ void OSystem_GP2XWIZ::internUpdateScreen() { } void OSystem_GP2XWIZ::showOverlay() { - if(_videoMode.mode == GFX_HALF){ - _mouseCurState.x = _mouseCurState.x / 2; - _mouseCurState.y = _mouseCurState.y / 2; - } + if (_videoMode.mode == GFX_HALF){ + _mouseCurState.x = _mouseCurState.x / 2; + _mouseCurState.y = _mouseCurState.y / 2; + } OSystem_SDL::showOverlay(); } void OSystem_GP2XWIZ::hideOverlay() { - if(_videoMode.mode == GFX_HALF){ - _mouseCurState.x = _mouseCurState.x * 2; - _mouseCurState.y = _mouseCurState.y * 2; - } + if (_videoMode.mode == GFX_HALF){ + _mouseCurState.x = _mouseCurState.x * 2; + _mouseCurState.y = _mouseCurState.y * 2; + } OSystem_SDL::hideOverlay(); } void OSystem_GP2XWIZ::warpMouse(int x, int y) { if (_mouseCurState.x != x || _mouseCurState.y != y) { - if(_videoMode.mode == GFX_HALF && !_overlayVisible){ - x = x / 2; - y = y / 2; - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible){ + x = x / 2; + y = y / 2; + } } OSystem_SDL::warpMouse(x, y); } diff --git a/backends/platform/gp2xwiz/gp2xwiz-hw.cpp b/backends/platform/gp2xwiz/gp2xwiz-hw.cpp index 4a86443aa7..bc1aa00ce4 100644 --- a/backends/platform/gp2xwiz/gp2xwiz-hw.cpp +++ b/backends/platform/gp2xwiz/gp2xwiz-hw.cpp @@ -65,8 +65,8 @@ void mixerMoveVolume(int direction) { if (direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE/2; if (direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE/2; } else { - if(direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE; - if(direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE; + if (direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE; + if (direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE; } if (volumeLevel < VOLUME_MIN) volumeLevel = VOLUME_MIN; @@ -74,7 +74,7 @@ void mixerMoveVolume(int direction) { unsigned long soundDev = open("/dev/mixer", O_RDWR); - if(soundDev) { + if (soundDev) { int vol = ((volumeLevel << 8) | volumeLevel); ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol); close(soundDev); diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index ef55a655c0..33585bdacb 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -352,7 +352,7 @@ uint getSizeNextPOT(uint size) { - (void)addEvent:(NSDictionary*)event { - if(_events == nil) + if (_events == nil) _events = [[NSMutableArray alloc] init]; [_events addObject: event]; diff --git a/backends/platform/linuxmoto/linuxmoto-events.cpp b/backends/platform/linuxmoto/linuxmoto-events.cpp index aa71fe8be3..50daa12d5b 100644 --- a/backends/platform/linuxmoto/linuxmoto-events.cpp +++ b/backends/platform/linuxmoto/linuxmoto-events.cpp @@ -44,13 +44,13 @@ static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) { } void OSystem_LINUXMOTO::fillMouseEvent(Common::Event &event, int x, int y) { - if(_videoMode.mode == GFX_HALF && !_overlayVisible) { - event.mouse.x = x*2; - event.mouse.y = y*2; - } else { - event.mouse.x = x; - event.mouse.y = y; - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible) { + event.mouse.x = x*2; + event.mouse.y = y*2; + } else { + event.mouse.x = x; + event.mouse.y = y; + } // Update the "keyboard mouse" coords _km.x = x; @@ -82,7 +82,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) { ev.key.keysym.sym = SDLK_F5; } // VirtualKeyboard - Camera key - else if (ev.key.keysym.sym == SDLK_PAUSE) { + else if (ev.key.keysym.sym == SDLK_PAUSE) { ev.key.keysym.sym = SDLK_F7; } // Enter - mod+fire key diff --git a/backends/platform/linuxmoto/linuxmoto-graphics.cpp b/backends/platform/linuxmoto/linuxmoto-graphics.cpp index e74cb8dbf3..592d991a7f 100644 --- a/backends/platform/linuxmoto/linuxmoto-graphics.cpp +++ b/backends/platform/linuxmoto/linuxmoto-graphics.cpp @@ -58,13 +58,13 @@ bool OSystem_LINUXMOTO::setGraphicsMode(int mode) { int newScaleFactor = 1; - switch(mode) { + switch (mode) { case GFX_NORMAL: - newScaleFactor = 1; - break; + newScaleFactor = 1; + break; case GFX_HALF: - newScaleFactor = 1; - break; + newScaleFactor = 1; + break; default: warning("unknown gfx mode %d", mode); return false; @@ -113,20 +113,20 @@ void OSystem_LINUXMOTO::setGraphicsModeIntern() { void OSystem_LINUXMOTO::initSize(uint w, uint h) { - assert(_transactionMode == kTransactionActive); + assert(_transactionMode == kTransactionActive); // Avoid redundant res changes if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) return; - _videoMode.screenWidth = w; - _videoMode.screenHeight = h; + _videoMode.screenWidth = w; + _videoMode.screenHeight = h; - if (w > 320 || h > 240) { - setGraphicsMode(GFX_HALF); - setGraphicsModeIntern(); - toggleMouseGrab(); - } + if (w > 320 || h > 240) { + setGraphicsMode(GFX_HALF); + setGraphicsModeIntern(); + toggleMouseGrab(); + } _cksumNum = (w * h / (8 * 8)); @@ -137,30 +137,30 @@ void OSystem_LINUXMOTO::initSize(uint w, uint h) { } bool OSystem_LINUXMOTO::loadGFXMode() { - printf("Game ScreenMode = %d*%d\n",_videoMode.screenWidth, _videoMode.screenHeight); - if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) { - _videoMode.aspectRatioCorrection = false; - setGraphicsMode(GFX_HALF); - printf("GraphicsMode set to HALF\n"); + printf("Game ScreenMode = %d*%d\n",_videoMode.screenWidth, _videoMode.screenHeight); + if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) { + _videoMode.aspectRatioCorrection = false; + setGraphicsMode(GFX_HALF); + printf("GraphicsMode set to HALF\n"); + } else { + setGraphicsMode(GFX_NORMAL); + printf("GraphicsMode set to NORMAL\n"); + } + if (_videoMode.mode == GFX_HALF && !_overlayVisible) { + _videoMode.overlayWidth = 320; + _videoMode.overlayHeight = 240; + _videoMode.fullscreen = true; } else { - setGraphicsMode(GFX_NORMAL); - printf("GraphicsMode set to NORMAL\n"); - } - if (_videoMode.mode == GFX_HALF && !_overlayVisible) { - _videoMode.overlayWidth = 320; - _videoMode.overlayHeight = 240; - _videoMode.fullscreen = true; - } else { - _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; - _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; + _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); + if (_videoMode.aspectRatioCorrection) + _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); - _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; - _videoMode.hardwareHeight = effectiveScreenHeight(); - } + _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.hardwareHeight = effectiveScreenHeight(); + } return OSystem_SDL::loadGFXMode(); } @@ -176,13 +176,13 @@ void OSystem_LINUXMOTO::drawMouse() { int width, height; int hotX, hotY; - if (_videoMode.mode == GFX_HALF && !_overlayVisible) { - dst.x = _mouseCurState.x/2; - dst.y = _mouseCurState.y/2; - } else { - dst.x = _mouseCurState.x; - dst.y = _mouseCurState.y; - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible) { + dst.x = _mouseCurState.x/2; + dst.y = _mouseCurState.y/2; + } else { + dst.x = _mouseCurState.x; + dst.y = _mouseCurState.y; + } if (!_overlayVisible) { scale = _videoMode.scaleFactor; @@ -192,7 +192,6 @@ void OSystem_LINUXMOTO::drawMouse() { dst.h = _mouseCurState.vH; hotX = _mouseCurState.vHotX; hotY = _mouseCurState.vHotY; - } else { scale = 1; width = _videoMode.overlayWidth; @@ -201,7 +200,6 @@ void OSystem_LINUXMOTO::drawMouse() { dst.h = _mouseCurState.rH; hotX = _mouseCurState.rHotX; hotY = _mouseCurState.rHotY; - } // The mouse is undrawn using virtual coordinates, i.e. they may be @@ -235,7 +233,7 @@ void OSystem_LINUXMOTO::drawMouse() { // The screen will be updated using real surface coordinates, i.e. // they will not be scaled or aspect-ratio corrected. - addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); + addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); } void OSystem_LINUXMOTO::undrawMouse() { @@ -247,13 +245,13 @@ void OSystem_LINUXMOTO::undrawMouse() { if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) return; - if (_mouseBackup.w != 0 && _mouseBackup.h != 0){ - if (_videoMode.mode == GFX_HALF && !_overlayVisible) { - addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2); - } else { - addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); - } - } + if (_mouseBackup.w != 0 && _mouseBackup.h != 0) { + if (_videoMode.mode == GFX_HALF && !_overlayVisible) { + addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2); + } else { + addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); + } + } } void OSystem_LINUXMOTO::internUpdateScreen() { @@ -388,43 +386,41 @@ void OSystem_LINUXMOTO::internUpdateScreen() { assert(scalerProc != NULL); - if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale) { - - if (dst_x%2==1) { - dst_x--; - dst_w++; - } - if (dst_y%2==1) { - dst_y--; - dst_h++; - } - - if (dst_w&1) - dst_w++; - if (dst_h&1) - dst_h++; - - src_x = dst_x; - src_y = dst_y; - dst_x = dst_x / 2; - dst_y = dst_y / 2; - } - scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch, + if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale) { + + if (dst_x%2==1) { + dst_x--; + dst_w++; + } + if (dst_y%2==1) { + dst_y--; + dst_h++; + } + + if (dst_w&1) + dst_w++; + if (dst_h&1) + dst_h++; + + src_x = dst_x; + src_y = dst_y; + dst_x = dst_x / 2; + dst_y = dst_y / 2; + } + scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch, (byte *)_hwscreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h); } - if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale) { - - r->w = r->w / 2; - r->h = dst_h / 2; - } else { - r->w = r->w; - r->h = dst_h; - } - - r->x = dst_x; - r->y = dst_y; + if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale) { + r->w = r->w / 2; + r->h = dst_h / 2; + } else { + r->w = r->w; + r->h = dst_h; + } + r->x = dst_x; + r->y = dst_y; #ifndef DISABLE_SCALERS if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible) @@ -458,27 +454,27 @@ void OSystem_LINUXMOTO::internUpdateScreen() { } void OSystem_LINUXMOTO::showOverlay() { - if (_videoMode.mode == GFX_HALF) { - _mouseCurState.x = _mouseCurState.x / 2; - _mouseCurState.y = _mouseCurState.y / 2; - } + if (_videoMode.mode == GFX_HALF) { + _mouseCurState.x = _mouseCurState.x / 2; + _mouseCurState.y = _mouseCurState.y / 2; + } OSystem_SDL::showOverlay(); } void OSystem_LINUXMOTO::hideOverlay() { - if (_videoMode.mode == GFX_HALF) { - _mouseCurState.x = _mouseCurState.x * 2; - _mouseCurState.y = _mouseCurState.y * 2; - } + if (_videoMode.mode == GFX_HALF) { + _mouseCurState.x = _mouseCurState.x * 2; + _mouseCurState.y = _mouseCurState.y * 2; + } OSystem_SDL::hideOverlay(); } void OSystem_LINUXMOTO::warpMouse(int x, int y) { if (_mouseCurState.x != x || _mouseCurState.y != y) { - if (_videoMode.mode == GFX_HALF && !_overlayVisible) { - x = x / 2; - y = y / 2; - } + if (_videoMode.mode == GFX_HALF && !_overlayVisible) { + x = x / 2; + y = y / 2; + } } OSystem_SDL::warpMouse(x, y); } diff --git a/backends/platform/linuxmoto/linuxmoto-scaler.h b/backends/platform/linuxmoto/linuxmoto-scaler.h index e8064f40f9..03d4bec82f 100644 --- a/backends/platform/linuxmoto/linuxmoto-scaler.h +++ b/backends/platform/linuxmoto/linuxmoto-scaler.h @@ -33,7 +33,7 @@ // FIXME: For now keep hacks in this header to save polluting the SDL backend. enum { - GFX_HALF = 12 + GFX_HALF = 12 }; // TODO/FIXME: Move this platform specific scaler into /graphics/scaler and properly merge with the WinCE PocketPCHalf that it is based on. diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp index 1613863530..192e3a4b7e 100644 --- a/backends/platform/ps2/savefilemgr.cpp +++ b/backends/platform/ps2/savefilemgr.cpp @@ -125,7 +125,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil Common::FSNode file(path); - if(!file.exists()) + if (!file.exists()) return NULL; sf = file.createReadStream(); @@ -133,7 +133,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil } else { Common::FSNode file = savePath.getChild(filename); - if(!file.exists()) + if (!file.exists()) return NULL; sf = file.createReadStream(); diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 16f35f971f..960f135499 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -617,19 +617,19 @@ void OSystem_PSP::updateScreen() { sceGuDisable(GU_ALPHA_TEST); sceGuEnable(GU_BLEND); sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); - switch(_keyboardMode) { - case 0: - sceGuTexImage(0, 512, 512, 480, keyboard_letters); - break; - case CAPS_LOCK: - sceGuTexImage(0, 512, 512, 480, keyboard_letters_shift); - break; - case SYMBOLS: - sceGuTexImage(0, 512, 512, 480, keyboard_symbols); - break; - case (CAPS_LOCK | SYMBOLS): - sceGuTexImage(0, 512, 512, 480, keyboard_symbols_shift); - break; + switch (_keyboardMode) { + case 0: + sceGuTexImage(0, 512, 512, 480, keyboard_letters); + break; + case CAPS_LOCK: + sceGuTexImage(0, 512, 512, 480, keyboard_letters_shift); + break; + case SYMBOLS: + sceGuTexImage(0, 512, 512, 480, keyboard_symbols); + break; + case (CAPS_LOCK | SYMBOLS): + sceGuTexImage(0, 512, 512, 480, keyboard_symbols_shift); + break; } sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); @@ -1006,50 +1006,50 @@ bool OSystem_PSP::pollEvent(Common::Event &event) { event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP; if (_keySelected > 26) { event.kbd.flags = 0; - switch(_keySelected) { - case 27: - event.kbd.ascii = ' '; - event.kbd.keycode = Common::KEYCODE_SPACE; - break; - case 28: - event.kbd.ascii = 127; - event.kbd.keycode = Common::KEYCODE_DELETE; + switch (_keySelected) { + case 27: + event.kbd.ascii = ' '; + event.kbd.keycode = Common::KEYCODE_SPACE; + break; + case 28: + event.kbd.ascii = 127; + event.kbd.keycode = Common::KEYCODE_DELETE; + break; + case 29: + event.kbd.ascii = 8; + event.kbd.keycode = Common::KEYCODE_BACKSPACE; + break; + case 30: + event.kbd.ascii = 13; + event.kbd.keycode = Common::KEYCODE_RETURN; + break; + } + } else { + switch ( _keyboardMode) { + case 0: + event.kbd.flags = 0; + event.kbd.ascii = 'a'+_keySelected-1; + event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1); break; - case 29: - event.kbd.ascii = 8; - event.kbd.keycode = Common::KEYCODE_BACKSPACE; + case CAPS_LOCK: + event.kbd.ascii = 'A'+_keySelected-1; + event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1); + event.kbd.flags = Common::KBD_SHIFT; break; - case 30: - event.kbd.ascii = 13; - event.kbd.keycode = Common::KEYCODE_RETURN; + case SYMBOLS: + if (_keySelected < 21) { + event.kbd.flags = 0; + event.kbd.ascii = kbd_ascii[_keySelected-1]; + event.kbd.keycode = kbd_code[ _keySelected-1]; + } break; - } - } else { - switch( _keyboardMode) { - case 0: + case (SYMBOLS|CAPS_LOCK): + if (_keySelected < 21) { event.kbd.flags = 0; - event.kbd.ascii = 'a'+_keySelected-1; - event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1); - break; - case CAPS_LOCK: - event.kbd.ascii = 'A'+_keySelected-1; - event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1); - event.kbd.flags = Common::KBD_SHIFT; - break; - case SYMBOLS: - if (_keySelected < 21) { - event.kbd.flags = 0; - event.kbd.ascii = kbd_ascii[_keySelected-1]; - event.kbd.keycode = kbd_code[ _keySelected-1]; - } - break; - case (SYMBOLS|CAPS_LOCK): - if (_keySelected < 21) { - event.kbd.flags = 0; - event.kbd.ascii = kbd_ascii_cl[_keySelected-1]; - event.kbd.keycode = kbd_code_cl[ _keySelected-1]; - } - break; + event.kbd.ascii = kbd_ascii_cl[_keySelected-1]; + event.kbd.keycode = kbd_code_cl[ _keySelected-1]; + } + break; } } _prevButtons = pad.Buttons; diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp index 74363e4ac9..1f33e0add0 100644 --- a/backends/platform/psp/psp_main.cpp +++ b/backends/platform/psp/psp_main.cpp @@ -23,7 +23,6 @@ * */ - #define USERSPACE_ONLY //don't use kernel mode features #ifndef USERSPACE_ONLY @@ -118,7 +117,7 @@ int CallbackThread(SceSize /*size*/, void *arg) { cbid = sceKernelCreateCallback("Power Callback", (SceKernelCallbackFunction)power_callback, 0); if (cbid >= 0) { - if(scePowerRegisterCallback(-1, cbid) < 0) { + if (scePowerRegisterCallback(-1, cbid) < 0) { PSPDebugTrace("SetupCallbacks(): Couldn't register callback for power_callback\n"); } } else { diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index ed881952b7..ff09e5bc8f 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -301,7 +301,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { int newScaleFactor = 1; - switch(mode) { + switch (mode) { case GFX_NORMAL: newScaleFactor = 1; break; diff --git a/backends/platform/symbian/src/ScummVMApp.cpp b/backends/platform/symbian/src/ScummVMApp.cpp index 741f93cfd1..e031244135 100644 --- a/backends/platform/symbian/src/ScummVMApp.cpp +++ b/backends/platform/symbian/src/ScummVMApp.cpp @@ -151,7 +151,7 @@ void CScummVMUi::BringUpEmulatorL() { } void CScummVMUi::HandleCommandL(TInt aCommand) { - switch(aCommand) { + switch (aCommand) { case EEikCmdExit: { RThread thread; diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 7af1cade8c..fcdc22db51 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -84,35 +84,35 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { }; bool OSystem_SDL_Symbian::hasFeature(Feature f) { - switch(f) { - case kFeatureFullscreenMode: - case kFeatureAspectRatioCorrection: - case kFeatureAutoComputeDirtyRects: - case kFeatureCursorHasPalette: + switch (f) { + case kFeatureFullscreenMode: + case kFeatureAspectRatioCorrection: + case kFeatureAutoComputeDirtyRects: + case kFeatureCursorHasPalette: #ifdef USE_VIBRA_SE_PXXX - case kFeatureVibration: + case kFeatureVibration: #endif - return true; + return true; - default: - return false; + default: + return false; } } void OSystem_SDL_Symbian::setFeatureState(Feature f, bool enable) { - switch(f) { - case kFeatureVirtualKeyboard: - if (enable) { - } - else { + switch (f) { + case kFeatureVirtualKeyboard: + if (enable) { + } + else { - } - break; - case kFeatureDisableKeyFiltering: - GUI::Actions::Instance()->beginMapping(enable); - break; - default: - OSystem_SDL::setFeatureState(f, enable); + } + break; + case kFeatureDisableKeyFiltering: + GUI::Actions::Instance()->beginMapping(enable); + break; + default: + OSystem_SDL::setFeatureState(f, enable); } } @@ -326,7 +326,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev, Common::Event &event) { if (GUI::Actions::Instance()->getMapping(loop) == ev.key.keysym.sym && GUI::Actions::Instance()->isEnabled(loop)) { // Create proper event instead - switch(loop) { + switch (loop) { case GUI::ACTION_UP: if (ev.type == SDL_KEYDOWN) { _km.y_vel = -1; diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index fdb32de362..13ad3267bf 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -258,7 +258,7 @@ void OSystem_Wii::initSize(uint width, uint height, } if (update) { - if(_gamePixels) + if (_gamePixels) free(_gamePixels); tex_format = GFX_TF_PALETTE_RGB565; diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 45dbad12cc..ebe6981290 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -232,7 +232,7 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { static bool keydialogrunning = false, quitdialog = false; if (!pushed) { - switch(action) { + switch (action) { case POCKET_ACTION_RIGHTCLICK: _CESystem->add_right_click(false); return true; @@ -251,78 +251,78 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { } switch (action) { - case POCKET_ACTION_PAUSE: - case POCKET_ACTION_SAVE: - case POCKET_ACTION_SKIP: - case POCKET_ACTION_MULTI: - if (action == POCKET_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { - // FIXME: This is a temporary solution. The engine should handle its own menus. - // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience - GUI::MessageDialog alert("Do you want to load or save the game?", "Load", "Save"); - if (alert.runModal() == GUI::kMessageOK) - _key_action[action].setKey(SDLK_l); - else - _key_action[action].setKey(SDLK_s); - } - EventsBuffer::simulateKey(&_key_action[action], true); - return true; - case POCKET_ACTION_KEYBOARD: - _CESystem->swap_panel(); - return true; - case POCKET_ACTION_HIDE: - _CESystem->swap_panel_visibility(); - return true; - case POCKET_ACTION_SOUND: - _CESystem->swap_sound_master(); - return true; - case POCKET_ACTION_RIGHTCLICK: - _CESystem->add_right_click(true); - return true; - case POCKET_ACTION_CURSOR: - _CESystem->swap_mouse_visibility(); - return true; - case POCKET_ACTION_FREELOOK: - _CESystem->swap_freeLook(); - return true; - case POCKET_ACTION_ZOOM_UP: - _CESystem->swap_zoom_up(); - return true; - case POCKET_ACTION_ZOOM_DOWN: - _CESystem->swap_zoom_down(); - return true; - case POCKET_ACTION_LEFTCLICK: - _CESystem->add_left_click(true); - return true; - case POCKET_ACTION_UP: - _CESystem->move_cursor_up(); - return true; - case POCKET_ACTION_DOWN: - _CESystem->move_cursor_down(); - return true; - case POCKET_ACTION_LEFT: - _CESystem->move_cursor_left(); - return true; - case POCKET_ACTION_RIGHT: - _CESystem->move_cursor_right(); - return true; - case POCKET_ACTION_QUIT: - if (!quitdialog) { - quitdialog = true; - GUI::MessageDialog alert(" Are you sure you want to quit ? ", "Yes", "No"); - if (alert.runModal() == GUI::kMessageOK) - _mainSystem->quit(); - quitdialog = false; - } - return true; - case POCKET_ACTION_BINDKEYS: - if (!keydialogrunning) { - keydialogrunning = true; - GUI::KeysDialog *keysDialog = new GUI::KeysDialog(); - keysDialog->runModal(); - delete keysDialog; - keydialogrunning = false; - } - return true; + case POCKET_ACTION_PAUSE: + case POCKET_ACTION_SAVE: + case POCKET_ACTION_SKIP: + case POCKET_ACTION_MULTI: + if (action == POCKET_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { + // FIXME: This is a temporary solution. The engine should handle its own menus. + // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience + GUI::MessageDialog alert("Do you want to load or save the game?", "Load", "Save"); + if (alert.runModal() == GUI::kMessageOK) + _key_action[action].setKey(SDLK_l); + else + _key_action[action].setKey(SDLK_s); + } + EventsBuffer::simulateKey(&_key_action[action], true); + return true; + case POCKET_ACTION_KEYBOARD: + _CESystem->swap_panel(); + return true; + case POCKET_ACTION_HIDE: + _CESystem->swap_panel_visibility(); + return true; + case POCKET_ACTION_SOUND: + _CESystem->swap_sound_master(); + return true; + case POCKET_ACTION_RIGHTCLICK: + _CESystem->add_right_click(true); + return true; + case POCKET_ACTION_CURSOR: + _CESystem->swap_mouse_visibility(); + return true; + case POCKET_ACTION_FREELOOK: + _CESystem->swap_freeLook(); + return true; + case POCKET_ACTION_ZOOM_UP: + _CESystem->swap_zoom_up(); + return true; + case POCKET_ACTION_ZOOM_DOWN: + _CESystem->swap_zoom_down(); + return true; + case POCKET_ACTION_LEFTCLICK: + _CESystem->add_left_click(true); + return true; + case POCKET_ACTION_UP: + _CESystem->move_cursor_up(); + return true; + case POCKET_ACTION_DOWN: + _CESystem->move_cursor_down(); + return true; + case POCKET_ACTION_LEFT: + _CESystem->move_cursor_left(); + return true; + case POCKET_ACTION_RIGHT: + _CESystem->move_cursor_right(); + return true; + case POCKET_ACTION_QUIT: + if (!quitdialog) { + quitdialog = true; + GUI::MessageDialog alert(" Are you sure you want to quit ? ", "Yes", "No"); + if (alert.runModal() == GUI::kMessageOK) + _mainSystem->quit(); + quitdialog = false; + } + return true; + case POCKET_ACTION_BINDKEYS: + if (!keydialogrunning) { + keydialogrunning = true; + GUI::KeysDialog *keysDialog = new GUI::KeysDialog(); + keysDialog->runModal(); + delete keysDialog; + keydialogrunning = false; + } + return true; } return false; } diff --git a/backends/platform/wince/CEException.cpp b/backends/platform/wince/CEException.cpp index aec818102d..4ecabece5a 100644 --- a/backends/platform/wince/CEException.cpp +++ b/backends/platform/wince/CEException.cpp @@ -94,31 +94,31 @@ void CEException::dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord) unsigned int i; #if (_WIN32_WCE >= 300) writeBreak(file); - switch(exceptionRecord->ExceptionCode) { - case EXCEPTION_ACCESS_VIOLATION : - strcpy(exceptionName, "Access Violation"); - break; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED : - strcpy(exceptionName, "Array Bounds Exceeded"); - break; - case EXCEPTION_DATATYPE_MISALIGNMENT : - strcpy(exceptionName, "Datatype Misalignment"); - break; - case EXCEPTION_IN_PAGE_ERROR : - strcpy(exceptionName, "In Page Error"); - break; - case EXCEPTION_INT_DIVIDE_BY_ZERO : - strcpy(exceptionName, "Int Divide By Zero"); - break; - case EXCEPTION_INT_OVERFLOW : - strcpy(exceptionName, "Int Overflow"); - break; - case EXCEPTION_STACK_OVERFLOW : - strcpy(exceptionName, "Stack Overflow"); - break; - default: - sprintf(exceptionName, "%.8x", exceptionRecord->ExceptionCode); - break; + switch (exceptionRecord->ExceptionCode) { + case EXCEPTION_ACCESS_VIOLATION : + strcpy(exceptionName, "Access Violation"); + break; + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED : + strcpy(exceptionName, "Array Bounds Exceeded"); + break; + case EXCEPTION_DATATYPE_MISALIGNMENT : + strcpy(exceptionName, "Datatype Misalignment"); + break; + case EXCEPTION_IN_PAGE_ERROR : + strcpy(exceptionName, "In Page Error"); + break; + case EXCEPTION_INT_DIVIDE_BY_ZERO : + strcpy(exceptionName, "Int Divide By Zero"); + break; + case EXCEPTION_INT_OVERFLOW : + strcpy(exceptionName, "Int Overflow"); + break; + case EXCEPTION_STACK_OVERFLOW : + strcpy(exceptionName, "Stack Overflow"); + break; + default: + sprintf(exceptionName, "%.8x", exceptionRecord->ExceptionCode); + break; } sprintf(tempo, "Exception %s Flags %.8x Address %.8x", exceptionName, exceptionRecord->ExceptionFlags, exceptionRecord->ExceptionAddress); diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 1291e09671..b2512e0234 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -935,46 +935,46 @@ bool OSystem_WINCE3::hasFeature(Feature f) { } void OSystem_WINCE3::setFeatureState(Feature f, bool enable) { - switch(f) { - case kFeatureFullscreenMode: - return; + switch (f) { + case kFeatureFullscreenMode: + return; - case kFeatureVirtualKeyboard: - if (_hasSmartphoneResolution) - return; - _toolbarHighDrawn = false; - if (enable) { - _panelStateForced = true; - if (!_toolbarHandler.visible()) swap_panel_visibility(); - //_saveToolbarState = _toolbarHandler.visible(); - _saveActiveToolbar = _toolbarHandler.activeName(); - _toolbarHandler.setActive(NAME_PANEL_KEYBOARD); - _toolbarHandler.setVisible(true); - } - else - if (_panelStateForced) { - _panelStateForced = false; - _toolbarHandler.setActive(_saveActiveToolbar); - //_toolbarHandler.setVisible(_saveToolbarState); - } + case kFeatureVirtualKeyboard: + if (_hasSmartphoneResolution) return; + _toolbarHighDrawn = false; + if (enable) { + _panelStateForced = true; + if (!_toolbarHandler.visible()) swap_panel_visibility(); + //_saveToolbarState = _toolbarHandler.visible(); + _saveActiveToolbar = _toolbarHandler.activeName(); + _toolbarHandler.setActive(NAME_PANEL_KEYBOARD); + _toolbarHandler.setVisible(true); + } + else + if (_panelStateForced) { + _panelStateForced = false; + _toolbarHandler.setActive(_saveActiveToolbar); + //_toolbarHandler.setVisible(_saveToolbarState); + } + return; - case kFeatureDisableKeyFiltering: - if (_hasSmartphoneResolution) - _unfilteredkeys = enable; - return; + case kFeatureDisableKeyFiltering: + if (_hasSmartphoneResolution) + _unfilteredkeys = enable; + return; - default: - OSystem_SDL::setFeatureState(f, enable); + default: + OSystem_SDL::setFeatureState(f, enable); } } bool OSystem_WINCE3::getFeatureState(Feature f) { - switch(f) { - case kFeatureFullscreenMode: - return false; - case kFeatureVirtualKeyboard: - return (_panelStateForced); + switch (f) { + case kFeatureFullscreenMode: + return false; + case kFeatureVirtualKeyboard: + return (_panelStateForced); } return OSystem_SDL::getFeatureState(f); } @@ -1277,7 +1277,7 @@ bool OSystem_WINCE3::setGraphicsMode(int mode) { if (_scaleFactorXm < 0) { /* Standard scalers, from the SDL backend */ - switch(_videoMode.mode) { + switch (_videoMode.mode) { case GFX_NORMAL: _videoMode.scaleFactor = 1; _scalerProc = Normal1x; @@ -2308,7 +2308,7 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) { currentTime = GetTickCount(); while (SDL_PollEvent(&ev)) { - switch(ev.type) { + switch (ev.type) { case SDL_KEYDOWN: debug(1, "Key down %X %s", ev.key.keysym.sym, SDL_GetKeyName((SDLKey)ev.key.keysym.sym)); // KMOD_RESERVED is used if the key has been injected by an external buffer diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp index 4ca4a5f586..80aad3be4a 100644 --- a/backends/vkeybd/virtual-keyboard.cpp +++ b/backends/vkeybd/virtual-keyboard.cpp @@ -337,7 +337,7 @@ void VirtualKeyboard::KeyPressQueue::deleteKey() { List<VirtualKeyPress>::iterator it = _keyPos; it--; _strPos -= it->strLen; - while((it->strLen)-- > 0) + while ((it->strLen)-- > 0) _keysStr.deleteChar(_strPos); _keys.erase(it); _strChanged = true; |