diff options
author | Eugene Sandulenko | 2016-10-09 15:02:02 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-09 15:02:02 +0200 |
commit | 355c4fa646c375c2ac42450871ff3d9221d1719d (patch) | |
tree | 81ef00feaedcd66821c56b7ae576ca068f8c997b /backends | |
parent | dead4aa01446da2bf711e64a4e681be460fa1202 (diff) | |
download | scummvm-rg350-355c4fa646c375c2ac42450871ff3d9221d1719d.tar.gz scummvm-rg350-355c4fa646c375c2ac42450871ff3d9221d1719d.tar.bz2 scummvm-rg350-355c4fa646c375c2ac42450871ff3d9221d1719d.zip |
JANITORIAL: Remove more trailing spaces
Diffstat (limited to 'backends')
34 files changed, 141 insertions, 141 deletions
diff --git a/backends/audiocd/macosx/macosx-audiocd.h b/backends/audiocd/macosx/macosx-audiocd.h index 55b8c7b8c6..42edd5de4f 100644 --- a/backends/audiocd/macosx/macosx-audiocd.h +++ b/backends/audiocd/macosx/macosx-audiocd.h @@ -58,4 +58,4 @@ AudioCDManager *createMacOSXAudioCDManager(); #endif -#endif // +#endif // diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp index 6c057efdb7..b3cde308b9 100644 --- a/backends/audiocd/win32/win32-audiocd.cpp +++ b/backends/audiocd/win32/win32-audiocd.cpp @@ -385,4 +385,4 @@ AudioCDManager *createWin32AudioCDManager() { return new Win32AudioCDManager(); } -#endif // WIN32
\ No newline at end of file +#endif // WIN32 diff --git a/backends/events/androidsdl/androidsdl-events.cpp b/backends/events/androidsdl/androidsdl-events.cpp index 18e696a897..c8a730aa8e 100644 --- a/backends/events/androidsdl/androidsdl-events.cpp +++ b/backends/events/androidsdl/androidsdl-events.cpp @@ -84,7 +84,7 @@ bool AndroidSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { int AndroidSdlEventSource::mapKey(SDLKey sdlKey, SDLMod mod, Uint16 unicode) { Common::KeyCode key = SDLToOSystemKeycode(sdlKey); - + if (key >= Common::KEYCODE_F1 && key <= Common::KEYCODE_F9) { return key - Common::KEYCODE_F1 + Common::ASCII_F1; } else if (key >= Common::KEYCODE_KP0 && key <= Common::KEYCODE_KP9) { diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 746ae6a5a0..ce5715210a 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -267,7 +267,7 @@ bool POSIXFilesystemNode::create(bool isDir) { } } - if (success) { + if (success) { setFlags(); if (_isValid) { if (_isDirectory != isDir) warning("failed to create %s: got %s", isDir ? "directory" : "file", _isDirectory ? "directory" : "file"); diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp index 46041bf499..e036b75019 100644 --- a/backends/fs/wii/wii-fs.cpp +++ b/backends/fs/wii/wii-fs.cpp @@ -168,7 +168,7 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi if (newPath.lastChar() != '/') newPath += '/'; newPath += pent->d_name; - + bool isDir = false; tmpdir = opendir(newPath.c_str()); if(tmpdir) @@ -176,17 +176,17 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi isDir = true; closedir(tmpdir); } - + if ((mode == Common::FSNode::kListFilesOnly && isDir) || (mode == Common::FSNode::kListDirectoriesOnly && !isDir)) continue; - + struct stat st; st.st_mode = 0; st.st_mode |= ( isDir ? S_IFDIR : 0 ); st.st_mode |= S_IRUSR; st.st_mode |= S_IWUSR; - + list.push_back(new WiiFilesystemNode(newPath, &st)); } diff --git a/backends/platform/3ds/config.cpp b/backends/platform/3ds/config.cpp index 117b979d9f..bfadc5ac06 100644 --- a/backends/platform/3ds/config.cpp +++ b/backends/platform/3ds/config.cpp @@ -57,7 +57,7 @@ void loadConfig() { config.stretchToFit = confGetBool("stretchtofit", false); config.sensitivity = confGetInt("sensitivity", -5); config.screen = confGetInt("screen", kScreenBoth); - + // Turn off the backlight of any screen not used if (R_SUCCEEDED(gspLcdInit())) { if (config.screen == kScreenTop) { @@ -70,7 +70,7 @@ void loadConfig() { GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTH); gspLcdExit(); } - + OSystem_3DS *osys = (OSystem_3DS *)g_system; osys->updateConfig(); } diff --git a/backends/platform/3ds/config.h b/backends/platform/3ds/config.h index c8b75736ad..02560b2040 100644 --- a/backends/platform/3ds/config.h +++ b/backends/platform/3ds/config.h @@ -26,7 +26,7 @@ #include "common/str.h" namespace _3DS { - + struct Config { bool showCursor; bool snapToBorder; diff --git a/backends/platform/3ds/gui.h b/backends/platform/3ds/gui.h index 66c6547139..8e82c6c851 100644 --- a/backends/platform/3ds/gui.h +++ b/backends/platform/3ds/gui.h @@ -33,7 +33,7 @@ public: protected: virtual void close(); - + uint32 _timer; static StatusMessageDialog* _opened; }; diff --git a/backends/platform/3ds/main.cpp b/backends/platform/3ds/main.cpp index 6cc2c5cf5d..e9046d7c28 100644 --- a/backends/platform/3ds/main.cpp +++ b/backends/platform/3ds/main.cpp @@ -41,13 +41,13 @@ int main(int argc, char *argv[]) { scummvm_main(0, nullptr); delete dynamic_cast<_3DS::OSystem_3DS*>(g_system); - + // Turn on both screen backlights before exiting. if (R_SUCCEEDED(gspLcdInit())) { GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTH); gspLcdExit(); } - + cfguExit(); gfxExit(); return 0; diff --git a/backends/platform/3ds/options-dialog.cpp b/backends/platform/3ds/options-dialog.cpp index 0f8bfd0c66..60fe7f818f 100644 --- a/backends/platform/3ds/options-dialog.cpp +++ b/backends/platform/3ds/options-dialog.cpp @@ -33,11 +33,11 @@ #include "common/translation.h" namespace _3DS { - + bool optionMenuOpened = false; OptionsDialog::OptionsDialog() : GUI::Dialog(20, 20, 280, 200) { - + optionMenuOpened = true; new GUI::ButtonWidget(this, 120, 180, 72, 16, _("~C~lose"), 0, GUI::kCloseCmd); @@ -45,10 +45,10 @@ OptionsDialog::OptionsDialog() : GUI::Dialog(20, 20, 280, 200) { _showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 5, 130, 20, _("Show mouse cursor"), 0, 0, 'T'); _showCursorCheckbox->setState(config.showCursor); - + _snapToBorderCheckbox = new GUI::CheckboxWidget(this, 5, 22, 130, 20, _("Snap to edges"), 0, 0, 'T'); _snapToBorderCheckbox->setState(config.snapToBorder); - + _stretchToFitCheckbox = new GUI::CheckboxWidget(this, 140, 5, 130, 20, _("Stretch to fit"), 0, 0, 'T'); _stretchToFitCheckbox->setState(config.stretchToFit); diff --git a/backends/platform/3ds/options-dialog.h b/backends/platform/3ds/options-dialog.h index 6673b88e7b..d8c0d7bc7d 100644 --- a/backends/platform/3ds/options-dialog.h +++ b/backends/platform/3ds/options-dialog.h @@ -33,7 +33,7 @@ #include "scumm/dialogs.h" namespace _3DS { - + enum { kSave = 0x10000000, kScreenRadioGroup, @@ -41,7 +41,7 @@ enum { kScreenBottom, kScreenBoth, }; - + extern bool optionMenuOpened; class OptionsDialog : public GUI::Dialog { diff --git a/backends/platform/3ds/osystem-audio.cpp b/backends/platform/3ds/osystem-audio.cpp index 17e419c36d..58262372cc 100644 --- a/backends/platform/3ds/osystem-audio.cpp +++ b/backends/platform/3ds/osystem-audio.cpp @@ -41,31 +41,31 @@ static void audioThreadFunc(void *arg) { uint32 lastTime = osys->getMillis(true); uint32 time = lastTime; ndspWaveBuf buffers[bufferCount]; - + for (i = 0; i < bufferCount; ++i) { memset(&buffers[i], 0, sizeof(ndspWaveBuf)); buffers[i].data_vaddr = linearAlloc(bufferSize); buffers[i].looping = false; buffers[i].status = NDSP_WBUF_FREE; } - + ndspChnReset(channel); ndspChnSetInterp(channel, NDSP_INTERP_LINEAR); ndspChnSetRate(channel, sampleRate); ndspChnSetFormat(channel, NDSP_FORMAT_STEREO_PCM16); - while (!osys->exiting) { + while (!osys->exiting) { osys->delayMillis(100); // Note: Increasing the delay requires a bigger buffer - + time = osys->getMillis(true); sampleLen = (time - lastTime) * 22 * 4; // sampleRate / 1000 * channelCount * sizeof(int16); lastTime = time; - + if (!osys->sleeping && sampleLen > 0) { bufferIndex++; bufferIndex %= bufferCount; ndspWaveBuf *buf = &buffers[bufferIndex]; - + buf->nsamples = mixer->mixCallback(buf->data_adpcm, sampleLen); if (buf->nsamples > 0) { DSP_FlushDataCache(buf->data_vaddr, bufferSize); @@ -73,14 +73,14 @@ static void audioThreadFunc(void *arg) { } } } - + for (i = 0; i < bufferCount; ++i) linearFree(buffers[i].data_pcm8); } void OSystem_3DS::initAudio() { _mixer = new Audio::MixerImpl(this, 22050); - + hasAudio = R_SUCCEEDED(ndspInit()); _mixer->setReady(false); @@ -97,7 +97,7 @@ void OSystem_3DS::destroyAudio() { threadFree(audioThread); ndspExit(); } - + delete _mixer; _mixer = 0; } diff --git a/backends/platform/3ds/osystem-events.cpp b/backends/platform/3ds/osystem-events.cpp index ae8a9b8b2b..064540fa66 100644 --- a/backends/platform/3ds/osystem-events.cpp +++ b/backends/platform/3ds/osystem-events.cpp @@ -44,7 +44,7 @@ static void pushEventQueue(Common::Queue<Common::Event> *queue, Common::Event &e static void eventThreadFunc(void *arg) { OSystem_3DS *osys = (OSystem_3DS *)g_system; auto eventQueue = (Common::Queue<Common::Event> *)arg; - + uint32 touchStartTime = osys->getMillis(); touchPosition lastTouch = {0, 0}; bool isRightClick = false; @@ -55,19 +55,19 @@ static void eventThreadFunc(void *arg) { int circleDeadzone = 20; int borderSnapZone = 6; Common::Event event; - + while (!osys->exiting) { do { osys->delayMillis(10); } while (osys->sleeping && !osys->exiting); - + hidScanInput(); touchPosition touch; circlePosition circle; u32 held = hidKeysHeld(); u32 keysPressed = hidKeysDown(); u32 keysReleased = hidKeysUp(); - + // C-Pad used to control the cursor hidCircleRead(&circle); if (circle.dx < circleDeadzone && circle.dx > -circleDeadzone) @@ -76,7 +76,7 @@ static void eventThreadFunc(void *arg) { circle.dy = 0; cursorDeltaX = (0.0002f + config.sensitivity / 100000.f) * circle.dx * abs(circle.dx); cursorDeltaY = (0.0002f + config.sensitivity / 100000.f) * circle.dy * abs(circle.dy); - + // Touch screen events if (held & KEY_TOUCH) { hidTouchRead(&touch); @@ -97,7 +97,7 @@ static void eventThreadFunc(void *arg) { osys->warpMouse(touch.px, touch.py); event.mouse.x = touch.px; event.mouse.y = touch.py; - + if (keysPressed & KEY_TOUCH) { touchStartTime = osys->getMillis(); isRightClick = (held & KEY_X || held & KEY_DUP); @@ -109,7 +109,7 @@ static void eventThreadFunc(void *arg) { event.type = Common::EVENT_MOUSEMOVE; pushEventQueue(eventQueue, event); } - + lastTouch = touch; } else if (keysReleased & KEY_TOUCH) { event.mouse.x = lastTouch.px; @@ -136,13 +136,13 @@ static void eventThreadFunc(void *arg) { lastTouch.px = cursorX; lastTouch.py = cursorY; osys->transformPoint(lastTouch); - osys->warpMouse(lastTouch.px, lastTouch.py); + osys->warpMouse(lastTouch.px, lastTouch.py); event.mouse.x = lastTouch.px; event.mouse.y = lastTouch.py; event.type = Common::EVENT_MOUSEMOVE; pushEventQueue(eventQueue, event); } - + // Button events if (keysPressed & KEY_R) { if (inputMode == MODE_DRAG) { @@ -195,7 +195,7 @@ static void eventThreadFunc(void *arg) { event.kbd.flags = 0; pushEventQueue(eventQueue, event); } - + // TODO: EVENT_PREDICTIVE_DIALOG // EVENT_SCREEN_CHANGED } @@ -203,7 +203,7 @@ static void eventThreadFunc(void *arg) { static void aptHookFunc(APT_HookType hookType, void *param) { OSystem_3DS *osys = (OSystem_3DS *)g_system; - + switch (hookType) { case APTHOOK_ONSUSPEND: case APTHOOK_ONSLEEP: @@ -246,7 +246,7 @@ void OSystem_3DS::initEvents() { svcGetThreadPriority(&prio, CUR_THREAD_HANDLE); _timerThread = threadCreate(&timerThreadFunc, this, 32 * 1024, prio - 1, -2, false); _eventThread = threadCreate(&eventThreadFunc, &_eventQueue, 32 * 1024, prio - 1, -2, false); - + aptHook(&cookie, aptHookFunc, this); } @@ -277,7 +277,7 @@ bool OSystem_3DS::pollEvent(Common::Event &event) { StatusMessageDialog dialog(messageOSD, 800); dialog.runModal(); } - + aptMainLoop(); // Call apt hook when necessary if (optionMenuOpening) { @@ -289,12 +289,12 @@ bool OSystem_3DS::pollEvent(Common::Event &event) { if (g_engine) g_engine->pauseEngine(false); } - + Common::StackLock lock(*eventMutex); - + if (_eventQueue.empty()) return false; - + event = _eventQueue.pop(); return true; } diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp index 0cfd70c9cd..ec60956805 100644 --- a/backends/platform/3ds/osystem-graphics.cpp +++ b/backends/platform/3ds/osystem-graphics.cpp @@ -35,7 +35,7 @@ GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO)) namespace _3DS { - + void OSystem_3DS::initGraphics() { _pfGame = Graphics::PixelFormat::createFormatCLUT8(); _pfGameTexture = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); @@ -60,23 +60,23 @@ void OSystem_3DS::initGraphics() { shaderProgramInit(&_program); shaderProgramSetVsh(&_program, &_dvlb->DVLE[0]); C3D_BindProgram(&_program); - + _projectionLocation = shaderInstanceGetUniformLocation(_program.vertexShader, "projection"); _modelviewLocation = shaderInstanceGetUniformLocation(_program.vertexShader, "modelView"); - + C3D_AttrInfo *attrInfo = C3D_GetAttrInfo(); AttrInfo_Init(attrInfo); AttrInfo_AddLoader(attrInfo, 0, GPU_FLOAT, 3); // v0=position AttrInfo_AddLoader(attrInfo, 1, GPU_FLOAT, 2); // v1=texcoord - + Mtx_OrthoTilt(&_projectionTop, 0.0, 400.0, 240.0, 0.0, 0.0, 1.0); Mtx_OrthoTilt(&_projectionBottom, 0.0, 320.0, 240.0, 0.0, 0.0, 1.0); - + C3D_TexEnv *env = C3D_GetTexEnv(0); C3D_TexEnvSrc(env, C3D_Both, GPU_TEXTURE0, 0, 0); C3D_TexEnvOp(env, C3D_Both, 0, 0, 0); C3D_TexEnvFunc(env, C3D_Both, GPU_REPLACE); - + C3D_DepthTest(false, GPU_GEQUAL, GPU_WRITE_ALL); C3D_CullFace(GPU_CULL_NONE); } @@ -148,14 +148,14 @@ void OSystem_3DS::initSize(uint width, uint height, _gameHeight = height; _gameTopTexture.create(width, height, _pfGameTexture); _overlay.create(getOverlayWidth(), getOverlayHeight(), _pfGameTexture); - + if (format) { debug("pixelformat: %d %d %d %d %d", format->bytesPerPixel, format->rBits(), format->gBits(), format->bBits(), format->aBits());; _pfGame = *format; } _gameScreen.create(width, height, _pfGame); - + _focusDirty = true; _focusRect = Common::Rect(_gameWidth, _gameHeight); @@ -169,7 +169,7 @@ void OSystem_3DS::updateSize() { _gameBottomTexture.setScale(320.f / _gameWidth, 240.f / _gameHeight); } else { float ratio = static_cast<float>(_gameWidth) / _gameHeight; - + if (ratio > 400.f / 240.f) { float r = 400.f / _gameWidth; _gameTopTexture.setScale(r, r); @@ -224,7 +224,7 @@ OSystem::TransactionError OSystem_3DS::endGFXTransaction() { void OSystem_3DS::setPalette(const byte *colors, uint start, uint num) { assert(start + num <= 256); memcpy(_palette + 3 * start, colors, 3 * num); - + // Manually update all color that were changed if (_gameScreen.format.bytesPerPixel == 1) { flushGameScreen(); @@ -240,10 +240,10 @@ void OSystem_3DS::copyRectToScreen(const void *buf, int pitch, int x, Common::Rect rect(x, y, x+w, y+h); _gameScreen.copyRectToSurface(buf, pitch, x, y, w, h); Graphics::Surface subSurface = _gameScreen.getSubArea(rect); - + Graphics::Surface *convertedSubSurface = subSurface.convertTo(_pfGameTexture, _palette); _gameTopTexture.copyRectToSurface(*convertedSubSurface, x, y, Common::Rect(w, h)); - + convertedSubSurface->free(); delete convertedSubSurface; _gameTopTexture.markDirty(); @@ -268,7 +268,7 @@ void OSystem_3DS::updateScreen() { if (sleeping || exiting) return; - + // updateFocus(); C3D_FrameBegin(C3D_FRAME_SYNCDRAW); @@ -288,7 +288,7 @@ void OSystem_3DS::updateScreen() { _cursorTexture.render(); } } - + // Render bottom screen C3D_FrameDrawOn(_renderTargetBottom); if (config.screen == kScreenBottom || config.screen == kScreenBoth) { @@ -327,7 +327,7 @@ void OSystem_3DS::clearFocusRectangle() { } void OSystem_3DS::updateFocus() { - + if (_focusClearTime && getMillis() - _focusClearTime > 5000) { _focusClearTime = 0; _focusDirty = true; @@ -361,26 +361,26 @@ void OSystem_3DS::updateFocus() { _focusStepScaleX = duration * (_focusTargetScaleX - _focusScaleX); _focusStepScaleY = duration * (_focusTargetScaleY - _focusScaleY); } - + if (_focusDirty || _focusPosX != _focusTargetPosX || _focusPosY != _focusTargetPosY || _focusScaleX != _focusTargetScaleX || _focusScaleY != _focusTargetScaleY) { _focusDirty = false; - + if ((_focusStepPosX > 0 && _focusPosX > _focusTargetPosX) || (_focusStepPosX < 0 && _focusPosX < _focusTargetPosX)) _focusPosX = _focusTargetPosX; else if (_focusPosX != _focusTargetPosX) _focusPosX += _focusStepPosX; - + if ((_focusStepPosY > 0 && _focusPosY > _focusTargetPosY) || (_focusStepPosY < 0 && _focusPosY < _focusTargetPosY)) _focusPosY = _focusTargetPosY; else if (_focusPosY != _focusTargetPosY) _focusPosY += _focusStepPosY; - + if ((_focusStepScaleX > 0 && _focusScaleX > _focusTargetScaleX) || (_focusStepScaleX < 0 && _focusScaleX < _focusTargetScaleX)) _focusScaleX = _focusTargetScaleX; else if (_focusScaleX != _focusTargetScaleX) _focusScaleX += _focusStepScaleX; - + if ((_focusStepScaleY > 0 && _focusScaleY > _focusTargetScaleY) || (_focusStepScaleY < 0 && _focusScaleY < _focusTargetScaleY)) _focusScaleY = _focusTargetScaleY; else if (_focusScaleY != _focusTargetScaleY) @@ -476,10 +476,10 @@ void OSystem_3DS::setMouseCursor(const void *buf, uint w, uint h, _cursor.create(w, h, _pfCursor); _cursorTexture.create(w, h, _pfGameTexture); } - + _cursor.copyRectToSurface(buf, w, 0, 0, w, h); flushCursor(); - + warpMouse(_cursorX, _cursorY); } @@ -497,7 +497,7 @@ void OSystem_3DS::flushCursor() { _cursorTexture.markDirty(); converted->free(); delete converted; - + if (_pfCursor.bytesPerPixel == 1) { uint* dest = (uint*) _cursorTexture.getPixels(); byte* src = (byte*) _cursor.getPixels(); diff --git a/backends/platform/3ds/osystem.cpp b/backends/platform/3ds/osystem.cpp index f6278eb16b..e19ff8f8de 100644 --- a/backends/platform/3ds/osystem.cpp +++ b/backends/platform/3ds/osystem.cpp @@ -85,7 +85,7 @@ OSystem_3DS::~OSystem_3DS() { destroyEvents(); destroyAudio(); destroyGraphics(); - + delete _timerManager; _timerManager = 0; } @@ -109,7 +109,7 @@ void OSystem_3DS::initBackend() { _timerManager = new DefaultTimerManager(); _savefileManager = new DefaultSaveFileManager("/3ds/scummvm/saves/"); - + initGraphics(); initAudio(); initEvents(); diff --git a/backends/platform/3ds/osystem.h b/backends/platform/3ds/osystem.h index 478085acba..5df49fe593 100644 --- a/backends/platform/3ds/osystem.h +++ b/backends/platform/3ds/osystem.h @@ -57,12 +57,12 @@ class OSystem_3DS : public EventsBaseBackend, public PaletteManager { public: OSystem_3DS(); virtual ~OSystem_3DS(); - + volatile bool exiting; volatile bool sleeping; virtual void initBackend(); - + virtual bool hasFeature(OSystem::Feature f); virtual void setFeatureState(OSystem::Feature f, bool enable); virtual bool getFeatureState(OSystem::Feature f); @@ -72,22 +72,22 @@ public: virtual uint32 getMillis(bool skipRecord = false); virtual void delayMillis(uint msecs); virtual void getTimeAndDate(TimeDate &t) const; - + virtual MutexRef createMutex(); virtual void lockMutex(MutexRef mutex); virtual void unlockMutex(MutexRef mutex); virtual void deleteMutex(MutexRef mutex); virtual void logMessage(LogMessageType::Type type, const char *message); - + virtual Audio::Mixer *getMixer(); virtual PaletteManager *getPaletteManager() { return this; } virtual Common::String getSystemLanguage() const; virtual void fatalError(); virtual void quit(); - + virtual Common::String getDefaultConfigFileName(); - + // Graphics virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; int getDefaultGraphicsMode() const; @@ -131,16 +131,16 @@ public: int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL); void setCursorPalette(const byte *colors, uint start, uint num); - + // Transform point from touchscreen coords into gamescreen coords void transformPoint(touchPosition &point); - + void setCursorDelta(float deltaX, float deltaY); - + void updateFocus(); void updateConfig(); void updateSize(); - + private: void initGraphics(); void destroyGraphics(); @@ -148,18 +148,18 @@ private: void destroyAudio(); void initEvents(); void destroyEvents(); - + void flushGameScreen(); void flushCursor(); - + protected: Audio::MixerImpl *_mixer; - + private: u16 _gameWidth, _gameHeight; u16 _gameTopX, _gameTopY; u16 _gameBottomX, _gameBottomY; - + // Audio Thread audioThread; @@ -169,15 +169,15 @@ private: Graphics::PixelFormat _pfCursor; byte _palette[3 * 256]; byte _cursorPalette[3 * 256]; - + Graphics::Surface _gameScreen; Sprite _gameTopTexture; Sprite _gameBottomTexture; Sprite _overlay; - + int _screenShakeOffset; bool _overlayVisible; - + DVLB_s *_dvlb; shaderProgram_s _program; int _projectionLocation; @@ -186,7 +186,7 @@ private: C3D_Mtx _projectionBottom; C3D_RenderTarget* _renderTargetTop; C3D_RenderTarget* _renderTargetBottom; - + // Focus Common::Rect _focusRect; bool _focusDirty; @@ -198,12 +198,12 @@ private: float _focusTargetScaleX, _focusTargetScaleY; float _focusStepScaleX, _focusStepScaleY; uint32 _focusClearTime; - + // Events Thread _eventThread; Thread _timerThread; Common::Queue<Common::Event> _eventQueue; - + // Cursor Graphics::Surface _cursor; Sprite _cursorTexture; diff --git a/backends/platform/3ds/sprite.cpp b/backends/platform/3ds/sprite.cpp index f97c611473..842729c051 100644 --- a/backends/platform/3ds/sprite.cpp +++ b/backends/platform/3ds/sprite.cpp @@ -57,7 +57,7 @@ Sprite::~Sprite() { void Sprite::create(uint16 width, uint16 height, const Graphics::PixelFormat &f) { free(); - + actualWidth = width; actualHeight = height; format = f; @@ -73,7 +73,7 @@ void Sprite::create(uint16 width, uint16 height, const Graphics::PixelFormat &f) assert(pixels && texture.data); clear(); } - + float x = 0.f, y = 0.f; float u = (float)width/w; float v = (float)height/h; diff --git a/backends/platform/3ds/sprite.h b/backends/platform/3ds/sprite.h index 6d88ae4ce1..129c2689e7 100644 --- a/backends/platform/3ds/sprite.h +++ b/backends/platform/3ds/sprite.h @@ -46,16 +46,16 @@ public: void render(); void clear(uint32 color = 0); void markDirty(){ dirtyPixels = true; } - + void setPosition(int x, int y); void setScale(float x, float y); float getScaleX(){ return scaleX; } float getScaleY(){ return scaleY; } C3D_Mtx* getMatrix(); - + uint16 actualWidth; uint16 actualHeight; - + private: bool dirtyPixels; bool dirtyMatrix; diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp index b4a575e1f6..3d0429e098 100644 --- a/backends/platform/androidsdl/androidsdl-sdl.cpp +++ b/backends/platform/androidsdl/androidsdl-sdl.cpp @@ -28,7 +28,7 @@ void OSystem_ANDROIDSDL::initBackend() { // Create the backend custom managers - + if (_eventSource == 0) _eventSource = new AndroidSdlEventSource(); @@ -37,10 +37,10 @@ void OSystem_ANDROIDSDL::initBackend() { if (!ConfMan.hasKey("browser_lastpath")) ConfMan.set("browser_lastpath", "/storage"); - + if (!ConfMan.hasKey("gfx_mode")) ConfMan.set("gfx_mode", "2x"); - + // Call parent implementation of this method OSystem_POSIX::initBackend(); } diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h index d30e3ab177..065ea7de68 100644 --- a/backends/platform/ds/arm9/source/gbampsave.h +++ b/backends/platform/ds/arm9/source/gbampsave.h @@ -29,7 +29,7 @@ class GBAMPSaveFileManager : public Common::SaveFileManager { public: virtual void updateSavefilesList(Common::StringArray &lockedFiles); virtual Common::InSaveFile *openRawFile(const Common::String &filename); - + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual Common::InSaveFile *openForLoading(const Common::String &filename); diff --git a/backends/platform/ios7/ios7_osys_events.cpp b/backends/platform/ios7/ios7_osys_events.cpp index 3621c084db..da467cf5d6 100644 --- a/backends/platform/ios7/ios7_osys_events.cpp +++ b/backends/platform/ios7/ios7_osys_events.cpp @@ -91,16 +91,16 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) { if (!handleEvent_secondMouseUp(event, internalEvent.value1, internalEvent.value2)) return false; break; - + case kInputKeyPressed: handleEvent_keyPressed(event, internalEvent.value1); break; - + case kInputSwipe: if (!handleEvent_swipe(event, internalEvent.value1, internalEvent.value2)) return false; break; - + case kInputTap: if (!handleEvent_tap(event, (UIViewTapDescription) internalEvent.value1, internalEvent.value2)) return false; @@ -109,7 +109,7 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) { default: break; } - + return true; } return false; @@ -499,14 +499,14 @@ bool OSystem_iOS7::handleEvent_swipe(Common::Event &event, int direction, int to } break; } - + event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode; event.kbd.ascii = _queuedInputEvent.kbd.ascii = 0; event.type = Common::EVENT_KEYDOWN; _queuedInputEvent.type = Common::EVENT_KEYUP; event.kbd.flags = _queuedInputEvent.kbd.flags = 0; _queuedEventTime = getMillis() + kQueuedInputEventDelay; - + return true; } else if (touches == 2) { diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index 5c0434d43e..8dbfb71b74 100644 --- a/backends/platform/ios7/ios7_video.mm +++ b/backends/platform/ios7/ios7_video.mm @@ -931,7 +931,7 @@ uint getSizeNextPOT(uint size) { CGPoint point = [touch locationInView:self]; if (![self getMouseCoords:point eventX:&x eventY:&y]) return; - + [self addEvent:InternalEvent(kInputMouseSecondDragged, x, y)]; } } diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp index 0e05047c6e..64d6e989d6 100644 --- a/backends/platform/ps2/irxboot.cpp +++ b/backends/platform/ps2/irxboot.cpp @@ -151,7 +151,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxT irxFiles = irxType[type]; numFiles = numIrx[type]; resModules = (IrxReference *)memalign(64, numFiles * sizeof(IrxReference)); - curModule = resModules; + curModule = resModules; for (int i = 0; i < numFiles; i++) { curModule->fileRef = irxFiles + i; diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 1aa74b7d9b..e914cdb9c9 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -628,7 +628,7 @@ bool OSystem_PS2::usbMassPresent(void) { } bool OSystem_PS2::netPresent(void) { - if (_useNet) + if (_useNet) return true; return false; diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp index 212af6723e..e90d459e67 100644 --- a/backends/platform/sdl/macosx/macosx.cpp +++ b/backends/platform/sdl/macosx/macosx.cpp @@ -56,7 +56,7 @@ void OSystem_MacOSX::init() { // Initialize taskbar manager _taskbarManager = new MacOSXTaskbarManager(); #endif - + // Invoke parent implementation of this method OSystem_POSIX::init(); } diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h index 929f2f91fa..72bb4a4787 100644 --- a/backends/platform/sdl/macosx/macosx.h +++ b/backends/platform/sdl/macosx/macosx.h @@ -35,7 +35,7 @@ public: virtual bool hasTextInClipboard(); virtual Common::String getTextFromClipboard(); - + virtual bool openUrl(const Common::String &url); virtual Common::String getSystemLanguage() const; diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h index e5110ff632..bd3a069d5b 100644 --- a/backends/platform/sdl/posix/posix.h +++ b/backends/platform/sdl/posix/posix.h @@ -65,7 +65,7 @@ protected: virtual Common::WriteStream *createLogFile(); virtual AudioCDManager *createAudioCDManager(); - + bool launchBrowser(const Common::String& client, const Common::String &url); }; diff --git a/backends/platform/tizen/form.cpp b/backends/platform/tizen/form.cpp index 568829dc96..2a9a3967cc 100644 --- a/backends/platform/tizen/form.cpp +++ b/backends/platform/tizen/form.cpp @@ -318,16 +318,16 @@ void TizenAppForm::invokeShortcut() { case kControlMouse: setButtonShortcut(); break; - + case kEscapeKey: pushKey(Common::KEYCODE_ESCAPE); break; - + case kGameMenu: _buttonState = kLeftButton; pushKey(Common::KEYCODE_F5); break; - + case kShowKeypad: showKeypad(); break; @@ -338,7 +338,7 @@ void TizenAppForm::showKeypad() { // display the soft keyboard if (_state == kActiveState) { _buttonState = kLeftButton; - + Common::Event e; e.type = Common::EVENT_VIRTUAL_KEYBOARD; if (_eventQueueLock) { diff --git a/backends/platform/tizen/graphics.cpp b/backends/platform/tizen/graphics.cpp index 61dbfc38fb..85dbbd2c08 100644 --- a/backends/platform/tizen/graphics.cpp +++ b/backends/platform/tizen/graphics.cpp @@ -103,7 +103,7 @@ Common::List<Graphics::PixelFormat> TizenGraphicsManager::getSupportedFormats() } bool TizenGraphicsManager::hasFeature(OSystem::Feature f) { - bool result = + bool result = (f == OSystem::kFeatureVirtualKeyboard || OpenGLGraphicsManager::hasFeature(f)); return result; diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index a958974209..d1fdabeec9 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -181,7 +181,7 @@ bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) { assureCached(getSavePath()); if (getError().getCode() != Common::kNoError) return false; - + #ifdef USE_LIBCURL // Update file's timestamp Common::HashMap<Common::String, uint32> timestamps = loadTimestamps(); diff --git a/backends/taskbar/macosx/dockplugin/dockplugin.m b/backends/taskbar/macosx/dockplugin/dockplugin.m index 9d864ef2a8..95f961a39d 100644 --- a/backends/taskbar/macosx/dockplugin/dockplugin.m +++ b/backends/taskbar/macosx/dockplugin/dockplugin.m @@ -72,7 +72,7 @@ NSString *gameId = [recentGame valueForKey:@"game"]; NSString *desc = [recentGame valueForKey:@"description"]; NSString *iconFile = [recentGame valueForKey:@"icon"]; - + StartGameMenuItem *menuItem = [[StartGameMenuItem alloc] initWithGame:gameId description:desc icon:iconFile]; [recentGamesMenu addItem:menuItem]; [menuItem release]; @@ -88,7 +88,7 @@ - (NSMenuItem*)initWithGame:(NSString *)gameId description:(NSString*)desc icon:(NSString*)iconFile { self = [super initWithTitle:(desc == nil ? gameId : desc) action:@selector(startGame) keyEquivalent:@""]; [self setTarget:self]; - + if (iconFile != nil) { NSImage *image = [[NSImage alloc] initWithContentsOfFile:iconFile]; [self setImage:image]; @@ -97,7 +97,7 @@ game = gameId; [game retain]; - + return self; } @@ -108,7 +108,7 @@ - (IBAction) startGame { NSLog(@"Starting Game %@...", game); - + NSString *scummVMPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"org.scummvm.scummvm"]; if (scummVMPath == nil) { NSLog(@"Cannot find ScummVM.app!"); diff --git a/backends/taskbar/macosx/macosx-taskbar.h b/backends/taskbar/macosx/macosx-taskbar.h index 55bb97a691..145cbd4f3a 100644 --- a/backends/taskbar/macosx/macosx-taskbar.h +++ b/backends/taskbar/macosx/macosx-taskbar.h @@ -40,16 +40,16 @@ public: virtual void addRecent(const Common::String &name, const Common::String &description); virtual void notifyError(); virtual void clearError(); - + private: Common::String getIconPath(const Common::String&); void initApplicationIconView(); void clearApplicationIconView(); - + void initOverlayIconView(); void clearOverlayIconView(); - + double _progress; }; diff --git a/backends/taskbar/macosx/macosx-taskbar.mm b/backends/taskbar/macosx/macosx-taskbar.mm index c842eb8090..692fa84429 100644 --- a/backends/taskbar/macosx/macosx-taskbar.mm +++ b/backends/taskbar/macosx/macosx-taskbar.mm @@ -112,11 +112,11 @@ void MacOSXTaskbarManager::setOverlayIcon(const Common::String &name, const Comm [_dockTile performSelector:@selector(display)]; return; } - + Common::String path = getIconPath(name); if (path.empty()) return; - + initOverlayIconView(); CFStringRef imageFile = CFStringCreateWithCString(0, path.c_str(), kCFStringEncodingASCII); @@ -136,7 +136,7 @@ void MacOSXTaskbarManager::setProgressValue(int completed, int total) { _progress = (double)completed / (double)total; else if (_progress < 0) _progress = 0.0; - + NSImage *mainIcon = [[NSApp applicationIconImage] copy]; double barSize = [mainIcon size].width; double progressSize = barSize * _progress; @@ -150,7 +150,7 @@ void MacOSXTaskbarManager::setProgressValue(int completed, int total) { initApplicationIconView(); [_applicationIconView setImage:mainIcon]; [mainIcon release]; - + [_dockTile performSelector:@selector(display)]; } @@ -207,50 +207,50 @@ Common::String MacOSXTaskbarManager::getIconPath(const Common::String& target) { // fallback to the extra path // // Icons can be either in a subfolder named "icons" or directly in the path - + Common::String iconsPath = ConfMan.get("iconspath"); Common::String extraPath = ConfMan.get("extrapath"); - + #define TRY_ICON_PATH(path) { \ Common::FSNode node((path)); \ if (node.exists()) \ return (path); \ } - + if (!iconsPath.empty()) { TRY_ICON_PATH(iconsPath + "/" + target + ".png"); TRY_ICON_PATH(iconsPath + "/" + ConfMan.get("gameid") + ".png"); TRY_ICON_PATH(iconsPath + "/icons/" + target + ".png"); TRY_ICON_PATH(iconsPath + "/icons/" + ConfMan.get("gameid") + ".png"); } - + if (!extraPath.empty()) { TRY_ICON_PATH(extraPath + "/" + target + ".png"); TRY_ICON_PATH(extraPath + "/" + ConfMan.get("gameid") + ".png"); TRY_ICON_PATH(extraPath + "/icons/" + target + ".png"); TRY_ICON_PATH(extraPath + "/icons/" + ConfMan.get("gameid") + ".png"); } - + return ""; } void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::String &description) { //warning("[MacOSXTaskbarManager::addRecent] Adding recent list entry: %s (%s)", name.c_str(), description.c_str()); - + if (_dockTile == nil) return; - + // Store the game, description and icon in user preferences. // The NSDockTilePlugin will retrieve them there to list them in the dock tile menu. - + CFStringRef gameName = CFStringCreateWithCString(0, name.c_str(), kCFStringEncodingASCII); CFStringRef desc = CFStringCreateWithCString(0, description.c_str(), kCFStringEncodingASCII); - + // First build the dictionary for this game. NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; [dict setObject:(NSString *)gameName forKey:@"game"]; [dict setObject:(NSString *)desc forKey:@"description"]; - + // Icon Common::String iconPath = getIconPath(name); if (!iconPath.empty()) { @@ -258,7 +258,7 @@ void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::S [dict setObject:(NSString *)icon forKey:@"icon"]; CFRelease(icon); } - + // Retrieve the current list of recent items and update it. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSArray *oldArray = [defaults arrayForKey:@"recentGames"]; diff --git a/backends/updates/win32/win32-updates.cpp b/backends/updates/win32/win32-updates.cpp index 356ff9c903..aebeab531b 100644 --- a/backends/updates/win32/win32-updates.cpp +++ b/backends/updates/win32/win32-updates.cpp @@ -55,7 +55,7 @@ Win32UpdateManager::Win32UpdateManager() { win_sparkle_set_appcast_url(appcastUrl); win_sparkle_init(); - + if (!ConfMan.hasKey("updates_check") || ConfMan.getInt("updates_check") == Common::UpdateManager::kUpdateIntervalNotSupported) { setAutomaticallyChecksForUpdates(kUpdateStateDisabled); @@ -117,7 +117,7 @@ int Win32UpdateManager::getUpdateCheckInterval() { bool Win32UpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) { time_t updateTime = win_sparkle_get_last_check_time(); tm *ut = localtime(&updateTime); - + t.tm_wday = ut->tm_wday; t.tm_year = ut->tm_year; t.tm_mon = ut->tm_mon; |