Removed concept of 'base' surfaces, which was an optimization for software rendering.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2862 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-03-02 02:02:00 +00:00
parent cf50b4f1b6
commit fdf9ed708a
9 changed files with 18 additions and 29 deletions

View File

@ -38,7 +38,6 @@
FrameBufferSDL2::FrameBufferSDL2(OSystem* osystem) FrameBufferSDL2::FrameBufferSDL2(OSystem* osystem)
: FrameBuffer(osystem), : FrameBuffer(osystem),
myFilterType(kNormal), myFilterType(kNormal),
myScreen(0),
myWindow(NULL), myWindow(NULL),
myRenderer(NULL), myRenderer(NULL),
myWindowFlags(0), myWindowFlags(0),
@ -426,11 +425,8 @@ void FrameBufferSDL2::setTIAPalette(const uInt32* palette)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurface* FrameBufferSDL2::createSurface(int w, int h, bool isBase) const FBSurface* FrameBufferSDL2::createSurface(int w, int h) const
{ {
// Ignore 'isBase' argument; all GL surfaces are separate
// Also, this method will only be called for use in external dialogs.
// and never used for TIA surfaces
return new FBSurfaceUI((FrameBufferSDL2&)*this, w, h); return new FBSurfaceUI((FrameBufferSDL2&)*this, w, h);
} }

View File

