From 5a47b0945559b2c92407c3f43fe6018da0839c51 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sat, 10 Oct 2020 15:16:23 +0100 Subject: [PATCH] BACKENDS: Move default implementations of getScreenPixelBuffer into BaseBackend --- backends/base-backend.cpp | 7 +++++++ backends/base-backend.h | 1 + backends/platform/3ds/osystem-graphics.cpp | 5 ----- backends/platform/3ds/osystem.h | 1 - backends/platform/dc/dc.h | 2 -- backends/platform/dc/display.cpp | 6 ------ backends/platform/ds/arm9/source/osystem_ds.cpp | 5 ----- backends/platform/ds/arm9/source/osystem_ds.h | 1 - backends/platform/iphone/osys_main.h | 1 - backends/platform/iphone/osys_video.mm | 5 ----- backends/platform/n64/osys_n64.h | 1 - backends/platform/n64/osys_n64_base.cpp | 5 ----- backends/platform/psp/osys_psp.cpp | 5 ----- backends/platform/psp/osys_psp.h | 1 - backends/platform/wii/osystem.h | 2 -- backends/platform/wii/osystem_gfx.cpp | 5 ----- 16 files changed, 8 insertions(+), 45 deletions(-) diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp index 5fcee25b9f2..98c4ce0a6a8 100644 --- a/backends/base-backend.cpp +++ b/backends/base-backend.cpp @@ -22,6 +22,8 @@ #include "backends/base-backend.h" +#include "graphics/pixelbuffer.h" + #ifndef DISABLE_DEFAULT_EVENT_MANAGER #include "backends/events/default/default-events.h" #endif @@ -49,6 +51,11 @@ void BaseBackend::initBackend() { OSystem::initBackend(); } +Graphics::PixelBuffer BaseBackend::getScreenPixelBuffer() { + warning("BaseBackend::getScreenPixelBuffer(): not implemented"); + return Graphics::PixelBuffer(); +} + void BaseBackend::fillScreen(uint32 col) { Graphics::Surface *screen = lockScreen(); if (screen) diff --git a/backends/base-backend.h b/backends/base-backend.h index 0e776574f83..c74d2ee7db7 100644 --- a/backends/base-backend.h +++ b/backends/base-backend.h @@ -30,6 +30,7 @@ class BaseBackend : public OSystem { public: virtual void initBackend(); + virtual Graphics::PixelBuffer getScreenPixelBuffer(); virtual void displayMessageOnOSD(const Common::U32String &msg); virtual void displayActivityIconOnOSD(const Graphics::Surface *icon) {} virtual void fillScreen(uint32 col); diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp index c902018a10b..7c11acd67b7 100644 --- a/backends/platform/3ds/osystem-graphics.cpp +++ b/backends/platform/3ds/osystem-graphics.cpp @@ -27,7 +27,6 @@ #include "backends/platform/3ds/config.h" #include "common/rect.h" #include "graphics/fontman.h" -#include "graphics/pixelbuffer.h" #include "gui/gui-manager.h" // Used to transfer the final rendered display to the framebuffer @@ -187,10 +186,6 @@ bool OSystem_3DS::setGraphicsMode(GraphicsModeID modeID) { } } -Graphics::PixelBuffer OSystem_3DS::getScreenPixelBuffer() { - return Graphics::PixelBuffer(); -} - void OSystem_3DS::initSize(uint width, uint height, const Graphics::PixelFormat *format) { debug("3ds initsize w:%d h:%d", width, height); diff --git a/backends/platform/3ds/osystem.h b/backends/platform/3ds/osystem.h index c5c182879d7..79428f0010a 100644 --- a/backends/platform/3ds/osystem.h +++ b/backends/platform/3ds/osystem.h @@ -141,7 +141,6 @@ public: virtual int getScreenChangeID() const { return _screenChangeId; }; GraphicsModeID chooseMode(Graphics::PixelFormat *format); bool setGraphicsMode(GraphicsModeID modeID); - virtual Graphics::PixelBuffer getScreenPixelBuffer(); void beginGFXTransaction(); OSystem::TransactionError endGFXTransaction(); diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index f8f84169413..9c1ff0451c9 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -98,8 +98,6 @@ protected: public: - virtual Graphics::PixelBuffer getScreenPixelBuffer(); - // Determine the pixel format currently in use for screen rendering. Graphics::PixelFormat getScreenFormat() const; diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index b3171a4a03d..bb7919a5196 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -24,7 +24,6 @@ #include "common/scummsys.h" #include "graphics/surface.h" -#include "graphics/pixelbuffer.h" #include "dc.h" #define SCREEN_W 640 @@ -186,11 +185,6 @@ void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num) const } } -Graphics::PixelBuffer OSystem_Dreamcast::getScreenPixelBuffer() -{ - return Graphics::PixelBuffer(); -} - Graphics::PixelFormat OSystem_Dreamcast::getScreenFormat() const { return screenFormats[_screenFormat]; diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 0a4f054ebf4..3e80c8b6b8f 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -42,7 +42,6 @@ #include "common/str.h" #include "cdaudio.h" #include "graphics/surface.h" -#include "graphics/pixelbuffer.h" #include "touchkeyboard.h" #include "backends/fs/ds/ds-fs-factory.h" @@ -163,10 +162,6 @@ bool OSystem_DS::getFeatureState(Feature f) { return false; } -Graphics::PixelBuffer OSystem_DS::getScreenPixelBuffer() { - return Graphics::PixelBuffer(); -} - void OSystem_DS::initSize(uint width, uint height, const Graphics::PixelFormat *format) { // For Lost in Time, the title screen is displayed in 640x400. // In order to support this game, the screen mode is set, but diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index c61842181b5..052790395bd 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -88,7 +88,6 @@ public: virtual int16 getWidth(); virtual PaletteManager *getPaletteManager() { return this; } - virtual Graphics::PixelBuffer getScreenPixelBuffer(); protected: // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index e737c961780..a5755062bf1 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -130,7 +130,6 @@ public: virtual void beginGFXTransaction(); virtual TransactionError endGFXTransaction(); - virtual Graphics::PixelBuffer getScreenPixelBuffer(); virtual int16 getHeight(); virtual int16 getWidth(); diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm index 22b50818500..07fc93ce8d5 100644 --- a/backends/platform/iphone/osys_video.mm +++ b/backends/platform/iphone/osys_video.mm @@ -27,7 +27,6 @@ #include "backends/platform/iphone/iphone_video.h" #include "graphics/conversion.h" -#include "graphics/pixelbuffer.h" void OSystem_IPHONE::engineInit() { EventsBaseBackend::engineInit(); @@ -138,10 +137,6 @@ OSystem::TransactionError OSystem_IPHONE::endGFXTransaction() { return _gfxTransactionError; } -Graphics::PixelBuffer OSystem_IPHONE::getScreenPixelBuffer() { - return Graphics::PixelBuffer(); -} - void OSystem_IPHONE::updateOutputSurface() { [g_iPhoneViewInstance performSelectorOnMainThread:@selector(initSurface) withObject:nil waitUntilDone: YES]; } diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index f29a140ca92..40e7e3b33e5 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -153,7 +153,6 @@ public: virtual int16 getWidth(); virtual PaletteManager *getPaletteManager() { return this; } - virtual Graphics::PixelBuffer getScreenPixelBuffer(); protected: // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index ef9278c8ba5..d163746ce30 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -32,7 +32,6 @@ #include "backends/fs/n64/n64-fs-factory.h" #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" -#include "graphics/pixelbuffer.h" typedef unsigned long long uint64; @@ -221,10 +220,6 @@ const OSystem::GraphicsMode* OSystem_N64::getSupportedGraphicsModes() const { return s_supportedGraphicsModes; } -Graphics::PixelBuffer OSystem_N64::getScreenPixelBuffer() { - return Graphics::PixelBuffer(); -} - int OSystem_N64::getDefaultGraphicsMode() const { return OVERS_NTSC_340X240; } diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 5dba7f88038..b5a612d41c3 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -41,7 +41,6 @@ #include "backends/saves/default/default-saves.h" #include "backends/timer/psp/timer.h" #include "graphics/surface.h" -#include "graphics/pixelbuffer.h" #include "audio/mixer_intern.h" //#define __PSP_DEBUG_FUNCS__ /* For debugging function calls */ @@ -131,10 +130,6 @@ const OSystem::GraphicsMode* OSystem_PSP::getSupportedGraphicsModes() const { return _displayManager.getSupportedGraphicsModes(); } -Graphics::PixelBuffer OSystem_PSP::getScreenPixelBuffer() { - return Graphics::PixelBuffer(); -} - int OSystem_PSP::getDefaultGraphicsMode() const { DEBUG_ENTER_FUNC(); return _displayManager.getDefaultGraphicsMode(); diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index e3bf787ecad..8e263e2898a 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -79,7 +79,6 @@ public: virtual Graphics::PixelFormat getScreenFormat() const; virtual Common::List getSupportedFormats() const; #endif - virtual Graphics::PixelBuffer getScreenPixelBuffer(); // Screen size void initSize(uint width, uint height, const Graphics::PixelFormat *format); diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index 90520b7d5ee..350a3f45a03 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -166,8 +166,6 @@ protected: virtual void setPalette(const byte *colors, uint start, uint num); virtual void grabPalette(byte *colors, uint start, uint num) const; public: - virtual Graphics::PixelBuffer getScreenPixelBuffer(); - virtual void setCursorPalette(const byte *colors, uint start, uint num); virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index d1e7e0c4344..6a7adce3dd3 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -29,7 +29,6 @@ #include "common/config-manager.h" #include "graphics/conversion.h" -#include "graphics/pixelbuffer.h" #include "backends/fs/wii/wii-fs-factory.h" #include "osystem.h" @@ -375,10 +374,6 @@ void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) const { } } -Graphics::PixelBuffer OSystem_Wii::getScreenPixelBuffer() { - return Graphics::PixelBuffer(); -} - void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) { if (!_texMouse.palette) { printf("switching to palette based cursor\n");