BACKENDS: Move implementations of hasFeature into the relevant OSystem subclasses

This commit is contained in:
Cameron Cawley 2020-03-11 22:19:55 +00:00 committed by Eugene Sandulenko
parent a5b6a577de
commit 153576f0b5
21 changed files with 27 additions and 188 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -34,6 +34,7 @@
class OSystem_SDL_Dingux : public OSystem_POSIX {
public:
void initBackend();
bool hasFeature(Feature f);
};

View File

@ -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

View File

@ -39,6 +39,7 @@ public:
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
void initBackend();
void quit();
bool hasFeature(Feature f);
protected:
bool _inited;

View File

@ -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

View File

@ -32,6 +32,7 @@ public:
virtual void initBackend();
virtual void quit();
virtual void fatalError();
virtual bool hasFeature(Feature f);
protected:
virtual Common::String getDefaultConfigFileName();

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}