@ -165,11 +165,10 @@ class FrameBufferSDL2 : public FrameBuffer
This method is called to create a surface compatible with the one This method is called to create a surface compatible with the one
currently in use, but having the given dimensions. currently in use, but having the given dimensions.
@param w The requested width of the new surface. @param w The requested width of the new surface.
@param h The requested height of the new surface. @param h The requested height of the new surface.
@param useBase Use the base surface instead of creating a new one
*/ */
FBSurface* createSurface(int w, int h, bool useBase = false) const; FBSurface* createSurface(int w, int h) const;
/** /**
Grabs or ungrabs the mouse based on the given boolean value. Grabs or ungrabs the mouse based on the given boolean value.
@ -220,7 +219,6 @@ class FrameBufferSDL2 : public FrameBuffer
private: private:
// The SDL video buffer // The SDL video buffer
SDL_Surface* myScreen;
SDL_Window* myWindow; SDL_Window* myWindow;
SDL_Renderer* myRenderer; SDL_Renderer* myRenderer;

View File

@ -46,7 +46,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DebuggerDialog::DebuggerDialog(OSystem* osystem, DialogContainer* parent, DebuggerDialog::DebuggerDialog(OSystem* osystem, DialogContainer* parent,
int x, int y, int w, int h) int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h, true), // use base surface : Dialog(osystem, parent, x, y, w, h),
myTab(NULL), myTab(NULL),
myRomTab(NULL), myRomTab(NULL),
myLFont(NULL), myLFont(NULL),

View File

@ -643,10 +643,10 @@ void FrameBuffer::toggleScanlineInterpolation()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 FrameBuffer::allocateSurface(int w, int h, bool useBase) uInt32 FrameBuffer::allocateSurface(int w, int h)
{ {
// Create a new surface // Create a new surface
FBSurface* surface = createSurface(w, h, useBase); FBSurface* surface = createSurface(w, h);
// Add it to the list // Add it to the list
mySurfaceList.insert(make_pair((uInt32)mySurfaceList.size(), surface)); mySurfaceList.insert(make_pair((uInt32)mySurfaceList.size(), surface));

View File

@ -186,13 +186,12 @@ class FrameBuffer
all responsibility for freeing this surface (ie, other classes must not all responsibility for freeing this surface (ie, other classes must not
delete it directly). delete it directly).
@param w The requested width of the new surface. @param w The requested width of the new surface.
@param h The requested height of the new surface. @param h The requested height of the new surface.
@param useBase Use the base surface instead of creating a new one
@return A unique ID used to identify this surface @return A unique ID used to identify this surface
*/ */
uInt32 allocateSurface(int w, int h, bool useBase = false); uInt32 allocateSurface(int w, int h);
/** /**
Retrieve the surface associated with the given ID. Retrieve the surface associated with the given ID.
@ -471,11 +470,10 @@ class FrameBuffer
This method is called to create a surface compatible with the one This method is called to create a surface compatible with the one
currently in use, but having the given dimensions. currently in use, but having the given dimensions.
@param w The requested width of the new surface. @param w The requested width of the new surface.
@param h The requested height of the new surface. @param h The requested height of the new surface.
@param useBase Use the base surface instead of creating a new one
*/ */
virtual FBSurface* createSurface(int w, int h, bool useBase = false) const = 0; virtual FBSurface* createSurface(int w, int h) const = 0;
/** /**
Change scanline intensity and interpolation. Change scanline intensity and interpolation.

View File

@ -37,7 +37,7 @@
*/ */
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dialog::Dialog(OSystem* instance, DialogContainer* parent, Dialog::Dialog(OSystem* instance, DialogContainer* parent,
int x, int y, int w, int h, bool isBase) int x, int y, int w, int h)
: GuiObject(*instance, *parent, *this, x, y, w, h), : GuiObject(*instance, *parent, *this, x, y, w, h),
_mouseWidget(0), _mouseWidget(0),
_focusedWidget(0), _focusedWidget(0),
@ -45,7 +45,6 @@ Dialog::Dialog(OSystem* instance, DialogContainer* parent,
_okWidget(0), _okWidget(0),
_cancelWidget(0), _cancelWidget(0),
_visible(false), _visible(false),
_isBase(isBase),
_processCancel(false), _processCancel(false),
_surface(0), _surface(0),
_tabID(0) _tabID(0)
@ -78,7 +77,7 @@ void Dialog::open(bool refresh)
// ignore it // ignore it
if(_surface == NULL) if(_surface == NULL)
{ {
uInt32 surfaceID = instance().frameBuffer().allocateSurface(_w, _h, _isBase); uInt32 surfaceID = instance().frameBuffer().allocateSurface(_w, _h);
_surface = instance().frameBuffer().surface(surfaceID); _surface = instance().frameBuffer().surface(surfaceID);
} }
parent().addDialog(this); parent().addDialog(this);

View File

@ -47,7 +47,7 @@ class Dialog : public GuiObject
public: public:
Dialog(OSystem* instance, DialogContainer* parent, Dialog(OSystem* instance, DialogContainer* parent,
int x, int y, int w, int h, bool isBase = false); int x, int y, int w, int h);
virtual ~Dialog(); virtual ~Dialog();
@ -55,7 +55,6 @@ class Dialog : public GuiObject
void close(bool refresh = true); void close(bool refresh = true);
bool isVisible() const { return _visible; } bool isVisible() const { return _visible; }
bool isBase() const { return _isBase; }
virtual void center(); virtual void center();
virtual void drawDialog(); virtual void drawDialog();
@ -113,7 +112,6 @@ class Dialog : public GuiObject
Widget* _okWidget; Widget* _okWidget;
Widget* _cancelWidget; Widget* _cancelWidget;
bool _visible; bool _visible;
bool _isBase;
bool _processCancel; bool _processCancel;
private: private:

View File

@ -48,7 +48,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent, LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
int x, int y, int w, int h) int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h, true), // use base surface : Dialog(osystem, parent, x, y, w, h),
myStartButton(NULL), myStartButton(NULL),
myPrevDirButton(NULL), myPrevDirButton(NULL),
myOptionsButton(NULL), myOptionsButton(NULL),

View File

@ -93,7 +93,7 @@ void RomInfoWidget::parseProperties()
if(mySurface == NULL) if(mySurface == NULL)
{ {
mySurfaceID = instance().frameBuffer().allocateSurface( mySurfaceID = instance().frameBuffer().allocateSurface(
320*myZoomLevel, 256*myZoomLevel, false); 320*myZoomLevel, 256*myZoomLevel);
mySurface = instance().frameBuffer().surface(mySurfaceID); mySurface = instance().frameBuffer().surface(mySurfaceID);
} }
else else