First pass at SDL3 conversion. For now, just rename classes to 'SDL'.

This commit is contained in:
Stephen Anthony 2025-04-26 22:15:08 -02:30
parent 7b5c19ff5e
commit c34127a536
23 changed files with 226 additions and 230 deletions

2
debian/control vendored
View File

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

View File

@ -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<JoystickSDL2>(myEvent.jdevice.which));
addPhysicalJoystick(make_shared<JoystickSDL>(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;

View File

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

View File

@ -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<Common::Size>& fullscreenRes,
vector<Common::Size>& windowedRes,
VariantList& renderers)
void FBBackendSDL::queryHardware(vector<Common::Size>& fullscreenRes,
vector<Common::Size>& windowedRes,
VariantList& renderers)
{
ASSERT_MAIN_THREAD;
@ -190,7 +190,7 @@ void FBBackendSDL2::queryHardware(vector<Common::Size>& 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<FBSurface> FBBackendSDL2::createSurface(
unique_ptr<FBSurface> FBBackendSDL::createSurface(
uInt32 w,
uInt32 h,
ScalingInterpolation inter,
const uInt32* data
) const
{
return make_unique<FBSurfaceSDL2>
(const_cast<FBBackendSDL2&>(*this), w, h, inter, data);
return make_unique<FBSurfaceSDL>
(const_cast<FBBackendSDL&>(*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;

View File

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

View File

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

View File

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

View File

@ -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<FBBackendLIBRETRO>(osystem);
#elif defined(SDL_SUPPORT)
return make_unique<FBBackendSDL2>(osystem);
return make_unique<FBBackendSDL>(osystem);
#else
#error Unsupported platform for FrameBuffer!
#endif
@ -145,7 +145,7 @@ class MediaFactory
#if defined(__LIB_RETRO__)
return make_unique<SoundLIBRETRO>(osystem, audioSettings);
#elif defined(SOUND_SUPPORT) && defined(SDL_SUPPORT)
return make_unique<SoundSDL2>(osystem, audioSettings);
return make_unique<SoundSDL>(osystem, audioSettings);
#else
return make_unique<SoundNull>(osystem);
#endif
@ -159,7 +159,7 @@ class MediaFactory
#if defined(__LIB_RETRO__)
return make_unique<EventHandlerLIBRETRO>(osystem);
#elif defined(SDL_SUPPORT)
return make_unique<EventHandlerSDL2>(osystem);
return make_unique<EventHandlerSDL>(osystem);
#else
#error Unsupported platform for EventHandler!
#endif

View File

@ -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> audioQueue,
shared_ptr<const EmulationTiming> emulationTiming)
void SoundSDL::open(shared_ptr<AudioQueue> audioQueue,
shared_ptr<const EmulationTiming> emulationTiming)
{
const string pre_about = myAboutString;
@ -158,7 +158,7 @@ void SoundSDL2::open(shared_ptr<AudioQueue> 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> 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<SoundSDL2*>(object);
const auto* self = static_cast<SoundSDL*>(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<WavHandlerSDL2*>(object)->processWav(
static_cast<WavHandlerSDL*>(object)->processWav(
stream, static_cast<uInt32>(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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,7 +21,7 @@
#include "QisBlitter.hxx"
unique_ptr<Blitter>
BlitterFactory::createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling)
BlitterFactory::createBlitter(FBBackendSDL& fb, ScalingAlgorithm scaling)
{
if (!fb.isInitialized()) {
throw runtime_error("BlitterFactory requires an initialized framebuffer!");

View File

@ -21,7 +21,7 @@
#include <string>
#include "Blitter.hxx"
#include "FBBackendSDL2.hxx"
#include "FBBackendSDL.hxx"
#include "bspf.hxx"
class BlitterFactory {
@ -35,7 +35,7 @@ class BlitterFactory {
public:
static unique_ptr<Blitter> createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling);
static unique_ptr<Blitter> createBlitter(FBBackendSDL& fb, ScalingAlgorithm scaling);
};
#endif // BLITTER_FACTORY_HXX

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@
/**
AboutBox window class and support functions for the macOS
SDL2 port of Stella.
SDL port of Stella.
@author Mark Grebe <atarimac@cox.net>
*/

View File

@ -19,7 +19,7 @@
/**
AboutBoxTextView class and support functions for the macOS
SDL2 port of Stella.
SDL port of Stella.
@author Mark Grebe <atarimac@cox.net>
*/

View File

@ -416,9 +416,9 @@
<ClCompile Include="..\..\common\Base.cxx" />
<ClCompile Include="..\..\common\Bezel.cxx" />
<ClCompile Include="..\..\common\DevSettingsHandler.cxx" />
<ClCompile Include="..\..\common\EventHandlerSDL2.cxx" />
<ClCompile Include="..\..\common\FBBackendSDL2.cxx" />
<ClCompile Include="..\..\common\FBSurfaceSDL2.cxx" />
<ClCompile Include="..\..\common\EventHandlerSDL.cxx" />
<ClCompile Include="..\..\common\FBBackendSDL.cxx" />
<ClCompile Include="..\..\common\FBSurfaceSDL.cxx" />
<ClCompile Include="..\..\common\FpsMeter.cxx" />
<ClCompile Include="..\..\common\FSNodeZIP.cxx" />
<ClCompile Include="..\..\common\HighScoresManager.cxx" />
@ -784,7 +784,7 @@
<ClCompile Include="OSystemWINDOWS.cxx" />
<ClCompile Include="..\..\common\PNGLibrary.cxx" />
<ClCompile Include="SerialPortWINDOWS.cxx" />
<ClCompile Include="..\..\common\SoundSDL2.cxx" />
<ClCompile Include="..\..\common\SoundSDL.cxx" />
<ClCompile Include="..\..\emucore\AtariVox.cxx" />
<ClCompile Include="..\..\emucore\Booster.cxx" />
<ClCompile Include="..\..\emucore\Cart.cxx" />
@ -1382,9 +1382,9 @@
<ClInclude Include="..\..\common\Bezel.hxx" />
<ClInclude Include="..\..\common\bspf.hxx" />
<ClInclude Include="..\..\common\DevSettingsHandler.hxx" />
<ClInclude Include="..\..\common\EventHandlerSDL2.hxx" />
<ClInclude Include="..\..\common\FBBackendSDL2.hxx" />
<ClInclude Include="..\..\common\FBSurfaceSDL2.hxx" />
<ClInclude Include="..\..\common\EventHandlerSDL.hxx" />
<ClInclude Include="..\..\common\FBBackendSDL.hxx" />
<ClInclude Include="..\..\common\FBSurfaceSDL.hxx" />
<ClInclude Include="..\..\common\FpsMeter.hxx" />
<ClInclude Include="..\..\common\FSNodeFactory.hxx" />
<ClInclude Include="..\..\common\FSNodeZIP.hxx" />
@ -1790,7 +1790,7 @@
<ClInclude Include="OSystemWINDOWS.hxx" />
<ClInclude Include="..\..\common\PNGLibrary.hxx" />
<ClInclude Include="SerialPortWINDOWS.hxx" />
<ClInclude Include="..\..\common\SoundSDL2.hxx" />
<ClInclude Include="..\..\common\SoundSDL.hxx" />
<ClInclude Include="..\..\common\Stack.hxx" />
<ClInclude Include="..\..\common\Version.hxx" />
<ClInclude Include="..\..\emucore\AtariVox.hxx" />
@ -2003,4 +2003,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -1146,13 +1146,13 @@
<ClCompile Include="..\..\common\DevSettingsHandler.cxx">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\common\EventHandlerSDL2.cxx">
<ClCompile Include="..\..\common\EventHandlerSDL.cxx">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\common\FBBackendSDL2.cxx">
<ClCompile Include="..\..\common\FBBackendSDL.cxx">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\common\FBSurfaceSDL2.cxx">
<ClCompile Include="..\..\common\FBSurfaceSDL.cxx">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\common\FpsMeter.cxx">
@ -1203,7 +1203,7 @@
<ClCompile Include="..\..\common\RewindManager.cxx">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\common\SoundSDL2.cxx">
<ClCompile Include="..\..\common\SoundSDL.cxx">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\common\StaggeredLogger.cxx">
@ -2402,13 +2402,13 @@
<ClInclude Include="..\..\common\DevSettingsHandler.hxx">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\common\EventHandlerSDL2.hxx">
<ClInclude Include="..\..\common\EventHandlerSDL.hxx">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\common\FBBackendSDL2.hxx">
<ClInclude Include="..\..\common\FBBackendSDL.hxx">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\common\FBSurfaceSDL2.hxx">
<ClInclude Include="..\..\common\FBSurfaceSDL.hxx">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\common\FpsMeter.hxx">
@ -2477,7 +2477,7 @@
<ClInclude Include="..\..\common\smartmod.hxx">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\common\SoundSDL2.hxx">
<ClInclude Include="..\..\common\SoundSDL.hxx">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\common\Stack.hxx">