From 153576f0b51cfa2993dab6c81aaf9dc34b78ab89 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Wed, 11 Mar 2020 22:19:55 +0000 Subject: [PATCH] BACKENDS: Move implementations of hasFeature into the relevant OSystem subclasses --- .../graphics/dinguxsdl/dinguxsdl-graphics.cpp | 6 --- .../graphics/dinguxsdl/dinguxsdl-graphics.h | 1 - backends/graphics/gph/gph-graphics.cpp | 6 --- backends/graphics/gph/gph-graphics.h | 1 - .../samsungtvsdl/samsungtvsdl-graphics.cpp | 41 ------------------ .../samsungtvsdl/samsungtvsdl-graphics.h | 39 ----------------- .../symbiansdl/symbiansdl-graphics.cpp | 43 ------------------- .../graphics/symbiansdl/symbiansdl-graphics.h | 36 ---------------- backends/module.mk | 3 +- backends/platform/dingux/dingux.cpp | 7 +++ backends/platform/dingux/dingux.h | 1 + backends/platform/gph/gph-backend.cpp | 7 +++ backends/platform/gph/gph.h | 1 + backends/platform/samsungtv/samsungtv.cpp | 11 +++-- backends/platform/samsungtv/samsungtv.h | 1 + .../S60v3/ScummVM_A0000658_S60v3.mmp.in | 1 - .../symbian/S60v3/ScummVM_S60v3.mmp.in | 1 - .../symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in | 1 - .../platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in | 1 - .../platform/symbian/mmp/scummvm_base.mmp.in | 1 - backends/platform/symbian/src/SymbianOS.cpp | 6 +-- 21 files changed, 27 insertions(+), 188 deletions(-) delete mode 100644 backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp delete mode 100644 backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h delete mode 100644 backends/graphics/symbiansdl/symbiansdl-graphics.cpp delete mode 100644 backends/graphics/symbiansdl/symbiansdl-graphics.h diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 2996b354a9a..cfb935c3202 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -458,12 +458,6 @@ void DINGUXSdlGraphicsManager::setupHardwareSize() { } } -bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) const { - return - (f == OSystem::kFeatureAspectRatioCorrection) || - (f == OSystem::kFeatureCursorPalette); -} - void DINGUXSdlGraphicsManager::warpMouse(int x, int y) { if (_cursorX != x || _cursorY != y) { if (_videoMode.mode == GFX_HALF && !_overlayVisible) { diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index e1f78ba7acf..b45cfd72929 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -36,7 +36,6 @@ class DINGUXSdlGraphicsManager : public SurfaceSdlGraphicsManager { public: DINGUXSdlGraphicsManager(SdlEventSource *boss, SdlWindow *window); - bool hasFeature(OSystem::Feature f) const override; int getDefaultGraphicsMode() const override; void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL) override; diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index 97b49cdbda7..f7fba4a07a0 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -458,12 +458,6 @@ bool GPHGraphicsManager::loadGFXMode() { return success; } -bool GPHGraphicsManager::hasFeature(OSystem::Feature f) const { - return - (f == OSystem::kFeatureAspectRatioCorrection) || - (f == OSystem::kFeatureCursorPalette); -} - void GPHGraphicsManager::warpMouse(int x, int y) { if (_cursorX != x || _cursorY != y) { if (_videoMode.mode == GFX_HALF && !_overlayVisible) { diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h index 8cea9b45fb4..f53fd8fc3ce 100644 --- a/backends/graphics/gph/gph-graphics.h +++ b/backends/graphics/gph/gph-graphics.h @@ -35,7 +35,6 @@ class GPHGraphicsManager : public SurfaceSdlGraphicsManager { public: GPHGraphicsManager(SdlEventSource *boss, SdlWindow *window); - bool hasFeature(OSystem::Feature f) const override; int getDefaultGraphicsMode() const override; void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL) override; diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp deleted file mode 100644 index 88360c87b78..00000000000 --- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * 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. - * - */ - -#include "common/scummsys.h" - -#if defined(SAMSUNGTV) - -#include "backends/platform/samsungtv/samsungtv.h" -#include "backends/events/samsungtvsdl/samsungtvsdl-events.h" -#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" - -SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window) - : SurfaceSdlGraphicsManager(sdlEventSource, window) { -} - -bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) const { - return - (f == OSystem::kFeatureAspectRatioCorrection) || - (f == OSystem::kFeatureCursorPalette); -} - -#endif diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h deleted file mode 100644 index 594c5c7fde1..00000000000 --- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * 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. - * - */ - -#ifndef BACKENDS_GRAPHICS_SAMSUNGTV_H -#define BACKENDS_GRAPHICS_SAMSUNGTV_H - -#if defined(SAMSUNGTV) - -#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" - -class SamsungTVSdlGraphicsManager : public SurfaceSdlGraphicsManager { -public: - SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window); - - bool hasFeature(OSystem::Feature f) const override; -}; - -#endif - -#endif diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp deleted file mode 100644 index ceb0719ddd0..00000000000 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * 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. - * - */ - -#include "common/scummsys.h" - -#ifdef __SYMBIAN32__ - -#include "backends/graphics/symbiansdl/symbiansdl-graphics.h" - -SymbianSdlGraphicsManager::SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window) - : SurfaceSdlGraphicsManager(sdlEventSource, window) { -} - -bool SymbianSdlGraphicsManager::hasFeature(OSystem::Feature f) const { - switch (f) { - case OSystem::kFeatureAspectRatioCorrection: - case OSystem::kFeatureCursorPalette: - return true; - default: - return false; - } -} - -#endif diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h deleted file mode 100644 index cf8a76f349e..00000000000 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.h +++ /dev/null @@ -1,36 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * 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. - * - */ - -#ifndef BACKENDS_GRAPHICS_SYMBIAN_SDL_H -#define BACKENDS_GRAPHICS_SYMBIAN_SDL_H - -#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" - -class SymbianSdlGraphicsManager : public SurfaceSdlGraphicsManager { -public: - SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window); - -public: - virtual bool hasFeature(OSystem::Feature f) const override; -}; - -#endif diff --git a/backends/module.mk b/backends/module.mk index 2eac83f3085..f4f076fd38d 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -332,8 +332,7 @@ endif ifeq ($(BACKEND),samsungtv) MODULE_OBJS += \ - events/samsungtvsdl/samsungtvsdl-events.o \ - graphics/samsungtvsdl/samsungtvsdl-graphics.o + events/samsungtvsdl/samsungtvsdl-events.o endif ifeq ($(BACKEND),webos) diff --git a/backends/platform/dingux/dingux.cpp b/backends/platform/dingux/dingux.cpp index 54e5a2c3e08..bf033174c45 100644 --- a/backends/platform/dingux/dingux.cpp +++ b/backends/platform/dingux/dingux.cpp @@ -42,4 +42,11 @@ void OSystem_SDL_Dingux::initBackend() { OSystem_POSIX::initBackend(); } +bool OSystem_SDL_Dingux::hasFeature(Feature f) { + if (f == kFeatureFullscreenMode) + return false; + + return OSystem_SDL::hasFeature(f); +} + #endif diff --git a/backends/platform/dingux/dingux.h b/backends/platform/dingux/dingux.h index add74fa0394..aee9348a8d1 100644 --- a/backends/platform/dingux/dingux.h +++ b/backends/platform/dingux/dingux.h @@ -34,6 +34,7 @@ class OSystem_SDL_Dingux : public OSystem_POSIX { public: void initBackend(); + bool hasFeature(Feature f); }; diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 9bb1a9a29cc..729c7e05c00 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -210,4 +210,11 @@ void OSystem_GPH::quit() { OSystem_POSIX::quit(); } +bool OSystem_GPH::hasFeature(Feature f) { + if (f == kFeatureFullscreenMode) + return false; + + return OSystem_SDL::hasFeature(f); +} + #endif diff --git a/backends/platform/gph/gph.h b/backends/platform/gph/gph.h index c82f763f1d8..8be41639e5c 100644 --- a/backends/platform/gph/gph.h +++ b/backends/platform/gph/gph.h @@ -39,6 +39,7 @@ public: void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); void initBackend(); void quit(); + bool hasFeature(Feature f); protected: bool _inited; diff --git a/backends/platform/samsungtv/samsungtv.cpp b/backends/platform/samsungtv/samsungtv.cpp index 5a103793fae..3a5710b1abf 100644 --- a/backends/platform/samsungtv/samsungtv.cpp +++ b/backends/platform/samsungtv/samsungtv.cpp @@ -26,7 +26,6 @@ #include "backends/platform/samsungtv/samsungtv.h" #include "backends/events/samsungtvsdl/samsungtvsdl-events.h" -#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" #include "backends/saves/default/default-saves.h" #include "backends/fs/posix/posix-fs.h" #include "common/textconsole.h" @@ -41,9 +40,6 @@ void OSystem_SDL_SamsungTV::initBackend() { if (_eventSource == 0) _eventSource = new SamsungTVSdlEventSource(); - if (_graphicsManager == 0) - _graphicsManager = new SamsungTVSdlGraphicsManager(_eventSource, _window); - // Call parent implementation of this method OSystem_POSIX::initBackend(); } @@ -70,4 +66,11 @@ Common::String OSystem_SDL_SamsungTV::getDefaultLogFileName() { return "/mtd_ram/scummvm.log"; } +bool OSystem_SDL_SamsungTV::hasFeature(Feature f) { + if (f == kFeatureFullscreenMode) + return false; + + return OSystem_SDL::hasFeature(f); +} + #endif diff --git a/backends/platform/samsungtv/samsungtv.h b/backends/platform/samsungtv/samsungtv.h index 0b98297d793..42a933ff397 100644 --- a/backends/platform/samsungtv/samsungtv.h +++ b/backends/platform/samsungtv/samsungtv.h @@ -32,6 +32,7 @@ public: virtual void initBackend(); virtual void quit(); virtual void fatalError(); + virtual bool hasFeature(Feature f); protected: virtual Common::String getDefaultConfigFileName(); diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in index e6ae1b9f271..0c0811c7183 100644 --- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in @@ -142,7 +142,6 @@ SOURCE common\error.cpp SOURCE common\quicktime.cpp // Special for graphics -SOURCE backends\graphics\symbiansdl\symbiansdl-graphics.cpp SOURCE backends\graphics\surfacesdl\surfacesdl-graphics.cpp SOURCE engines\obsolete.cpp diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in index 1555db872ba..91c5428d565 100644 --- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in @@ -143,7 +143,6 @@ SOURCE common\error.cpp SOURCE common\quicktime.cpp // Special for graphics -SOURCE backends\graphics\symbiansdl\symbiansdl-graphics.cpp SOURCE backends\graphics\surfacesdl\surfacesdl-graphics.cpp SOURCE engines\obsolete.cpp diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in index 0bc0bf1f8ea..707f41673cb 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in @@ -139,7 +139,6 @@ source common\error.cpp source common\quicktime.cpp // Special for graphics -source backends\graphics\symbiansdl\symbiansdl-graphics.cpp source backends\graphics\surfacesdl\surfacesdl-graphics.cpp source engines\obsolete.cpp diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in index 1c5127ff0f8..7350f5bd1f0 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in @@ -139,7 +139,6 @@ source common\error.cpp source common\quicktime.cpp // Special for graphics -source backends\graphics\symbiansdl\symbiansdl-graphics.cpp source backends\graphics\surfacesdl\surfacesdl-graphics.cpp source engines\obsolete.cpp diff --git a/backends/platform/symbian/mmp/scummvm_base.mmp.in b/backends/platform/symbian/mmp/scummvm_base.mmp.in index 703d2c6c329..1e8c4af070d 100644 --- a/backends/platform/symbian/mmp/scummvm_base.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_base.mmp.in @@ -141,7 +141,6 @@ SOURCE backends\events\symbiansdl\symbiansdl-events.cpp SOURCE backends\fs\abstract-fs.cpp SOURCE backends\fs\symbian\symbianstream.cpp SOURCE backends\graphics\sdl\sdl-graphics.cpp -SOURCE backends\graphics\symbiansdl\symbiansdl-graphics.cpp SOURCE backends\keymapper\action.cpp SOURCE backends\keymapper\keymap.cpp SOURCE backends\keymapper\keymapper.cpp diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index ba96e32ed4b..59b2922f3ef 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -37,7 +37,6 @@ #include "backends/fs/symbian/symbian-fs-factory.h" #include "backends/saves/default/default-saves.h" #include "backends/events/symbiansdl/symbiansdl-events.h" -#include "backends/graphics/symbiansdl/symbiansdl-graphics.h" #include "backends/mixer/symbiansdl/symbiansdl-mixer.h" #define DEFAULT_CONFIG_FILE "scummvm.ini" @@ -111,8 +110,6 @@ void OSystem_SDL_Symbian::initBackend() { // Setup and start mixer _mixerManager->init(); } - if (_graphicsManager == 0) - _graphicsManager = new SymbianSdlGraphicsManager(_eventSource, _window); // Call parent implementation of this method OSystem_SDL::initBackend(); @@ -170,7 +167,8 @@ Common::String OSystem_SDL_Symbian::getDefaultConfigFileName() { } bool OSystem_SDL_Symbian::hasFeature(Feature f) { - if (f == kFeatureJoystickDeadzone) return false; + if (f == kFeatureJoystickDeadzone || f == kFeatureFullscreenMode) + return false; return OSystem_SDL::hasFeature(f); }