diff options
author | Johannes Schickel | 2009-05-24 15:17:42 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-05-24 15:17:42 +0000 |
commit | b3c6751b9b7fc1401fd5e87a034cdaec92b67b20 (patch) | |
tree | aa00dba58fb88ea2e095b886963370c7290c692b /backends | |
parent | 7c1eb057146af11793c627327f3fefe309d27fbb (diff) | |
download | scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.gz scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.bz2 scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.zip |
Strip trailing whitespaces in the whole code base.
svn-id: r40867
Diffstat (limited to 'backends')
39 files changed, 203 insertions, 203 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 9c33e187a4..f610c6f8a5 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -469,7 +469,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { event.type = Common::EVENT_RTL; } } -#ifdef ENABLE_VKEYBD +#ifdef ENABLE_VKEYBD else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.flags == 0) { if (_vk->isDisplaying()) { _vk->close(true); @@ -483,7 +483,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { } } #endif -#ifdef ENABLE_KEYMAPPER +#ifdef ENABLE_KEYMAPPER else if (event.kbd.keycode == Common::KEYCODE_F8 && event.kbd.flags == 0) { if (!_remap) { _remap = true; diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 58b5745b7d..5841318fd4 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -143,7 +143,7 @@ public: virtual int shouldQuit() const { return _shouldQuit; } virtual int shouldRTL() const { return _shouldRTL; } virtual void resetRTL() { _shouldRTL = false; } - + #ifdef ENABLE_KEYMAPPER virtual Common::Keymapper *getKeymapper() { return _keymapper; } #endif diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index 92bdba0650..93308ab38a 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -224,7 +224,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) { lastSlash = r; } } - + if (path == "mp:/") { // This is the root directory _isDirectory = true; diff --git a/backends/fs/ps2/ps2-fs.cpp b/backends/fs/ps2/ps2-fs.cpp index 150e8f8a7a..c5abf31f8d 100644 --- a/backends/fs/ps2/ps2-fs.cpp +++ b/backends/fs/ps2/ps2-fs.cpp @@ -264,7 +264,7 @@ void Ps2FilesystemNode::doverify(void) { _isHere = false; _isDirectory = false; return; - } + } switch (medium) { #if 0 @@ -361,7 +361,7 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const { /* int fd; - + if (_path == "pfs0:") fd = fio.dopen("pfs0:/"); else @@ -442,7 +442,7 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi if ( (mode == Common::FSNode::kListAll) || - ((mode == Common::FSNode::kListDirectoriesOnly) && + ((mode == Common::FSNode::kListDirectoriesOnly) && (dirent.stat.mode & FIO_S_IFDIR)) || ((mode == Common::FSNode::kListFilesOnly) && @@ -499,7 +499,7 @@ char *Ps2FilesystemNode::getDeviceDescription() const { return "Host"; else if (strncmp(_path.c_str(), "mc0", 3) == 0) return "Memory Card"; - else + else return "WTF ???"; } diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp index 7d56931fc0..2fa5d7b142 100644 --- a/backends/fs/symbian/symbian-fs.cpp +++ b/backends/fs/symbian/symbian-fs.cpp @@ -136,10 +136,10 @@ SymbianFilesystemNode::SymbianFilesystemNode(const Common::String &path) { } else { _isValid = ETrue; _isDirectory = EFalse; - TParsePtrC parser(fname); - if(parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { + TParsePtrC parser(fname); + if(parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { _isDirectory = ETrue; - } + } } } diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp index 2541f60ddd..3feb593f19 100644 --- a/backends/keymapper/action.cpp +++ b/backends/keymapper/action.cpp @@ -31,7 +31,7 @@ namespace Common { -Action::Action(Keymap *boss, const char *i, String des, ActionType typ, +Action::Action(Keymap *boss, const char *i, String des, ActionType typ, KeyType prefKey, int pri, int flg) : _boss(boss), description(des), type(typ), preferredKey(prefKey), priority(pri), flags(flg), _hwKey(0) { diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h index 04d8dd4067..31576e2960 100644 --- a/backends/keymapper/action.h +++ b/backends/keymapper/action.h @@ -63,12 +63,12 @@ private: Keymap *_boss; public: - Action(Keymap *boss, const char *id, String des = "", + Action(Keymap *boss, const char *id, String des = "", ActionType typ = kGenericActionType, KeyType prefKey = kGenericKeyType, int pri = 0, int flg = 0 ); - void addEvent(const Event &evt) { + void addEvent(const Event &evt) { events.push_back(evt); } @@ -101,7 +101,7 @@ public: addEvent(evt); } - Keymap *getParent() { + Keymap *getParent() { return _boss; } @@ -111,10 +111,10 @@ public: }; struct ActionPriorityComp : public BinaryFunction<Action, Action, bool> { - bool operator()(const Action *x, const Action *y) const { + bool operator()(const Action *x, const Action *y) const { return x->priority > y->priority; } - bool operator()(const Action &x, const Action &y) const { + bool operator()(const Action &x, const Action &y) const { return x.priority > y.priority; } }; diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h index e70148cb0f..8ddeada51e 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-key.h @@ -38,17 +38,17 @@ namespace Common { #define HWKEY_ID_SIZE (30) /** -* Describes an available hardware key +* Describes an available hardware key */ struct HardwareKey { /** unique id used for saving/loading to config */ char hwKeyId[HWKEY_ID_SIZE]; /** Human readable description */ - String description; + String description; - /** - * The KeyState that is generated by the back-end + /** + * The KeyState that is generated by the back-end * when this hardware key is pressed. */ KeyState key; @@ -69,7 +69,7 @@ struct HardwareKey { * Simple class to encapsulate a device's set of HardwareKeys. * Each device should instantiate this and call addHardwareKey a number of times * in its constructor to define the device's available keys. - */ + */ class HardwareKeySet { public: diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index 13be1ad8bc..840ba5a0c5 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -124,7 +124,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { if (!_configDomain) return; - ConfigManager::Domain::iterator it; + ConfigManager::Domain::iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; for (it = _configDomain->begin(); it != _configDomain->end(); it++) { @@ -138,7 +138,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { Action *ua = getAction(actionId); if (!ua) { - warning("'%s' keymap does not contain Action with ID %s", + warning("'%s' keymap does not contain Action with ID %s", _name.c_str(), actionId); _configDomain->erase(key); @@ -199,7 +199,7 @@ bool Keymap::isComplete(const HardwareKeySet *hwKeys) { // TODO: // - current weakness: -// - if an action finds a key with required type but a parent action with +// - if an action finds a key with required type but a parent action with // higher priority is using it, that key is never used void Keymap::automaticMapping(HardwareKeySet *hwKeys) { // Create copies of action and key lists. @@ -208,7 +208,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) { List<Action*>::iterator actIt; List<const HardwareKey*>::iterator keyIt, selectedKey; - + // Remove actions and keys from local lists that have already been mapped. actIt = actions.begin(); @@ -227,16 +227,16 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) { // Sort remaining actions by priority. ActionPriorityComp priorityComp; sort(actions.begin(), actions.end(), priorityComp); - + // First mapping pass: - // - Match if a key's preferred action type is the same as the action's + // - Match if a key's preferred action type is the same as the action's // type, or vice versa. // - Priority is given to: // - keys that match action types over key types. // - keys that have not been used by parent maps. // - If a key has been used by a parent map the new action must have a // higher priority than the parent action. - // - As soon as the number of skipped actions equals the number of keys + // - As soon as the number of skipped actions equals the number of keys // remaining we stop matching. This means that the second pass will assign keys // to these higher priority skipped actions. uint skipped = 0; @@ -317,7 +317,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) { if (selectedKey != keys.end()) { act->mapKey(*selectedKey); keys.erase(selectedKey); - } else {// no match = no keys left + } else {// no match = no keys left break; } } diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h index 35ad732bdc..615fd9097d 100644 --- a/backends/keymapper/keymap.h +++ b/backends/keymapper/keymap.h @@ -48,7 +48,7 @@ class HardwareKeySet; template<> struct Hash<KeyState> : public UnaryFunction<KeyState, uint> { - uint operator()(const KeyState &val) const { + uint operator()(const KeyState &val) const { return (uint)val.keycode | ((uint)val.flags << 24); } }; @@ -78,7 +78,7 @@ public: * @return a pointer to the Action or 0 if no */ Action *getMappedAction(const KeyState& ks) const; - + void setConfigDomain(ConfigManager::Domain *dom); /** @@ -94,7 +94,7 @@ public: */ void saveMappings(); - + void automaticMapping(HardwareKeySet *hwKeys); /** @@ -110,7 +110,7 @@ private: friend struct Action; /** - * Adds a new Action to this Map, + * Adds a new Action to this Map, * adding it at the back of the internal array * @param action the Action to add */ @@ -141,7 +141,7 @@ private: String _name; Keymap *_parent; List<Action*> _actions; - HashMap<KeyState, Action*> _keymap; + HashMap<KeyState, Action*> _keymap; ConfigManager::Domain *_configDomain; }; diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp index 4668d34421..c74aa45b17 100644 --- a/backends/keymapper/keymapper.cpp +++ b/backends/keymapper/keymapper.cpp @@ -86,7 +86,7 @@ void Keymapper::addGlobalKeymap(Keymap *keymap) { void Keymapper::addGameKeymap(Keymap *keymap) { if (ConfMan.getActiveDomain() == 0) error("Call to Keymapper::addGameKeymap when no game loaded"); - + // Detect whether the active game changed since last call. // If so, flush the game key configuration. if (_gameDomain.getConfigDomain() != ConfMan.getActiveDomain()) { @@ -118,7 +118,7 @@ void Keymapper::initKeymap(Domain &domain, Keymap *map) { void Keymapper::cleanupGameKeymaps() { // Flush all game specific keymaps _gameDomain.deleteAllKeyMaps(); - + // Now restore the stack of active maps. Re-add all global keymaps, drop // the game specific (=deleted) ones. Stack<MapRecord> newStack; diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h index 3bc9ea2327..c82f64b0ed 100644 --- a/backends/keymapper/keymapper.h +++ b/backends/keymapper/keymapper.h @@ -41,7 +41,7 @@ namespace Common { class Keymapper { public: - + struct MapRecord { Keymap* keymap; bool inherit; @@ -53,11 +53,11 @@ public: IgnoreCase_Hash, IgnoreCase_EqualTo> { public: Domain() : _configDomain(0) {} - ~Domain() { + ~Domain() { deleteAllKeyMaps(); } - void setConfigDomain(ConfigManager::Domain *confDom) { + void setConfigDomain(ConfigManager::Domain *confDom) { _configDomain = confDom; } ConfigManager::Domain *getConfigDomain() { @@ -69,7 +69,7 @@ public: void deleteAllKeyMaps(); Keymap *getKeymap(const String& name); - + private: ConfigManager::Domain *_configDomain; }; @@ -120,10 +120,10 @@ public: Keymap *getKeymap(const String& name, bool &global); /** - * Push a new keymap to the top of the active stack, activating + * Push a new keymap to the top of the active stack, activating * it for use. * @param name name of the keymap to push - * @param inherit if true keymapper will iterate down the + * @param inherit if true keymapper will iterate down the * stack if it cannot find a key in the new map * @return true if succesful */ @@ -136,7 +136,7 @@ public: /** * @brief Map a key press event. - * If the active keymap contains a Action mapped to the given key, then + * If the active keymap contains a Action mapped to the given key, then * the Action's events are pushed into the EventManager's event queue. * @param key key that was pressed * @param keyDown true for key down, false for key up @@ -180,7 +180,7 @@ private: HardwareKeySet *_hardwareKeys; void pushKeymap(Keymap *newMap, bool inherit, bool global); - + Action *getAction(const KeyState& key); void executeAction(const Action *act, bool keyDown); diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 35706e89dd..389ca7d1f9 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -146,7 +146,7 @@ void RemapDialog::reflowLayout() { _colCount = (areaW - scrollbarWidth) / colWidth; _rowCount = (areaH + spacing) / (buttonHeight + spacing); - if (_colCount <= 0 || _rowCount <= 0) + if (_colCount <= 0 || _rowCount <= 0) error("Remap dialog too small to display any keymaps!"); _scrollBar->resize(areaX + areaW - scrollbarWidth, areaY, scrollbarWidth, areaH); @@ -164,9 +164,9 @@ void RemapDialog::reflowLayout() { ActionWidgets widg; if (i >= _keymapWidgets.size()) { - widg.actionText = + widg.actionText = new GUI::StaticTextWidget(this, 0, 0, 0, 0, "", Graphics::kTextAlignRight); - widg.keyButton = + widg.keyButton = new GUI::ButtonWidget(this, 0, 0, 0, 0, "", kRemapCmd + i); _keymapWidgets.push_back(widg); } else { @@ -208,7 +208,7 @@ void RemapDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 d void RemapDialog::startRemapping(uint i) { if (_topAction + i >= _currentActions.size()) - return; + return; _remapTimeout = getMillis() + kRemapTimeoutDelay; _activeRemapAction = _currentActions[_topAction + i].action; @@ -287,7 +287,7 @@ void RemapDialog::loadKeymap() { if (act->getMappedKey()) freeKeys.remove(act->getMappedKey()); } - + // loop through remaining finding mappings for unmapped keys if (top.inherit) { for (int i = activeKeymaps.size() - 2; i >= 0; --i) { @@ -365,7 +365,7 @@ void RemapDialog::refreshKeymap() { widg.actionText->setVisible(true); widg.keyButton->setVisible(true); - actionI++; + actionI++; } else { widg.actionText->setVisible(false); widg.keyButton->setVisible(false); @@ -373,7 +373,7 @@ void RemapDialog::refreshKeymap() { //widg.actionText->draw(); //widg.keyButton->draw(); } - // need to redraw entire Dialog so that invisible + // need to redraw entire Dialog so that invisible // widgets disappear draw(); } diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 621a2af082..ca2d2cb855 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -647,7 +647,7 @@ void displayMode8Bit() { // ConsoleInit destroys the hardware palette :-( OSystem_DS::instance()->restoreHardwarePalette(); - + // BG_PALETTE_SUB[255] = RGB15(31,31,31);//by default font will be rendered with color 255 // Do text stuff @@ -893,7 +893,7 @@ void displayMode16Bit() { BG3_XDX = isCpuScalerEnabled() ? 256 : (int) (1.25f * 256); BG3_XDY = 0; - BG3_YDX = 0; + BG3_YDX = 0; BG3_YDY = (int) ((200.0f / 192.0f) * 256); #ifdef HEAVY_LOGGING @@ -1571,7 +1571,7 @@ void addEventsToQueue() { } - static int selectHoldCount = 0; + static int selectHoldCount = 0; static const int SELECT_HOLD_TIME = 60; if ((getKeysHeld() & KEY_SELECT)) { @@ -1585,8 +1585,8 @@ void addEventsToQueue() { selectHoldCount = 0; } - - + + if (getKeysReleased() & KEY_SELECT) { if (selectHoldCount < SELECT_HOLD_TIME) { // Just pressed select - show DS options screen @@ -1838,7 +1838,7 @@ void soundBufferEmptyHandler() { } currentTimeMillis++; // TIMER0 end - + soundHiPart = !soundHiPart; } diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp index 52027f3a15..90f371e0a8 100644 --- a/backends/platform/ds/arm9/source/dsoptions.cpp +++ b/backends/platform/ds/arm9/source/dsoptions.cpp @@ -335,7 +335,7 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint close(); } - + if ((!guard) && (cmd == 0x40000000)) { close(); g_engine->openMainMenuDialog(); diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 057e107bb6..e35e5edea0 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -425,12 +425,12 @@ void OSystem_DS::grabOverlay(OverlayColor* buf, int pitch) { for (int y = 0; y < 200; y++) { u16* src = start + (y * 320); u16* dest = ((u16 *) (buf)) + (y * pitch); - + for (int x = 0; x < 320; x++) { *dest++ = *src++; } } - + } void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { diff --git a/backends/platform/ds/arm9/source/zipreader.cpp b/backends/platform/ds/arm9/source/zipreader.cpp index fa9a229348..fd6da4e9b9 100644 --- a/backends/platform/ds/arm9/source/zipreader.cpp +++ b/backends/platform/ds/arm9/source/zipreader.cpp @@ -171,7 +171,7 @@ bool ZipFile::findFile(const char *search) { char searchName[128]; strcpy(searchName, search); char *tmp = searchName; - + // Change slashes to backslashes for (; *tmp; ++tmp) { if (*tmp == '/') diff --git a/backends/platform/iphone/blit.cpp b/backends/platform/iphone/blit.cpp index 1a3352945d..c28f931983 100644 --- a/backends/platform/iphone/blit.cpp +++ b/backends/platform/iphone/blit.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -27,7 +27,7 @@ #include "blit_arm.h" void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, int width, int height, int screenWidth, int screenHeight) -{ +{ for (int x = width; x > 0; x--) { for (int y = height; y > 0; y--) { *(dst++) = *src; @@ -47,5 +47,5 @@ void blitLandscapeScreenRect8bpp(uint16 *dst, byte *src, int width, int height, } dst -= screenHeight + height; src += 1 - height * screenWidth; - } + } } diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h index 57dc991e9d..90d9a50aad 100644 --- a/backends/platform/iphone/iphone_common.h +++ b/backends/platform/iphone/iphone_common.h @@ -66,7 +66,7 @@ void iPhone_updateScreenRect(unsigned short* screen, int x1, int y1, int x2, int void iPhone_initSurface(int width, int height); bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY); const char* iPhone_getDocumentsDir(); - + #ifdef __cplusplus } #endif diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h index 3d5715bb95..daa5e1d18e 100644 --- a/backends/platform/iphone/iphone_video.h +++ b/backends/platform/iphone/iphone_video.h @@ -47,7 +47,7 @@ int _fullHeight; int _widthOffset; int _heightOffset; - + EAGLContext* _context; GLuint _viewRenderbuffer; GLuint _viewFramebuffer; diff --git a/backends/platform/iphone/osys_iphone.cpp b/backends/platform/iphone/osys_iphone.cpp index 192ea096ae..b72e8b65d5 100644 --- a/backends/platform/iphone/osys_iphone.cpp +++ b/backends/platform/iphone/osys_iphone.cpp @@ -88,7 +88,7 @@ int OSystem_IPHONE::timerHandler(int t) { void OSystem_IPHONE::initBackend() { #ifdef IPHONE_OFFICIAL - _savefile = new DefaultSaveFileManager(iPhone_getDocumentsDir()); + _savefile = new DefaultSaveFileManager(iPhone_getDocumentsDir()); #else _savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); #endif @@ -159,7 +159,7 @@ void OSystem_IPHONE::initSize(uint width, uint height) { bzero(_fullscreen, fullSize); iPhone_initSurface(width, height); - + _fullScreenIsDirty = false; dirtyFullScreen(); _mouseVisible = false; @@ -300,9 +300,9 @@ void OSystem_IPHONE::internUpdateScreen() { Common::Rect dirtyRect = _dirtyRects.remove_at(_dirtyRects.size() - 1); //printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); - + drawDirtyRect(dirtyRect); - + if (_overlayVisible) drawDirtyOverlayRect(dirtyRect); @@ -315,7 +315,7 @@ void OSystem_IPHONE::internUpdateScreen() { Common::Rect dirtyRect = _dirtyOverlayRects.remove_at(_dirtyOverlayRects.size() - 1); //printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); - + drawDirtyOverlayRect(dirtyRect); drawMouseCursorOnRectUpdate(dirtyRect, mouseRect); updateHardwareSurfaceForRect(dirtyRect); @@ -332,7 +332,7 @@ void OSystem_IPHONE::drawDirtyRect(const Common::Rect& dirtyRect) { for (int y = h; y > 0; y--) { for (int x = w; x > 0; x--) *dst++ = _palette[*src++]; - + dst += _screenWidth - w; src += _screenWidth - w; } @@ -392,7 +392,7 @@ void OSystem_IPHONE::drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect } void OSystem_IPHONE::updateHardwareSurfaceForRect(const Common::Rect& updatedRect) { - iPhone_updateScreenRect(_fullscreen, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom ); + iPhone_updateScreenRect(_fullscreen, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom ); } Graphics::Surface *OSystem_IPHONE::lockScreen() { @@ -610,7 +610,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) { case kInputMouseDragged: if (!handleEvent_mouseDragged(event, x, y)) return false; - break; + break; case kInputMouseSecondDragged: if (!handleEvent_mouseSecondDragged(event, x, y)) return false; @@ -618,13 +618,13 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) { case kInputMouseSecondDown: _secondaryTapped = true; if (!handleEvent_secondMouseDown(event, x, y)) - return false; + return false; break; case kInputMouseSecondUp: _secondaryTapped = false; if (!handleEvent_secondMouseUp(event, x, y)) - return false; - break; + return false; + break; case kInputOrientationChanged: handleEvent_orientationChanged((int)xUnit); return false; @@ -781,30 +781,30 @@ bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y int deltaY = _lastPadY - y; _lastPadX = x; _lastPadY = y; - + mouseNewPosX = (int)(_mouseX - deltaX / 0.5f); mouseNewPosY = (int)(_mouseY - deltaY / 0.5f); - + if (mouseNewPosX < 0) mouseNewPosX = 0; else if (mouseNewPosX > _screenWidth) mouseNewPosX = _screenWidth; - + if (mouseNewPosY < 0) mouseNewPosY = 0; else if (mouseNewPosY > _screenHeight) mouseNewPosY = _screenHeight; - + } else { mouseNewPosX = x; mouseNewPosY = y; } - + event.type = Common::EVENT_MOUSEMOVE; event.mouse.x = mouseNewPosX; event.mouse.y = mouseNewPosY; warpMouse(mouseNewPosX, mouseNewPosY); - + return true; } @@ -812,27 +812,27 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, if (_gestureStartX == -1 || _gestureStartY == -1) { return false; } - + int vecX = (x - _gestureStartX); int vecY = (y - _gestureStartY); int lengthSq = vecX * vecX + vecY * vecY; //printf("Lengthsq: %u\n", lengthSq); - + if (lengthSq > 15000) { // Long enough gesture to react upon. _gestureStartX = -1; _gestureStartY = -1; - + float vecLength = sqrt(lengthSq); float vecXNorm = vecX / vecLength; float vecYNorm = vecY / vecLength; - + //printf("Swipe vector: (%.2f, %.2f)\n", vecXNorm, vecYNorm); - + if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm > 0.75) { // Swipe down event.type = Common::EVENT_KEYDOWN; _queuedInputEvent.type = Common::EVENT_KEYUP; - + event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5; @@ -849,7 +849,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, GUI::TimedMessageDialog dialog(dialogMsg, 1500); dialog.runModal(); return false; - + } else if (vecXNorm > 0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) { // Swipe right _touchpadModeEnabled = !_touchpadModeEnabled; @@ -861,12 +861,12 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, GUI::TimedMessageDialog dialog(dialogMsg, 1500); dialog.runModal(); return false; - + } else if (vecXNorm < -0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) { // Swipe left return false; } - } + } return false; } @@ -893,7 +893,7 @@ void OSystem_IPHONE::handleEvent_orientationChanged(int orientation) { if (_screenOrientation != newOrientation) { _screenOrientation = newOrientation; iPhone_initSurface(_screenWidth, _screenHeight); - + dirtyFullScreen(); if (_overlayVisible) dirtyFullOverlayScreen(); @@ -1231,7 +1231,7 @@ Common::SeekableReadStream *OSystem_IPHONE::createConfigReadStream() { strncat(buf, "/Preferences", 256 - strlen(buf) ); Common::FSNode file(buf); #else - Common::FSNode file(SCUMMVM_PREFS_PATH); + Common::FSNode file(SCUMMVM_PREFS_PATH); #endif return file.createReadStream(); } @@ -1241,10 +1241,10 @@ Common::WriteStream *OSystem_IPHONE::createConfigWriteStream() { char buf[256]; strncpy(buf, iPhone_getDocumentsDir(), 256); strncat(buf, "/Preferences", 256 - strlen(buf) ); - Common::FSNode file(buf); + Common::FSNode file(buf); #else - Common::FSNode file(SCUMMVM_PREFS_PATH); -#endif + Common::FSNode file(SCUMMVM_PREFS_PATH); +#endif return file.createWriteStream(); } @@ -1288,7 +1288,7 @@ void iphone_main(int argc, char *argv[]) { chdir("/var/mobile/"); #endif - + g_system = OSystem_IPHONE_create(); assert(g_system); diff --git a/backends/platform/iphone/osys_iphone.h b/backends/platform/iphone/osys_iphone.h index 140133fb90..ceb2102a5f 100644 --- a/backends/platform/iphone/osys_iphone.h +++ b/backends/platform/iphone/osys_iphone.h @@ -104,7 +104,7 @@ protected: TimerProc _timerCallback; Common::Array<Common::Rect> _dirtyRects; - Common::Array<Common::Rect> _dirtyOverlayRects; + Common::Array<Common::Rect> _dirtyOverlayRects; ScreenOrientation _screenOrientation; bool _fullScreenIsDirty; bool _fullScreenOverlayIsDirty; @@ -168,7 +168,7 @@ public: virtual void quit(); FilesystemFactory *getFilesystemFactory() { return _fsFactory; } - virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); + virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual void getTimeAndDate(struct tm &t) const; virtual void setWindowCaption(const char *caption); @@ -186,13 +186,13 @@ public: protected: void internUpdateScreen(); void dirtyFullScreen(); - void dirtyFullOverlayScreen(); + void dirtyFullOverlayScreen(); void clipRectToScreen(int16 &x, int16 &y, int16 &w, int16 &h); void suspendLoop(); void drawDirtyRect(const Common::Rect& dirtyRect); - void drawDirtyOverlayRect(const Common::Rect& dirtyRect); + void drawDirtyOverlayRect(const Common::Rect& dirtyRect); void drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect, const Common::Rect& mouseRect); - void updateHardwareSurfaceForRect(const Common::Rect& updatedRect); + void updateHardwareSurfaceForRect(const Common::Rect& updatedRect); static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB); static int timerHandler(int t); @@ -207,5 +207,5 @@ protected: bool handleEvent_secondMouseUp(Common::Event &event, int x, int y); bool handleEvent_mouseDragged(Common::Event &event, int x, int y); - bool handleEvent_mouseSecondDragged(Common::Event &event, int x, int y); + bool handleEvent_mouseSecondDragged(Common::Event &event, int x, int y); }; diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index 380e28952f..e9a846f659 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -162,7 +162,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) { // _tvMode = TV_NTSC; printf("Setting up %s mode\n", (_tvMode == TV_PAL) ? "PAL" : "NTSC"); - + // set screen size, 640x512 for pal, 640x448 for ntsc _tvWidth = 640; _tvHeight = ((_tvMode == TV_PAL) ? 512 /*544*/ : 448); @@ -188,7 +188,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) { _clutPtrs[TEXT] = _clutPtrs[SCREEN] + 0x2000; _texPtrs[SCREEN] = _clutPtrs[SCREEN] + 0x3000; _texPtrs[TEXT] = 0; // these buffers are stored in the alpha gaps of the frame buffers - _texPtrs[MOUSE] = 128 * 256 * 4; + _texPtrs[MOUSE] = 128 * 256 * 4; _texPtrs[PRINTF] = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4; _showOverlay = false; @@ -249,7 +249,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) { updateScreen(); createAnimTextures(); - + // create anim thread ee_thread_t animThread, thisThread; ReferThreadStatus(GetThreadId(), &thisThread); @@ -683,7 +683,7 @@ void Gs2dScreen::animThread(void) { do { WaitSema(g_AnimSema); } while ((!_systemQuit) && (!g_RunAnim)); - + if (_systemQuit) break; @@ -808,7 +808,7 @@ const uint32 Gs2dScreen::_binaryClut[16] __attribute__((aligned(64))) = { GS_RGBA( 0, 0, 0, 0x20), // scrPrintf: semitransparent GS_RGBA(0xC0, 0xC0, 0xC0, 0), // scrPrintf: red GS_RGBA(0x16, 0x16, 0xF0, 0), // scrPrintf: blue - + GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), // unused GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h index 1c4de6ef5a..91dfc9d327 100644 --- a/backends/platform/ps2/Gs2dScreen.h +++ b/backends/platform/ps2/Gs2dScreen.h @@ -77,7 +77,7 @@ public: void showOverlay(void); void hideOverlay(void); Graphics::PixelFormat getOverlayFormat(void); - int16 getOverlayWidth(void); + int16 getOverlayWidth(void); int16 getOverlayHeight(void); //- mouse routines diff --git a/backends/platform/ps2/fileio.cpp b/backends/platform/ps2/fileio.cpp index d2186b6475..fc35306907 100644 --- a/backends/platform/ps2/fileio.cpp +++ b/backends/platform/ps2/fileio.cpp @@ -267,7 +267,7 @@ void Ps2File::cacheReadSync(void) { } } -uint32 Ps2File::read(void *dest, uint32 len) { +uint32 Ps2File::read(void *dest, uint32 len) { // uint32 r=0, d=0, ds=0, sz=0; #ifdef __PS2_FILE_SEMA__ WaitSema(_sema); diff --git a/backends/platform/ps2/fileio.h b/backends/platform/ps2/fileio.h index 6c2b9402a3..e793c29d4b 100644 --- a/backends/platform/ps2/fileio.h +++ b/backends/platform/ps2/fileio.h @@ -56,7 +56,7 @@ public: virtual bool getErr(void); virtual void setErr(bool); - + private: void cacheReadAhead(void); void cacheReadSync(void); diff --git a/backends/platform/ps2/icon.h b/backends/platform/ps2/icon.h index 0e7d096c45..bc614bf70b 100644 --- a/backends/platform/ps2/icon.h +++ b/backends/platform/ps2/icon.h @@ -23,7 +23,7 @@ class PS2Icon { public: PS2Icon() {}; - + ~PS2Icon() {}; uint16 decompressData(uint16 **data); diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp index fa3e047bf6..daa592522a 100644 --- a/backends/platform/ps2/irxboot.cpp +++ b/backends/platform/ps2/irxboot.cpp @@ -41,7 +41,7 @@ static const char netArg[] = "192.168.0.10" "\0" "255.255.255.0" "\0" "192.168.0 IrxFile irxFiles[] = { { "SIO2MAN", BIOS, NOTHING, NULL, 0 }, - { "MCMAN", BIOS, NOTHING, NULL, 0 }, + { "MCMAN", BIOS, NOTHING, NULL, 0 }, { "MCSERV", BIOS, NOTHING, NULL, 0 }, { "PADMAN", BIOS, NOTHING, NULL, 0 }, { "LIBSD", BIOS, NOTHING, NULL, 0 }, @@ -73,7 +73,7 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath) { PS2Device device = _getDev(elfPath); printf("elf path: %s, device %d\n", elfPath, device); - + strcpy(bootPath, elfPath); char *pathPos = bootPath; @@ -115,7 +115,7 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath) { return device; } -int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { +int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference)); IrxReference *curModule = resModules; diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 1a69e5377a..f29caf2279 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -209,7 +209,7 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) { } } else sioprintf("Module \"%s\" wasn't found: %d\n", modules[i].path, modules[i].errorCode); - + if ((modules[i].errorCode < 0) || (res < 0) || (rv < 0)) { if (!(modules[i].fileRef->flags & OPTIONAL)) { if (modules[i].errorCode < 0) @@ -220,7 +220,7 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) { quit(); } } - + if (modules[i].buffer) free(modules[i].buffer); } else { @@ -723,7 +723,7 @@ void OSystem_PS2::msgPrintf(int millis, char *format, ...) { while ((*lnEnd) && (*lnEnd != '\n')) lnEnd++; *lnEnd = '\0'; - + Common::String str(lnSta); int width = Graphics::g_sysfont.getStringWidth(str); if (width > maxWidth) @@ -821,17 +821,17 @@ void OSystem_PS2::quit(void) { // ("", 0, NULL); /* back to PS2 Browser */ -/* +/* __asm__ __volatile__( " li $3, 0x04;" " syscall;" " nop;" ); */ - + /* SifIopReset("rom0:UNDL ", 0); - while (!SifIopSync()) ; + while (!SifIopSync()) ; // SifIopReboot(...); */ #else @@ -959,7 +959,7 @@ void OSystem_PS2::makeConfigPath() { sprintf(path, "mc0:ScummVM/ScummVM.ini"); else ps2_fclose(src); - + _configFile = strdup(path); } @@ -967,7 +967,7 @@ Common::SeekableReadStream *OSystem_PS2::createConfigReadStream() { Common::FSNode file(_configFile); return file.createReadStream(); } - + Common::WriteStream *OSystem_PS2::createConfigWriteStream() { Common::FSNode file(_configFile); return file.createWriteStream(); diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 67f3078f59..29747c0943 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -84,7 +84,7 @@ public: virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); virtual int16 getOverlayWidth(void); virtual int16 getOverlayHeight(void); - + virtual bool showMouse(bool visible); virtual void warpMouse(int x, int y); diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp index 9bbbec399d..c45cef32bd 100644 --- a/backends/platform/symbian/src/SymbianActions.cpp +++ b/backends/platform/symbian/src/SymbianActions.cpp @@ -164,7 +164,7 @@ void SymbianActions::initInstanceGame() { // Pause if(is_cruise) { _key_action[ACTION_PAUSE].setKey('P'); - } + } else { _key_action[ACTION_PAUSE].setKey(' '); } diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 6d27b46813..344edd7143 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -1737,8 +1737,8 @@ void OSystem_WINCE3::internUpdateScreen() { toolbarScaler = Normal2x; else if (_videoMode.scaleFactor == 3) toolbarScaler = Normal3x; - toolbarScaler((byte *)toolbarSurface->pixels, srcPitch, - (byte *)_hwscreen->pixels + (_toolbarHandler.getOffset() * _scaleFactorYm / _scaleFactorYd * dstPitch), + toolbarScaler((byte *)toolbarSurface->pixels, srcPitch, + (byte *)_hwscreen->pixels + (_toolbarHandler.getOffset() * _scaleFactorYm / _scaleFactorYd * dstPitch), dstPitch, toolbar_rect[0].w, toolbar_rect[0].h); SDL_UnlockSurface(toolbarSurface); SDL_UnlockSurface(_hwscreen); diff --git a/backends/vkeybd/image-map.h b/backends/vkeybd/image-map.h index 6e31720abb..269ad265cd 100644 --- a/backends/vkeybd/image-map.h +++ b/backends/vkeybd/image-map.h @@ -41,7 +41,7 @@ class ImageMap { public: ~ImageMap(); - + Polygon *createArea(const String& id); void removeArea(const String& id); void removeAllAreas(); diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp index a4b6d63aad..54b9b3d43d 100644 --- a/backends/vkeybd/virtual-keyboard-gui.cpp +++ b/backends/vkeybd/virtual-keyboard-gui.cpp @@ -62,31 +62,31 @@ static void blit(Graphics::Surface *surf_dst, Graphics::Surface *surf_src, int16 int dstAdd = surf_dst->w - blitW; int srcAdd = surf_src->w - blitW; - for (int i = 0; i < blitH; ++i) { - for (int j = 0; j < blitW; ++j, ++dst, ++src) { + for (int i = 0; i < blitH; ++i) { + for (int j = 0; j < blitW; ++j, ++dst, ++src) { OverlayColor col = *src; if (col != transparent) *dst = col; } dst += dstAdd; - src += srcAdd; + src += srcAdd; } } VirtualKeyboardGUI::VirtualKeyboardGUI(VirtualKeyboard *kbd) - : _kbd(kbd), _displaying(false), _drag(false), - _drawCaret(false), _displayEnabled(false), _firstRun(true), + : _kbd(kbd), _displaying(false), _drag(false), + _drawCaret(false), _displayEnabled(false), _firstRun(true), _cursorAnimateTimer(0), _cursorAnimateCounter(0) { - + assert(_kbd); assert(g_system); _system = g_system; - + _lastScreenChanged = _system->getScreenChangeID(); _screenW = _system->getOverlayWidth(); _screenH = _system->getOverlayHeight(); - + memset(_cursor, 0xFF, sizeof(_cursor)); } @@ -138,7 +138,7 @@ bool VirtualKeyboardGUI::fontIsSuitable(const Graphics::Font *font, const Rect& void VirtualKeyboardGUI::checkScreenChanged() { if (_lastScreenChanged != _system->getScreenChangeID()) - screenChanged(); + screenChanged(); } void VirtualKeyboardGUI::initSize(int16 w, int16 h) { @@ -297,7 +297,7 @@ void VirtualKeyboardGUI::mainLoop() { break; case Common::EVENT_MOUSEMOVE: if (_drag) - move(event.mouse.x - _dragPoint.x, + move(event.mouse.x - _dragPoint.x, event.mouse.y - _dragPoint.y); break; case Common::EVENT_SCREEN_CHANGED: @@ -349,7 +349,7 @@ void VirtualKeyboardGUI::redraw() { int16 w = _dirtyRect.width(); int16 h = _dirtyRect.height(); if (w <= 0 || h <= 0) return; - + Graphics::Surface surf; surf.create(w, h, sizeof(OverlayColor)); @@ -362,17 +362,17 @@ void VirtualKeyboardGUI::redraw() { src += _overlayBackup.w; } - blit(&surf, _kbdSurface, _kbdBound.left - _dirtyRect.left, + blit(&surf, _kbdSurface, _kbdBound.left - _dirtyRect.left, _kbdBound.top - _dirtyRect.top, _kbdTransparentColor); if (_displayEnabled) { - blit(&surf, &_dispSurface, _dispX - _dirtyRect.left, + blit(&surf, &_dispSurface, _dispX - _dirtyRect.left, _dispY - _dirtyRect.top, _dispBackColor); } - _system->copyRectToOverlay((OverlayColor*)surf.pixels, surf.w, + _system->copyRectToOverlay((OverlayColor*)surf.pixels, surf.w, _dirtyRect.left, _dirtyRect.top, surf.w, surf.h); surf.free(); - + resetDirtyRect(); } @@ -390,7 +390,7 @@ void VirtualKeyboardGUI::animateCaret() { if (_system->getMillis() % kCaretBlinkTime < kCaretBlinkTime / 2) { if (!_drawCaret) { - _drawCaret = true; + _drawCaret = true; _dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor); extendDirtyRect(Rect(_dispX + _caretX, _dispY, _dispX + _caretX + 1, _dispY + _dispSurface.h)); } @@ -412,17 +412,17 @@ void VirtualKeyboardGUI::updateDisplay() { uint dispTextEnd; if (_dispI > cursorPos) _dispI = cursorPos; - + dispTextEnd = calculateEndIndex(wholeText, _dispI); while (cursorPos > dispTextEnd) dispTextEnd = calculateEndIndex(wholeText, ++_dispI); - + String dispText = String(wholeText.c_str() + _dispI, wholeText.c_str() + dispTextEnd); // draw to display surface _dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor); _dispFont->drawString(&_dispSurface, dispText, 0, 0, _dispSurface.w, _dispForeColor); - + String beforeCaret(wholeText.c_str() + _dispI, wholeText.c_str() + cursorPos); _caretX = _dispFont->getStringWidth(beforeCaret); if (_drawCaret) _dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor); diff --git a/backends/vkeybd/virtual-keyboard-gui.h b/backends/vkeybd/virtual-keyboard-gui.h index 7c2e4a88a6..bd6f72d64a 100644 --- a/backends/vkeybd/virtual-keyboard-gui.h +++ b/backends/vkeybd/virtual-keyboard-gui.h @@ -62,9 +62,9 @@ public: /** * Interrupts the event loop and resets the overlay to its initial state. - */ + */ void close(); - + bool isDisplaying() { return _displaying; } /** @@ -73,7 +73,7 @@ public: void reset(); /** - * Activates drag mode. Takes the keyboard-relative coordinates of the + * Activates drag mode. Takes the keyboard-relative coordinates of the * cursor as an argument. */ void startDrag(int16 x, int16 y); @@ -82,16 +82,16 @@ public: * Deactivates drag mode * */ void endDrag(); - + /** - * Checks for a screen change in the backend and re-inits the virtual + * Checks for a screen change in the backend and re-inits the virtual * keyboard if it has. */ void checkScreenChanged(); - + /** * Sets the GUI's internal screen size variables - */ + */ void initSize(int16 w, int16 h); private: diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp index 73575d0d9a..3e40ffc1fa 100644 --- a/backends/vkeybd/virtual-keyboard-parser.cpp +++ b/backends/vkeybd/virtual-keyboard-parser.cpp @@ -38,7 +38,7 @@ namespace Common { -VirtualKeyboardParser::VirtualKeyboardParser(VirtualKeyboard *kbd) +VirtualKeyboardParser::VirtualKeyboardParser(VirtualKeyboard *kbd) : XMLParser(), _keyboard(kbd) { } @@ -59,7 +59,7 @@ bool VirtualKeyboardParser::closedKeyCallback(ParserNode *node) { return parserError("Initial mode of keyboard pack not defined"); } else if (node->name.equalsIgnoreCase("mode")) { if (!_layoutParsed) { - return parserError("'%s' layout missing from '%s' mode", + return parserError("'%s' layout missing from '%s' mode", _mode->resolution.c_str(), _mode->name.c_str()); } } @@ -119,7 +119,7 @@ bool VirtualKeyboardParser::parserCallback_mode(ParserNode *node) { String resolutions = node->values["resolutions"]; StringTokenizer tok (resolutions, " ,"); - // select best resolution simply by minimising the difference between the + // select best resolution simply by minimising the difference between the // overlay size and the resolution dimensions. // TODO: improve this by giving preference to a resolution that is smaller // than the overlay res (so the keyboard can't be too big for the screen) @@ -200,7 +200,7 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) { delete evt; return parserError("Key modifier element must contain modifier attributes"); } - + evt->type = VirtualKeyboard::kVKEventModifier; byte *flags = (byte*) malloc(sizeof(byte)); *(flags) = parseFlags(node->values["modifiers"]); diff --git a/backends/vkeybd/virtual-keyboard-parser.h b/backends/vkeybd/virtual-keyboard-parser.h index 12adcd61c2..eeea1995c7 100644 --- a/backends/vkeybd/virtual-keyboard-parser.h +++ b/backends/vkeybd/virtual-keyboard-parser.h @@ -38,13 +38,13 @@ ** Virtual Keyboard Pack File Format ** *************************************** -The new virtual keyboard for ScummVM is implemented in the same way as a HTML -ImageMap. It uses a single bitmap of the entire keyboard layout and then a -image map description allows certain areas of the bitmap to be given special -actions. Most of these actions will be a virtual key press event, but there -will also be special keys that will change the keyboard layout or close the +The new virtual keyboard for ScummVM is implemented in the same way as a HTML +ImageMap. It uses a single bitmap of the entire keyboard layout and then a +image map description allows certain areas of the bitmap to be given special +actions. Most of these actions will be a virtual key press event, but there +will also be special keys that will change the keyboard layout or close the keyboard. The HTML image map description is contained in a larger XML file that -can describe all the different modes of the keyboard, and also different +can describe all the different modes of the keyboard, and also different keyboard layouts for different screen resolutions. ******************************************** @@ -92,7 +92,7 @@ keyboard layouts for different screen resolutions. <keyboard> -This is the required, root element of the file format. +This is the required, root element of the file format. required attributes: - initial_mode: name of the mode the keyboard will show initially @@ -108,12 +108,12 @@ child tags: <mode> -This tag encapsulates a single mode of the keyboard. Within are a number of +This tag encapsulates a single mode of the keyboard. Within are a number of layouts, which provide the specific implementation at different resolutions. required attributes: - - name: the name of the mode - - resolutions: list of the different layout resolutions + - name: the name of the mode + - resolutions: list of the different layout resolutions child tags: - layout @@ -129,12 +129,12 @@ same as an event's name. required attributes: - name: name of the event - - type: key | modifier | switch_mode | submit | cancel | clear | delete | + - type: key | modifier | switch_mode | submit | cancel | clear | delete | move_left | move_right - see VirtualKeyboard::EventType for explanation for key events - code / ascii: describe a key press in ScummVM KeyState format for key and modifier events - - modifiers: modifier keystate as comma-separated list of shift, ctrl and/or + - modifiers: modifier keystate as comma-separated list of shift, ctrl and/or alt. for switch_mode events - mode: name of the mode that should be switched to @@ -148,8 +148,8 @@ required attributes: - resolution: the screen resolution that this layout is designed for - bitmap: filename of the 24-bit bitmap that will be used for this layout -optional attributes: - - transparent_color: color in r,g,b format that will be used for keycolor +optional attributes: + - transparent_color: color in r,g,b format that will be used for keycolor transparency (defaults to (255,0,255). - display_font_color: color in r,g,b format that will be used for the text of the keyboard display (defaults to (0,0,0). @@ -161,13 +161,13 @@ child nodes: <map> -These tags describe the image map for a particular layout. It uses the same -format as HTML image maps. The only area shapes that are supported are +These tags describe the image map for a particular layout. It uses the same +format as HTML image maps. The only area shapes that are supported are rectangles and polygons. The target attribute of each area should be the name of an event for this mode (see <event> tag). They will usually be generated by -an external tool such as GIMP's Image Map plugin, and so will not be written -by hand, but for more information on HTML image map format see - - http://www.w3schools.com/TAGS/tag_map.asp +an external tool such as GIMP's Image Map plugin, and so will not be written +by hand, but for more information on HTML image map format see + - http://www.w3schools.com/TAGS/tag_map.asp - http://www.w3schools.com/TAGS/tag_area.asp */ @@ -177,21 +177,21 @@ namespace Common { /** * Subclass of Common::XMLParser that parses the virtual keyboard pack * description file - */ + */ class VirtualKeyboardParser : public XMLParser { public: /** - * Enum dictating how extensive a parse will be + * Enum dictating how extensive a parse will be */ enum ParseMode { /** * Full parse - when loading keyboard pack for first time */ - kParseFull, - /** - * Just check resolutions and reload layouts if needed - following a + kParseFull, + /** + * Just check resolutions and reload layouts if needed - following a * change in screen size */ kParseCheckResolutions diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp index 1314ab7370..a95b79d213 100644 --- a/backends/vkeybd/virtual-keyboard.cpp +++ b/backends/vkeybd/virtual-keyboard.cpp @@ -97,7 +97,7 @@ bool VirtualKeyboard::loadKeyboardPack(String packName) { // uncompressed keyboard pack if (!_parser->loadFile(vkDir.getChild(packName + ".xml"))) return false; - + } else if (vkDir.getChild(packName + ".zip").exists()) { // compressed keyboard pack #ifdef USE_ZLIB @@ -239,7 +239,7 @@ void VirtualKeyboard::close(bool submit) { _kbdGUI->close(); } -bool VirtualKeyboard::isDisplaying() { +bool VirtualKeyboard::isDisplaying() { return _kbdGUI->isDisplaying(); } @@ -359,7 +359,7 @@ void VirtualKeyboard::KeyPressQueue::clear() { _strChanged = true; } -bool VirtualKeyboard::KeyPressQueue::empty() { +bool VirtualKeyboard::KeyPressQueue::empty() { return _keys.empty(); } diff --git a/backends/vkeybd/virtual-keyboard.h b/backends/vkeybd/virtual-keyboard.h index 4fdcb8b453..e3a9cd3600 100644 --- a/backends/vkeybd/virtual-keyboard.h +++ b/backends/vkeybd/virtual-keyboard.h @@ -54,7 +54,7 @@ class VirtualKeyboardParser; * This includes storage of the virtual key press events when the user clicks * a key and delivery of them when the keyboard is closed, as well as managing * the internal state of the keyboard, such as its active mode. - */ + */ class VirtualKeyboard { protected: @@ -73,7 +73,7 @@ protected: kVKEventSubmit, /** Close the keyboard, without submitting keypresses */ kVKEventCancel, - /** Clear the virtual keypress queue */ + /** Clear the virtual keypress queue */ kVKEventClear, /** Move the keypress queue insert position backwards */ kVKEventMoveLeft, @@ -87,23 +87,23 @@ protected: struct VKEvent { String name; VKEventType type; - /** + /** * Void pointer that will point to different types of data depending * on the type of the event, these are: * - KeyState struct for kVKEventKey events * - a flags byte for kVKEventModifier events * - c-string stating the name of the new mode for kSwitchMode events - */ + */ void *data; - + VKEvent() : data(0) {} ~VKEvent() { if (data) free(data); } }; - - typedef HashMap<String, VKEvent*> VKEventMap; + + typedef HashMap<String, VKEvent*> VKEventMap; /** * Mode struct encapsulates all the data for each mode of the keyboard @@ -122,7 +122,7 @@ protected: Mode() : image(0) {} ~Mode() { delete image; } }; - + typedef HashMap<String, Mode, IgnoreCase_Hash, IgnoreCase_EqualTo> ModeMap; enum HorizontalAlignment { @@ -143,7 +143,7 @@ protected: uint strLen; }; - /** + /** * Class that stores the queue of virtual key presses, as well as * maintaining a string that represents a preview of the queue */ @@ -182,11 +182,11 @@ public: VirtualKeyboard(); virtual ~VirtualKeyboard(); - + /** * Loads the keyboard pack with the given name. - * The system first looks for an uncompressed keyboard pack by searching - * for packName.xml in the filesystem, if this does not exist then it + * The system first looks for an uncompressed keyboard pack by searching + * for packName.xml in the filesystem, if this does not exist then it * searches for a compressed keyboard pack by looking for packName.zip. * @param packName name of the keyboard pack */ @@ -201,7 +201,7 @@ public: /** * Hides the keyboard, ending the event loop. - * @param submit if true all accumulated key presses are submitted to + * @param submit if true all accumulated key presses are submitted to * the event manager */ void close(bool submit); @@ -218,7 +218,7 @@ public: return _loaded; } -protected: +protected: OSystem *_system; Archive *_fileArchive; @@ -227,7 +227,7 @@ protected: VirtualKeyboardGUI *_kbdGUI; KeyPressQueue _keyQueue; - + friend class VirtualKeyboardParser; VirtualKeyboardParser *_parser; |