diff --git a/debian/control b/debian/control index d986cb2c3..2584a9cc0 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Depends: ${misc:Depends}, ${shlibs:Depends} Recommends: joystick (>= 1:1.5.1) Pre-Depends: ${misc:Pre-Depends} -Description: Atari 2600 Emulator for SDL2 +Description: Atari 2600 Emulator for SDL Stella is a portable emulator of the old Atari 2600 video-game console. You can play most Atari 2600 games with it. . diff --git a/src/common/EventHandlerSDL2.cxx b/src/common/EventHandlerSDL.cxx similarity index 93% rename from src/common/EventHandlerSDL2.cxx rename to src/common/EventHandlerSDL.cxx index 84f5741e2..b1da636dd 100644 --- a/src/common/EventHandlerSDL2.cxx +++ b/src/common/EventHandlerSDL.cxx @@ -17,12 +17,12 @@ #include "Logger.hxx" #include "OSystem.hxx" -#include "EventHandlerSDL2.hxx" +#include "EventHandlerSDL.hxx" #include "ThreadDebugging.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem) +EventHandlerSDL::EventHandlerSDL(OSystem& osystem) : EventHandler{osystem} { ASSERT_MAIN_THREAD; @@ -45,14 +45,14 @@ EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem) << SDL_GetError() << '\n'; Logger::error(buf.view()); } - Logger::debug("EventHandlerSDL2::EventHandlerSDL2 SDL_INIT_JOYSTICK"); + Logger::debug("EventHandlerSDL::EventHandlerSDL SDL_INIT_JOYSTICK"); #endif SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EventHandlerSDL2::~EventHandlerSDL2() +EventHandlerSDL::~EventHandlerSDL() { ASSERT_MAIN_THREAD; @@ -61,7 +61,7 @@ EventHandlerSDL2::~EventHandlerSDL2() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EventHandlerSDL2::enableTextEvents(bool enable) +void EventHandlerSDL::enableTextEvents(bool enable) { ASSERT_MAIN_THREAD; @@ -72,13 +72,13 @@ void EventHandlerSDL2::enableTextEvents(bool enable) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EventHandlerSDL2::copyText(const string& text) const +void EventHandlerSDL::copyText(const string& text) const { SDL_SetClipboardText(text.c_str()); }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string EventHandlerSDL2::pasteText(string& text) const +string EventHandlerSDL::pasteText(string& text) const { if(SDL_HasClipboardText()) text = SDL_GetClipboardText(); @@ -89,7 +89,7 @@ string EventHandlerSDL2::pasteText(string& text) const }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EventHandlerSDL2::pollEvent() +void EventHandlerSDL::pollEvent() { ASSERT_MAIN_THREAD; @@ -192,7 +192,7 @@ void EventHandlerSDL2::pollEvent() case SDL_JOYDEVICEADDED: { - addPhysicalJoystick(make_shared(myEvent.jdevice.which)); + addPhysicalJoystick(make_shared(myEvent.jdevice.which)); break; // SDL_JOYDEVICEADDED } case SDL_JOYDEVICEREMOVED: @@ -261,7 +261,7 @@ void EventHandlerSDL2::pollEvent() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx) +EventHandlerSDL::JoystickSDL::JoystickSDL(int idx) { ASSERT_MAIN_THREAD; @@ -285,7 +285,7 @@ EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EventHandlerSDL2::JoystickSDL2::~JoystickSDL2() +EventHandlerSDL::JoystickSDL::~JoystickSDL() { ASSERT_MAIN_THREAD; diff --git a/src/common/EventHandlerSDL2.hxx b/src/common/EventHandlerSDL.hxx similarity index 63% rename from src/common/EventHandlerSDL2.hxx rename to src/common/EventHandlerSDL.hxx index ea4ee4cf9..2fee43d90 100644 --- a/src/common/EventHandlerSDL2.hxx +++ b/src/common/EventHandlerSDL.hxx @@ -15,8 +15,8 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#ifndef EVENTHANDLER_SDL2_HXX -#define EVENTHANDLER_SDL2_HXX +#ifndef EVENTHANDLER_SDL_HXX +#define EVENTHANDLER_SDL_HXX #include "SDL_lib.hxx" #include "EventHandler.hxx" @@ -24,19 +24,19 @@ /** This class handles event collection from the point of view of the specific - backend toolkit (SDL2). It converts from SDL2-specific events into events + backend toolkit (SDL). It converts from SDL-specific events into events that the Stella core can understand. @author Stephen Anthony */ -class EventHandlerSDL2 : public EventHandler +class EventHandlerSDL : public EventHandler { public: /** - Create a new SDL2 event handler object + Create a new SDL event handler object */ - explicit EventHandlerSDL2(OSystem& osystem); - ~EventHandlerSDL2() override; + explicit EventHandlerSDL(OSystem& osystem); + ~EventHandlerSDL() override; private: /** @@ -51,7 +51,7 @@ class EventHandlerSDL2 : public EventHandler string pasteText(string& text) const override; /** - Collects and dispatches any pending SDL2 events. + Collects and dispatches any pending SDL events. */ void pollEvent() override; @@ -60,31 +60,31 @@ class EventHandlerSDL2 : public EventHandler // A thin wrapper around a basic PhysicalJoystick, holding the pointer to // the underlying SDL joystick device. - class JoystickSDL2 : public PhysicalJoystick + class JoystickSDL : public PhysicalJoystick { public: - explicit JoystickSDL2(int idx); - virtual ~JoystickSDL2(); + explicit JoystickSDL(int idx); + virtual ~JoystickSDL(); private: SDL_Joystick* myStick{nullptr}; private: // Following constructors and assignment operators not supported - JoystickSDL2() = delete; - JoystickSDL2(const JoystickSDL2&) = delete; - JoystickSDL2(JoystickSDL2&&) = delete; - JoystickSDL2& operator=(const JoystickSDL2&) = delete; - JoystickSDL2& operator=(JoystickSDL2&&) = delete; + JoystickSDL() = delete; + JoystickSDL(const JoystickSDL&) = delete; + JoystickSDL(JoystickSDL&&) = delete; + JoystickSDL& operator=(const JoystickSDL&) = delete; + JoystickSDL& operator=(JoystickSDL&&) = delete; }; private: // Following constructors and assignment operators not supported - EventHandlerSDL2() = delete; - EventHandlerSDL2(const EventHandlerSDL2&) = delete; - EventHandlerSDL2(EventHandlerSDL2&&) = delete; - EventHandlerSDL2& operator=(const EventHandlerSDL2&) = delete; - EventHandlerSDL2& operator=(EventHandlerSDL2&&) = delete; + EventHandlerSDL() = delete; + EventHandlerSDL(const EventHandlerSDL&) = delete; + EventHandlerSDL(EventHandlerSDL&&) = delete; + EventHandlerSDL& operator=(const EventHandlerSDL&) = delete; + EventHandlerSDL& operator=(EventHandlerSDL&&) = delete; }; #endif diff --git a/src/common/FBBackendSDL2.cxx b/src/common/FBBackendSDL.cxx similarity index 91% rename from src/common/FBBackendSDL2.cxx rename to src/common/FBBackendSDL.cxx index 2cd96312b..1586a11f7 100644 --- a/src/common/FBBackendSDL2.cxx +++ b/src/common/FBBackendSDL.cxx @@ -25,33 +25,33 @@ #include "Settings.hxx" #include "ThreadDebugging.hxx" -#include "FBSurfaceSDL2.hxx" -#include "FBBackendSDL2.hxx" +#include "FBSurfaceSDL.hxx" +#include "FBBackendSDL.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FBBackendSDL2::FBBackendSDL2(OSystem& osystem) +FBBackendSDL::FBBackendSDL(OSystem& osystem) : myOSystem{osystem} { ASSERT_MAIN_THREAD; - // Initialize SDL2 context + // Initialize SDL context if(SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) { ostringstream buf; buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError(); throw runtime_error(buf.str()); } - Logger::debug("FBBackendSDL2::FBBackendSDL2 SDL_Init()"); + Logger::debug("FBBackendSDL::FBBackendSDL SDL_Init()"); // We need a pixel format for palette value calculations - // It's done this way (vs directly accessing a FBSurfaceSDL2 object) + // It's done this way (vs directly accessing a FBSurfaceSDL object) // since the structure may be needed before any FBSurface's have // been created myPixelFormat = SDL_AllocFormat(SDL_PIXELFORMAT_ARGB8888); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FBBackendSDL2::~FBBackendSDL2() +FBBackendSDL::~FBBackendSDL() { ASSERT_MAIN_THREAD; @@ -73,9 +73,9 @@ FBBackendSDL2::~FBBackendSDL2() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::queryHardware(vector& fullscreenRes, - vector& windowedRes, - VariantList& renderers) +void FBBackendSDL::queryHardware(vector& fullscreenRes, + vector& windowedRes, + VariantList& renderers) { ASSERT_MAIN_THREAD; @@ -190,7 +190,7 @@ void FBBackendSDL2::queryHardware(vector& fullscreenRes, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBBackendSDL2::isCurrentWindowPositioned() const +bool FBBackendSDL::isCurrentWindowPositioned() const { ASSERT_MAIN_THREAD; @@ -199,19 +199,18 @@ bool FBBackendSDL2::isCurrentWindowPositioned() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Common::Point FBBackendSDL2::getCurrentWindowPos() const +Common::Point FBBackendSDL::getCurrentWindowPos() const { ASSERT_MAIN_THREAD; Common::Point pos; - SDL_GetWindowPosition(myWindow, &pos.x, &pos.y); return pos; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Int32 FBBackendSDL2::getCurrentDisplayIndex() const +Int32 FBBackendSDL::getCurrentDisplayIndex() const { ASSERT_MAIN_THREAD; @@ -219,8 +218,8 @@ Int32 FBBackendSDL2::getCurrentDisplayIndex() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBBackendSDL2::setVideoMode(const VideoModeHandler::Mode& mode, - int winIdx, const Common::Point& winPos) +bool FBBackendSDL::setVideoMode(const VideoModeHandler::Mode& mode, + int winIdx, const Common::Point& winPos) { ASSERT_MAIN_THREAD; @@ -346,8 +345,8 @@ bool FBBackendSDL2::setVideoMode(const VideoModeHandler::Mode& mode, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBBackendSDL2::adaptRefreshRate(Int32 displayIndex, - SDL_DisplayMode& adaptedSdlMode) +bool FBBackendSDL::adaptRefreshRate(Int32 displayIndex, + SDL_DisplayMode& adaptedSdlMode) { ASSERT_MAIN_THREAD; @@ -406,7 +405,7 @@ bool FBBackendSDL2::adaptRefreshRate(Int32 displayIndex, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBBackendSDL2::createRenderer() +bool FBBackendSDL::createRenderer() { ASSERT_MAIN_THREAD; @@ -460,7 +459,7 @@ bool FBBackendSDL2::createRenderer() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::setTitle(string_view title) +void FBBackendSDL::setTitle(string_view title) { ASSERT_MAIN_THREAD; @@ -471,7 +470,7 @@ void FBBackendSDL2::setTitle(string_view title) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string FBBackendSDL2::about() const +string FBBackendSDL::about() const { ASSERT_MAIN_THREAD; @@ -493,7 +492,7 @@ string FBBackendSDL2::about() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::showCursor(bool show) +void FBBackendSDL::showCursor(bool show) { ASSERT_MAIN_THREAD; @@ -501,7 +500,7 @@ void FBBackendSDL2::showCursor(bool show) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::grabMouse(bool grab) +void FBBackendSDL::grabMouse(bool grab) { ASSERT_MAIN_THREAD; @@ -509,7 +508,7 @@ void FBBackendSDL2::grabMouse(bool grab) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBBackendSDL2::fullScreen() const +bool FBBackendSDL::fullScreen() const { ASSERT_MAIN_THREAD; @@ -521,7 +520,7 @@ bool FBBackendSDL2::fullScreen() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int FBBackendSDL2::refreshRate() const +int FBBackendSDL::refreshRate() const { ASSERT_MAIN_THREAD; @@ -538,7 +537,7 @@ int FBBackendSDL2::refreshRate() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::renderToScreen() +void FBBackendSDL::renderToScreen() { ASSERT_MAIN_THREAD; @@ -547,7 +546,7 @@ void FBBackendSDL2::renderToScreen() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::setWindowIcon() +void FBBackendSDL::setWindowIcon() { #if !defined(BSPF_MACOS) && !defined(RETRON77) #include "stella_icon.hxx" @@ -561,20 +560,20 @@ void FBBackendSDL2::setWindowIcon() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -unique_ptr FBBackendSDL2::createSurface( +unique_ptr FBBackendSDL::createSurface( uInt32 w, uInt32 h, ScalingInterpolation inter, const uInt32* data ) const { - return make_unique - (const_cast(*this), w, h, inter, data); + return make_unique + (const_cast(*this), w, h, inter, data); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::readPixels(uInt8* buffer, size_t pitch, - const Common::Rect& rect) const +void FBBackendSDL::readPixels(uInt8* buffer, size_t pitch, + const Common::Rect& rect) const { ASSERT_MAIN_THREAD; @@ -586,7 +585,7 @@ void FBBackendSDL2::readPixels(uInt8* buffer, size_t pitch, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::clear() +void FBBackendSDL::clear() { ASSERT_MAIN_THREAD; @@ -594,7 +593,7 @@ void FBBackendSDL2::clear() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::detectFeatures() +void FBBackendSDL::detectFeatures() { myRenderTargetSupport = detectRenderTargetSupport(); @@ -603,7 +602,7 @@ void FBBackendSDL2::detectFeatures() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBBackendSDL2::detectRenderTargetSupport() +bool FBBackendSDL::detectRenderTargetSupport() { ASSERT_MAIN_THREAD; @@ -632,7 +631,7 @@ bool FBBackendSDL2::detectRenderTargetSupport() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBBackendSDL2::determineDimensions() +void FBBackendSDL::determineDimensions() { ASSERT_MAIN_THREAD; diff --git a/src/common/FBBackendSDL2.hxx b/src/common/FBBackendSDL.hxx similarity index 94% rename from src/common/FBBackendSDL2.hxx rename to src/common/FBBackendSDL.hxx index bc2066a7d..e1986c4ad 100644 --- a/src/common/FBBackendSDL2.hxx +++ b/src/common/FBBackendSDL.hxx @@ -15,31 +15,31 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#ifndef FB_BACKEND_SDL2_HXX -#define FB_BACKEND_SDL2_HXX +#ifndef FB_BACKEND_SDL_HXX +#define FB_BACKEND_SDL_HXX #include "SDL_lib.hxx" class OSystem; -class FBSurfaceSDL2; +class FBSurfaceSDL; #include "bspf.hxx" #include "FBBackend.hxx" /** - This class implements a standard SDL2 2D, hardware accelerated framebuffer + This class implements a standard SDL 2D, hardware accelerated framebuffer backend. Behind the scenes, it may be using Direct3D, OpenGL(ES), etc. @author Stephen Anthony */ -class FBBackendSDL2 : public FBBackend +class FBBackendSDL : public FBBackend { public: /** - Creates a new SDL2 framebuffer + Creates a new SDL framebuffer */ - explicit FBBackendSDL2(OSystem& osystem); - ~FBBackendSDL2() override; + explicit FBBackendSDL(OSystem& osystem); + ~FBBackendSDL() override; public: /** @@ -305,11 +305,11 @@ class FBBackendSDL2 : public FBBackend private: // Following constructors and assignment operators not supported - FBBackendSDL2() = delete; - FBBackendSDL2(const FBBackendSDL2&) = delete; - FBBackendSDL2(FBBackendSDL2&&) = delete; - FBBackendSDL2& operator=(const FBBackendSDL2&) = delete; - FBBackendSDL2& operator=(FBBackendSDL2&&) = delete; + FBBackendSDL() = delete; + FBBackendSDL(const FBBackendSDL&) = delete; + FBBackendSDL(FBBackendSDL&&) = delete; + FBBackendSDL& operator=(const FBBackendSDL&) = delete; + FBBackendSDL& operator=(FBBackendSDL&&) = delete; }; #endif diff --git a/src/common/FBSurfaceSDL2.cxx b/src/common/FBSurfaceSDL.cxx similarity index 82% rename from src/common/FBSurfaceSDL2.cxx rename to src/common/FBSurfaceSDL.cxx index b058d7b9e..9f000cc5a 100644 --- a/src/common/FBSurfaceSDL2.cxx +++ b/src/common/FBSurfaceSDL.cxx @@ -15,7 +15,7 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#include "FBSurfaceSDL2.hxx" +#include "FBSurfaceSDL.hxx" #include "Logger.hxx" #include "ThreadDebugging.hxx" @@ -41,10 +41,10 @@ namespace { } // namespace // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FBSurfaceSDL2::FBSurfaceSDL2(FBBackendSDL2& backend, - uInt32 width, uInt32 height, - ScalingInterpolation inter, - const uInt32* staticData) +FBSurfaceSDL::FBSurfaceSDL(FBBackendSDL& backend, + uInt32 width, uInt32 height, + ScalingInterpolation inter, + const uInt32* staticData) : myBackend{backend}, myInterpolationMode{inter} { @@ -53,7 +53,7 @@ FBSurfaceSDL2::FBSurfaceSDL2(FBBackendSDL2& backend, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FBSurfaceSDL2::~FBSurfaceSDL2() +FBSurfaceSDL::~FBSurfaceSDL() { ASSERT_MAIN_THREAD; @@ -65,7 +65,7 @@ FBSurfaceSDL2::~FBSurfaceSDL2() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, ColorId color) +void FBSurfaceSDL::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, ColorId color) { ASSERT_MAIN_THREAD; @@ -79,45 +79,45 @@ void FBSurfaceSDL2::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, ColorId col } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 FBSurfaceSDL2::width() const +uInt32 FBSurfaceSDL::width() const { return mySurface->w; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 FBSurfaceSDL2::height() const +uInt32 FBSurfaceSDL::height() const { return mySurface->h; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const Common::Rect& FBSurfaceSDL2::srcRect() const +const Common::Rect& FBSurfaceSDL::srcRect() const { return mySrcGUIR; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const Common::Rect& FBSurfaceSDL2::dstRect() const +const Common::Rect& FBSurfaceSDL::dstRect() const { return myDstGUIR; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setSrcPos(uInt32 x, uInt32 y) +void FBSurfaceSDL::setSrcPos(uInt32 x, uInt32 y) { if(setSrcPosInternal(x, y)) reinitializeBlitter(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setSrcSize(uInt32 w, uInt32 h) +void FBSurfaceSDL::setSrcSize(uInt32 w, uInt32 h) { if(setSrcSizeInternal(w, h)) reinitializeBlitter(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setSrcRect(const Common::Rect& r) +void FBSurfaceSDL::setSrcRect(const Common::Rect& r) { const bool posChanged = setSrcPosInternal(r.x(), r.y()), sizeChanged = setSrcSizeInternal(r.w(), r.h()); @@ -127,21 +127,21 @@ void FBSurfaceSDL2::setSrcRect(const Common::Rect& r) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setDstPos(uInt32 x, uInt32 y) +void FBSurfaceSDL::setDstPos(uInt32 x, uInt32 y) { if(setDstPosInternal(x, y)) reinitializeBlitter(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setDstSize(uInt32 w, uInt32 h) +void FBSurfaceSDL::setDstSize(uInt32 w, uInt32 h) { if(setDstSizeInternal(w, h)) reinitializeBlitter(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setDstRect(const Common::Rect& r) +void FBSurfaceSDL::setDstRect(const Common::Rect& r) { const bool posChanged = setDstPosInternal(r.x(), r.y()), sizeChanged = setDstSizeInternal(r.w(), r.h()); @@ -151,22 +151,23 @@ void FBSurfaceSDL2::setDstRect(const Common::Rect& r) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setVisible(bool visible) +void FBSurfaceSDL::setVisible(bool visible) { myIsVisible = visible; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::translateCoords(Int32& x, Int32& y) const +void FBSurfaceSDL::translateCoords(Int32& x, Int32& y) const { x -= myDstR.x; x /= myDstR.w / mySrcR.w; y -= myDstR.y; y /= myDstR.h / mySrcR.h; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool FBSurfaceSDL2::render() +bool FBSurfaceSDL::render() { - if (!myBlitter) reinitializeBlitter(); + if(!myBlitter) + reinitializeBlitter(); if(myIsVisible && myBlitter) { @@ -178,7 +179,7 @@ bool FBSurfaceSDL2::render() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::invalidate() +void FBSurfaceSDL::invalidate() { ASSERT_MAIN_THREAD; @@ -186,7 +187,7 @@ void FBSurfaceSDL2::invalidate() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::invalidateRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h) +void FBSurfaceSDL::invalidateRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h) { ASSERT_MAIN_THREAD; @@ -202,13 +203,13 @@ void FBSurfaceSDL2::invalidateRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::reload() +void FBSurfaceSDL::reload() { reinitializeBlitter(true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::resize(uInt32 width, uInt32 height) +void FBSurfaceSDL::resize(uInt32 width, uInt32 height) { ASSERT_MAIN_THREAD; @@ -224,8 +225,7 @@ void FBSurfaceSDL2::resize(uInt32 width, uInt32 height) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::createSurface(uInt32 width, uInt32 height, - const uInt32* data) +void FBSurfaceSDL::createSurface(uInt32 width, uInt32 height, const uInt32* data) { ASSERT_MAIN_THREAD; @@ -258,7 +258,7 @@ void FBSurfaceSDL2::createSurface(uInt32 width, uInt32 height, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::reinitializeBlitter(bool force) +void FBSurfaceSDL::reinitializeBlitter(bool force) { if (force) myBlitter.reset(); @@ -273,13 +273,13 @@ void FBSurfaceSDL2::reinitializeBlitter(bool force) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::applyAttributes() +void FBSurfaceSDL::applyAttributes() { reinitializeBlitter(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::setScalingInterpolation(ScalingInterpolation interpolation) +void FBSurfaceSDL::setScalingInterpolation(ScalingInterpolation interpolation) { if (interpolation == ScalingInterpolation::sharp && ( diff --git a/src/common/FBSurfaceSDL2.hxx b/src/common/FBSurfaceSDL.hxx similarity index 83% rename from src/common/FBSurfaceSDL2.hxx rename to src/common/FBSurfaceSDL.hxx index c601c914d..1986b7629 100644 --- a/src/common/FBSurfaceSDL2.hxx +++ b/src/common/FBSurfaceSDL.hxx @@ -15,26 +15,26 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#ifndef FBSURFACE_SDL2_HXX -#define FBSURFACE_SDL2_HXX +#ifndef FBSURFACE_SDL_HXX +#define FBSURFACE_SDL_HXX #include "bspf.hxx" #include "FBSurface.hxx" -#include "FBBackendSDL2.hxx" +#include "FBBackendSDL.hxx" #include "sdl_blitter/Blitter.hxx" /** - An FBSurface suitable for the SDL2 Render2D API, making use of hardware + An FBSurface suitable for the SDL Render2D API, making use of hardware acceleration behind the scenes. @author Stephen Anthony */ -class FBSurfaceSDL2 : public FBSurface +class FBSurfaceSDL : public FBSurface { public: - FBSurfaceSDL2(FBBackendSDL2& backend, uInt32 width, uInt32 height, - ScalingInterpolation inter, const uInt32* staticData); - ~FBSurfaceSDL2() override; + FBSurfaceSDL(FBBackendSDL& backend, uInt32 width, uInt32 height, + ScalingInterpolation inter, const uInt32* staticData); + ~FBSurfaceSDL() override; // Most of the surface drawing primitives are implemented in FBSurface; // the ones implemented here use SDL-specific code for extra performance @@ -111,18 +111,17 @@ class FBSurfaceSDL2 : public FBSurface void reinitializeBlitter(bool force = false); // Following constructors and assignment operators not supported - FBSurfaceSDL2() = delete; - FBSurfaceSDL2(const FBSurfaceSDL2&) = delete; - FBSurfaceSDL2(FBSurfaceSDL2&&) = delete; - FBSurfaceSDL2& operator=(const FBSurfaceSDL2&) = delete; - FBSurfaceSDL2& operator=(FBSurfaceSDL2&&) = delete; + FBSurfaceSDL() = delete; + FBSurfaceSDL(const FBSurfaceSDL&) = delete; + FBSurfaceSDL(FBSurfaceSDL&&) = delete; + FBSurfaceSDL& operator=(const FBSurfaceSDL&) = delete; + FBSurfaceSDL& operator=(FBSurfaceSDL&&) = delete; private: - FBBackendSDL2& myBackend; + FBBackendSDL& myBackend; unique_ptr myBlitter; - ScalingInterpolation myInterpolationMode - {ScalingInterpolation::none}; + ScalingInterpolation myInterpolationMode{ScalingInterpolation::none}; SDL_Surface* mySurface{nullptr}; SDL_Rect mySrcR{-1, -1, -1, -1}, myDstR{-1, -1, -1, -1}; diff --git a/src/common/MediaFactory.hxx b/src/common/MediaFactory.hxx index d12338bca..8d33fe306 100644 --- a/src/common/MediaFactory.hxx +++ b/src/common/MediaFactory.hxx @@ -53,8 +53,8 @@ #include "EventHandlerLIBRETRO.hxx" #include "FBBackendLIBRETRO.hxx" #elif defined(SDL_SUPPORT) - #include "EventHandlerSDL2.hxx" - #include "FBBackendSDL2.hxx" + #include "EventHandlerSDL.hxx" + #include "FBBackendSDL.hxx" #else #error Unsupported backend! #endif @@ -63,7 +63,7 @@ #if defined(__LIB_RETRO__) #include "SoundLIBRETRO.hxx" #elif defined(SDL_SUPPORT) - #include "SoundSDL2.hxx" + #include "SoundSDL.hxx" #else #include "SoundNull.hxx" #endif @@ -133,7 +133,7 @@ class MediaFactory #if defined(__LIB_RETRO__) return make_unique(osystem); #elif defined(SDL_SUPPORT) - return make_unique(osystem); + return make_unique(osystem); #else #error Unsupported platform for FrameBuffer! #endif @@ -145,7 +145,7 @@ class MediaFactory #if defined(__LIB_RETRO__) return make_unique(osystem, audioSettings); #elif defined(SOUND_SUPPORT) && defined(SDL_SUPPORT) - return make_unique(osystem, audioSettings); + return make_unique(osystem, audioSettings); #else return make_unique(osystem); #endif @@ -159,7 +159,7 @@ class MediaFactory #if defined(__LIB_RETRO__) return make_unique(osystem); #elif defined(SDL_SUPPORT) - return make_unique(osystem); + return make_unique(osystem); #else #error Unsupported platform for EventHandler! #endif diff --git a/src/common/SoundSDL2.cxx b/src/common/SoundSDL.cxx similarity index 89% rename from src/common/SoundSDL2.cxx rename to src/common/SoundSDL.cxx index f1d4e438a..b3751e41d 100644 --- a/src/common/SoundSDL2.cxx +++ b/src/common/SoundSDL.cxx @@ -31,16 +31,16 @@ #include "audio/LanczosResampler.hxx" #include "ThreadDebugging.hxx" -#include "SoundSDL2.hxx" +#include "SoundSDL.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings) +SoundSDL::SoundSDL(OSystem& osystem, AudioSettings& audioSettings) : Sound{osystem}, myAudioSettings{audioSettings} { ASSERT_MAIN_THREAD; - Logger::debug("SoundSDL2::SoundSDL2 started ..."); + Logger::debug("SoundSDL::SoundSDL started ..."); if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { @@ -58,11 +58,11 @@ SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings) if(!openDevice()) return; - Logger::debug("SoundSDL2::SoundSDL2 initialized"); + Logger::debug("SoundSDL::SoundSDL initialized"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SoundSDL2::~SoundSDL2() +SoundSDL::~SoundSDL() { ASSERT_MAIN_THREAD; @@ -74,7 +74,7 @@ SoundSDL2::~SoundSDL2() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::queryHardware(VariantList& devices) +void SoundSDL::queryHardware(VariantList& devices) { ASSERT_MAIN_THREAD; @@ -98,7 +98,7 @@ void SoundSDL2::queryHardware(VariantList& devices) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SoundSDL2::openDevice() +bool SoundSDL::openDevice() { ASSERT_MAIN_THREAD; @@ -136,15 +136,15 @@ bool SoundSDL2::openDevice() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::setEnabled(bool enable) +void SoundSDL::setEnabled(bool enable) { mute(!enable); pause(!enable); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::open(shared_ptr audioQueue, - shared_ptr emulationTiming) +void SoundSDL::open(shared_ptr audioQueue, + shared_ptr emulationTiming) { const string pre_about = myAboutString; @@ -158,7 +158,7 @@ void SoundSDL2::open(shared_ptr audioQueue, myEmulationTiming = emulationTiming; myWavHandler.setSpeed(262 * 60 * 2. / myEmulationTiming->audioSampleRate()); - Logger::debug("SoundSDL2::open started ..."); + Logger::debug("SoundSDL::open started ..."); audioQueue->ignoreOverflows(!myAudioSettings.enabled()); if(!myAudioSettings.enabled()) @@ -184,11 +184,11 @@ void SoundSDL2::open(shared_ptr audioQueue, // And start the SDL sound subsystem ... pause(false); - Logger::debug("SoundSDL2::open finished"); + Logger::debug("SoundSDL::open finished"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::mute(bool enable) +void SoundSDL::mute(bool enable) { if(enable) myVolumeFactor = 0; @@ -197,7 +197,7 @@ void SoundSDL2::mute(bool enable) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::toggleMute() +void SoundSDL::toggleMute() { const bool wasMuted = myVolumeFactor == 0; mute(!wasMuted); @@ -211,7 +211,7 @@ void SoundSDL2::toggleMute() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SoundSDL2::pause(bool enable) +bool SoundSDL::pause(bool enable) { ASSERT_MAIN_THREAD; @@ -225,7 +225,7 @@ bool SoundSDL2::pause(bool enable) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::setVolume(uInt32 volume) +void SoundSDL::setVolume(uInt32 volume) { if(myIsInitializedFlag && (volume <= 100)) { @@ -235,7 +235,7 @@ void SoundSDL2::setVolume(uInt32 volume) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::adjustVolume(int direction) +void SoundSDL::adjustVolume(int direction) { Int32 percent = myAudioSettings.volume(); percent = BSPF::clamp(percent + direction * 2, 0, 100); @@ -257,7 +257,7 @@ void SoundSDL2::adjustVolume(int direction) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string SoundSDL2::about() const +string SoundSDL::about() const { ostringstream buf; buf << "Sound enabled:\n" @@ -315,7 +315,7 @@ string SoundSDL2::about() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::initResampler() +void SoundSDL::initResampler() { const Resampler::NextFragmentCallback nextFragmentCallback = [this] () -> Int16* { Int16* nextFragment = nullptr; @@ -365,9 +365,9 @@ void SoundSDL2::initResampler() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::callback(void* object, uInt8* stream, int len) +void SoundSDL::callback(void* object, uInt8* stream, int len) { - const auto* self = static_cast(object); + const auto* self = static_cast(object); if(self->myAudioQueue && self->myResampler) { @@ -378,14 +378,14 @@ void SoundSDL2::callback(void* object, uInt8* stream, int len) self->myResampler->fillFragment(s, length); for(uInt32 i = 0; i < length; ++i) - s[i] *= SoundSDL2::myVolumeFactor; + s[i] *= SoundSDL::myVolumeFactor; } else SDL_memset(stream, 0, len); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SoundSDL2::playWav(const string& fileName, uInt32 position, uInt32 length) +bool SoundSDL::playWav(const string& fileName, uInt32 position, uInt32 length) { const char* const device = myDeviceId ? myDevices.at(myDeviceId).first.c_str() @@ -395,19 +395,19 @@ bool SoundSDL2::playWav(const string& fileName, uInt32 position, uInt32 length) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::stopWav() +void SoundSDL::stopWav() { myWavHandler.stop(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 SoundSDL2::wavSize() const +uInt32 SoundSDL::wavSize() const { return myWavHandler.size(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SoundSDL2::WavHandlerSDL2::play( +bool SoundSDL::WavHandlerSDL::play( const string& fileName, const char* device, uInt32 position, uInt32 length) { // Load WAV file @@ -450,7 +450,7 @@ bool SoundSDL2::WavHandlerSDL2::play( } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::WavHandlerSDL2::stop() +void SoundSDL::WavHandlerSDL::stop() { if(myBuffer) { @@ -467,7 +467,7 @@ void SoundSDL2::WavHandlerSDL2::stop() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::WavHandlerSDL2::processWav(uInt8* stream, uInt32 len) +void SoundSDL::WavHandlerSDL::processWav(uInt8* stream, uInt32 len) { SDL_memset(stream, mySpec.silence, len); if(myRemaining) @@ -500,7 +500,7 @@ void SoundSDL2::WavHandlerSDL2::processWav(uInt8* stream, uInt32 len) SDL_ConvertAudio(&cvt); // Mix volume adjusted WAV data into silent buffer SDL_MixAudioFormat(stream, cvt.buf, mySpec.format, cvt.len_cvt, - SDL_MIX_MAXVOLUME * SoundSDL2::myVolumeFactor); + SDL_MIX_MAXVOLUME * SoundSDL::myVolumeFactor); } else { @@ -517,14 +517,14 @@ void SoundSDL2::WavHandlerSDL2::processWav(uInt8* stream, uInt32 len) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::WavHandlerSDL2::callback(void* object, uInt8* stream, int len) +void SoundSDL::WavHandlerSDL::callback(void* object, uInt8* stream, int len) { - static_cast(object)->processWav( + static_cast(object)->processWav( stream, static_cast(len)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SoundSDL2::WavHandlerSDL2::~WavHandlerSDL2() +SoundSDL::WavHandlerSDL::~WavHandlerSDL() { if(myDevice) { @@ -534,13 +534,13 @@ SoundSDL2::WavHandlerSDL2::~WavHandlerSDL2() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void SoundSDL2::WavHandlerSDL2::pause(bool state) const +void SoundSDL::WavHandlerSDL::pause(bool state) const { if(myDevice) SDL_PauseAudioDevice(myDevice, state ? 1 : 0); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -float SoundSDL2::myVolumeFactor = 0.F; +float SoundSDL::myVolumeFactor = 0.F; #endif // SOUND_SUPPORT diff --git a/src/common/SoundSDL2.hxx b/src/common/SoundSDL.hxx similarity index 88% rename from src/common/SoundSDL2.hxx rename to src/common/SoundSDL.hxx index 907800c8c..0bed644d2 100644 --- a/src/common/SoundSDL2.hxx +++ b/src/common/SoundSDL.hxx @@ -17,8 +17,8 @@ #ifdef SOUND_SUPPORT -#ifndef SOUND_SDL2_HXX -#define SOUND_SDL2_HXX +#ifndef SOUND_SDL_HXX +#define SOUND_SDL_HXX class OSystem; class AudioQueue; @@ -36,15 +36,15 @@ class Resampler; @author Stephen Anthony and Christian Speckner (DirtyHairy) */ -class SoundSDL2 : public Sound +class SoundSDL : public Sound { public: /** Create a new sound object. The init method must be invoked before using the object. */ - SoundSDL2(OSystem& osystem, AudioSettings& audioSettings); - ~SoundSDL2() override; + SoundSDL(OSystem& osystem, AudioSettings& audioSettings); + ~SoundSDL() override; public: /** @@ -172,13 +172,13 @@ class SoundSDL2 : public Sound string myAboutString; /** - This class implements WAV file playback using the SDL2 sound API. + This class implements WAV file playback using the SDL sound API. */ - class WavHandlerSDL2 + class WavHandlerSDL { public: - explicit WavHandlerSDL2() = default; - ~WavHandlerSDL2(); + explicit WavHandlerSDL() = default; + ~WavHandlerSDL(); bool play(const string& fileName, const char* device, uInt32 position, uInt32 length); @@ -206,13 +206,13 @@ class SoundSDL2 : public Sound static void callback(void* object, uInt8* stream, int len); // Following constructors and assignment operators not supported - WavHandlerSDL2(const WavHandlerSDL2&) = delete; - WavHandlerSDL2(WavHandlerSDL2&&) = delete; - WavHandlerSDL2& operator=(const WavHandlerSDL2&) = delete; - WavHandlerSDL2& operator=(WavHandlerSDL2&&) = delete; + WavHandlerSDL(const WavHandlerSDL&) = delete; + WavHandlerSDL(WavHandlerSDL&&) = delete; + WavHandlerSDL& operator=(const WavHandlerSDL&) = delete; + WavHandlerSDL& operator=(WavHandlerSDL&&) = delete; }; - WavHandlerSDL2 myWavHandler; + WavHandlerSDL myWavHandler; static float myVolumeFactor; // Current volume level (0 - 100) @@ -221,11 +221,11 @@ class SoundSDL2 : public Sound static void callback(void* object, uInt8* stream, int len); // Following constructors and assignment operators not supported - SoundSDL2() = delete; - SoundSDL2(const SoundSDL2&) = delete; - SoundSDL2(SoundSDL2&&) = delete; - SoundSDL2& operator=(const SoundSDL2&) = delete; - SoundSDL2& operator=(SoundSDL2&&) = delete; + SoundSDL() = delete; + SoundSDL(const SoundSDL&) = delete; + SoundSDL(SoundSDL&&) = delete; + SoundSDL& operator=(const SoundSDL&) = delete; + SoundSDL& operator=(SoundSDL&&) = delete; }; #endif diff --git a/src/common/module.mk b/src/common/module.mk index 58bee6d5d..bf2549f64 100644 --- a/src/common/module.mk +++ b/src/common/module.mk @@ -6,9 +6,9 @@ MODULE_OBJS := \ src/common/Base.o \ src/common/Bezel.o \ src/common/DevSettingsHandler.o \ - src/common/EventHandlerSDL2.o \ - src/common/FBBackendSDL2.o \ - src/common/FBSurfaceSDL2.o \ + src/common/EventHandlerSDL.o \ + src/common/FBBackendSDL.o \ + src/common/FBSurfaceSDL.o \ src/common/FpsMeter.o \ src/common/FSNodeZIP.o \ src/common/HighScoresManager.o \ @@ -25,7 +25,7 @@ MODULE_OBJS := \ src/common/PKeyboardHandler.o \ src/common/PNGLibrary.o \ src/common/RewindManager.o \ - src/common/SoundSDL2.o \ + src/common/SoundSDL.o \ src/common/StaggeredLogger.o \ src/common/StateManager.o \ src/common/ThreadDebugging.o \ diff --git a/src/common/sdl_blitter/BilinearBlitter.cxx b/src/common/sdl_blitter/BilinearBlitter.cxx index 89b279df8..f98cd74ab 100644 --- a/src/common/sdl_blitter/BilinearBlitter.cxx +++ b/src/common/sdl_blitter/BilinearBlitter.cxx @@ -15,12 +15,12 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#include "FBBackendSDL2.hxx" +#include "FBBackendSDL.hxx" #include "ThreadDebugging.hxx" #include "BilinearBlitter.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -BilinearBlitter::BilinearBlitter(FBBackendSDL2& fb, bool interpolate) +BilinearBlitter::BilinearBlitter(FBBackendSDL& fb, bool interpolate) : myFB{fb}, myInterpolate{interpolate} { diff --git a/src/common/sdl_blitter/BilinearBlitter.hxx b/src/common/sdl_blitter/BilinearBlitter.hxx index d5ae01a32..a8636409a 100644 --- a/src/common/sdl_blitter/BilinearBlitter.hxx +++ b/src/common/sdl_blitter/BilinearBlitter.hxx @@ -18,7 +18,7 @@ #ifndef BILINEAR_BLITTER_HXX #define BILINEAR_BLITTER_HXX -class FBBackendSDL2; +class FBBackendSDL; #include "Blitter.hxx" #include "SDL_lib.hxx" @@ -27,7 +27,7 @@ class BilinearBlitter : public Blitter { public: - BilinearBlitter(FBBackendSDL2& fb, bool interpolate); + BilinearBlitter(FBBackendSDL& fb, bool interpolate); ~BilinearBlitter() override; @@ -41,7 +41,7 @@ class BilinearBlitter : public Blitter { void blit(SDL_Surface& surface) override; private: - FBBackendSDL2& myFB; + FBBackendSDL& myFB; SDL_Texture* myTexture{nullptr}; SDL_Texture* mySecondaryTexture{nullptr}; diff --git a/src/common/sdl_blitter/BlitterFactory.cxx b/src/common/sdl_blitter/BlitterFactory.cxx index 253f9d492..4d682c359 100644 --- a/src/common/sdl_blitter/BlitterFactory.cxx +++ b/src/common/sdl_blitter/BlitterFactory.cxx @@ -21,7 +21,7 @@ #include "QisBlitter.hxx" unique_ptr -BlitterFactory::createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling) +BlitterFactory::createBlitter(FBBackendSDL& fb, ScalingAlgorithm scaling) { if (!fb.isInitialized()) { throw runtime_error("BlitterFactory requires an initialized framebuffer!"); diff --git a/src/common/sdl_blitter/BlitterFactory.hxx b/src/common/sdl_blitter/BlitterFactory.hxx index 2107767b1..a13b38105 100644 --- a/src/common/sdl_blitter/BlitterFactory.hxx +++ b/src/common/sdl_blitter/BlitterFactory.hxx @@ -21,7 +21,7 @@ #include #include "Blitter.hxx" -#include "FBBackendSDL2.hxx" +#include "FBBackendSDL.hxx" #include "bspf.hxx" class BlitterFactory { @@ -35,7 +35,7 @@ class BlitterFactory { public: - static unique_ptr createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling); + static unique_ptr createBlitter(FBBackendSDL& fb, ScalingAlgorithm scaling); }; #endif // BLITTER_FACTORY_HXX diff --git a/src/common/sdl_blitter/QisBlitter.cxx b/src/common/sdl_blitter/QisBlitter.cxx index 17d21208a..a29f29278 100644 --- a/src/common/sdl_blitter/QisBlitter.cxx +++ b/src/common/sdl_blitter/QisBlitter.cxx @@ -15,12 +15,12 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#include "FBBackendSDL2.hxx" +#include "FBBackendSDL.hxx" #include "ThreadDebugging.hxx" #include "QisBlitter.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -QisBlitter::QisBlitter(FBBackendSDL2& fb) +QisBlitter::QisBlitter(FBBackendSDL& fb) : myFB{fb} { } @@ -32,7 +32,7 @@ QisBlitter::~QisBlitter() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool QisBlitter::isSupported(const FBBackendSDL2& fb) +bool QisBlitter::isSupported(const FBBackendSDL& fb) { if (!fb.isInitialized()) throw runtime_error("framebuffer not initialized"); @@ -112,7 +112,6 @@ void QisBlitter::blit(SDL_Surface& surface) SDL_RenderCopy(myFB.renderer(), intermediateTexture, &myIntermediateRect, &myDstRect); } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void QisBlitter::blitToIntermediate() { @@ -131,7 +130,6 @@ void QisBlitter::blitToIntermediate() SDL_SetRenderTarget(myFB.renderer(), nullptr); } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void QisBlitter::recreateTexturesIfNecessary() { diff --git a/src/common/sdl_blitter/QisBlitter.hxx b/src/common/sdl_blitter/QisBlitter.hxx index 8b8950e6a..ffdbfa9fa 100644 --- a/src/common/sdl_blitter/QisBlitter.hxx +++ b/src/common/sdl_blitter/QisBlitter.hxx @@ -18,7 +18,7 @@ #ifndef QIS_BLITTER_HXX #define QIS_BLITTER_HXX -class FBBackendSDL2; +class FBBackendSDL; #include "Blitter.hxx" #include "SDL_lib.hxx" @@ -27,9 +27,9 @@ class QisBlitter : public Blitter { public: - explicit QisBlitter(FBBackendSDL2& fb); + explicit QisBlitter(FBBackendSDL& fb); - static bool isSupported(const FBBackendSDL2& fb); + static bool isSupported(const FBBackendSDL& fb); ~QisBlitter() override; @@ -44,7 +44,7 @@ class QisBlitter : public Blitter { private: - FBBackendSDL2& myFB; + FBBackendSDL& myFB; SDL_Texture* mySrcTexture{nullptr}; SDL_Texture* mySecondarySrcTexture{nullptr}; diff --git a/src/emucore/FBBackend.hxx b/src/emucore/FBBackend.hxx index 26642c35b..80a9a7828 100644 --- a/src/emucore/FBBackend.hxx +++ b/src/emucore/FBBackend.hxx @@ -29,7 +29,7 @@ class FBSurface; /** This class provides an interface/abstraction for platform-specific, framebuffer-related rendering operations. Different graphical - platforms will inherit from this. For most ports that means SDL2, + platforms will inherit from this. For most ports that means SDL, but some (such as libretro) use their own graphical subsystem. @author Stephen Anthony diff --git a/src/os/libretro/EventHandlerLIBRETRO.hxx b/src/os/libretro/EventHandlerLIBRETRO.hxx index 214676804..554e0f0c8 100644 --- a/src/os/libretro/EventHandlerLIBRETRO.hxx +++ b/src/os/libretro/EventHandlerLIBRETRO.hxx @@ -31,7 +31,7 @@ class EventHandlerLIBRETRO : public EventHandler { public: /** - Create a new LIBRETRO event handler object + Create a new LIBRETRO event handler object. */ explicit EventHandlerLIBRETRO(OSystem& osystem) : EventHandler(osystem) { } ~EventHandlerLIBRETRO() override = default; @@ -43,7 +43,7 @@ class EventHandlerLIBRETRO : public EventHandler void enableTextEvents(bool enable) override { } /** - Collects and dispatches any pending SDL2 events. + Collects and dispatches any pending events. */ void pollEvent() override { } diff --git a/src/os/macos/AboutBox.h b/src/os/macos/AboutBox.h index 7f65035fa..fc0b8fee8 100644 --- a/src/os/macos/AboutBox.h +++ b/src/os/macos/AboutBox.h @@ -19,7 +19,7 @@ /** AboutBox window class and support functions for the macOS - SDL2 port of Stella. + SDL port of Stella. @author Mark Grebe */ diff --git a/src/os/macos/AboutBoxTextView.h b/src/os/macos/AboutBoxTextView.h index 3d45df2c5..cc5a59959 100644 --- a/src/os/macos/AboutBoxTextView.h +++ b/src/os/macos/AboutBoxTextView.h @@ -19,7 +19,7 @@ /** AboutBoxTextView class and support functions for the macOS - SDL2 port of Stella. + SDL port of Stella. @author Mark Grebe */ diff --git a/src/os/windows/Stella.vcxproj b/src/os/windows/Stella.vcxproj index 8dc80e2ae..3046858e9 100755 --- a/src/os/windows/Stella.vcxproj +++ b/src/os/windows/Stella.vcxproj @@ -416,9 +416,9 @@ - - - + + + @@ -784,7 +784,7 @@ - + @@ -1382,9 +1382,9 @@ - - - + + + @@ -1790,7 +1790,7 @@ - + @@ -2003,4 +2003,4 @@ - \ No newline at end of file + diff --git a/src/os/windows/Stella.vcxproj.filters b/src/os/windows/Stella.vcxproj.filters index 89b949e32..a49913e5d 100644 --- a/src/os/windows/Stella.vcxproj.filters +++ b/src/os/windows/Stella.vcxproj.filters @@ -1146,13 +1146,13 @@ Source Files\common - + Source Files\common - + Source Files\common - + Source Files\common @@ -1203,7 +1203,7 @@ Source Files\common - + Source Files\common @@ -2402,13 +2402,13 @@ Header Files\common - + Header Files\common - + Header Files\common - + Header Files\common @@ -2477,7 +2477,7 @@ Header Files\common - + Header Files\common