Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Stella
Commits
95c8203f
Commit
95c8203f
authored
Jan 23, 2021
by
Stephen Anthony
Browse files
Fix final issue with snapshots not loading in RomInfoWidget.
parent
3a54adec
Pipeline
#12122
passed with stages
in 2 minutes and 1 second
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/common/FBBackendSDL2.cxx
View file @
95c8203f
...
...
@@ -71,8 +71,6 @@ FBBackendSDL2::~FBBackendSDL2()
myWindow
=
nullptr
;
}
SDL_QuitSubSystem
(
SDL_INIT_VIDEO
|
SDL_INIT_TIMER
);
cerr
<<
"~FBBackendSDL2()"
<<
endl
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
src/common/FBSurfaceSDL2.cxx
View file @
95c8203f
...
...
@@ -40,8 +40,6 @@ namespace {
}
}
static
int
REF_COUNT
=
0
;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurfaceSDL2
::
FBSurfaceSDL2
(
FBBackendSDL2
&
backend
,
uInt32
width
,
uInt32
height
,
...
...
@@ -50,7 +48,6 @@ FBSurfaceSDL2::FBSurfaceSDL2(FBBackendSDL2& backend,
:
myBackend
{
backend
},
myInterpolationMode
{
inter
}
{
REF_COUNT
++
;
createSurface
(
width
,
height
,
staticData
);
}
...
...
@@ -61,8 +58,6 @@ FBSurfaceSDL2::~FBSurfaceSDL2()
if
(
mySurface
)
{
REF_COUNT
--
;
cerr
<<
" ~FBSurfaceSDL2(): "
<<
this
<<
" "
<<
REF_COUNT
<<
endl
;
SDL_FreeSurface
(
mySurface
);
mySurface
=
nullptr
;
}
...
...
src/emucore/FrameBuffer.cxx
View file @
95c8203f
...
...
@@ -67,7 +67,6 @@ FrameBuffer::FrameBuffer(OSystem& osystem)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBuffer
::~
FrameBuffer
()
{
cerr
<<
"~FrameBuffer()"
<<
endl
<<
endl
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
src/gui/Dialog.cxx
View file @
95c8203f
...
...
@@ -50,7 +50,8 @@ Dialog::Dialog(OSystem& instance, DialogContainer& parent, const GUI::Font& font
const
string
&
title
,
int
x
,
int
y
,
int
w
,
int
h
)
:
GuiObject
(
instance
,
parent
,
*
this
,
x
,
y
,
w
,
h
),
_font
{
font
},
_title
{
title
}
_title
{
title
},
_renderCallback
{[]()
{
return
;
}}
{
_flags
=
Widget
::
FLAG_ENABLED
|
Widget
::
FLAG_BORDER
|
Widget
::
FLAG_CLEARBG
;
setTitle
(
title
);
...
...
@@ -75,8 +76,6 @@ Dialog::~Dialog()
_firstWidget
=
nullptr
;
_buttonGroup
.
clear
();
cerr
<<
"
\n
~Dialog(): "
<<
this
<<
endl
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
@@ -163,6 +162,12 @@ void Dialog::setDirtyChain()
_dirtyChain
=
true
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
Dialog
::
resetSurfaces
()
{
_surface
->
reload
();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
Dialog
::
tick
()
{
...
...
@@ -241,11 +246,7 @@ void Dialog::render()
// Update dialog surface; also render any extra surfaces
// Extra surfaces must be rendered afterwards, so they are drawn on top
if
(
_surface
->
render
())
{
mySurfaceStack
.
applyAll
([](
unique_ptr
<
FBSurface
>&
surface
)
{
surface
->
render
();
});
}
_renderCallback
();
// A dialog is still on top if a non-shading dialog (e.g. ContextMenu)
// is opended above it.
...
...
@@ -422,10 +423,9 @@ void Dialog::buildCurrentFocusList(int tabID)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
Dialog
::
add
Surf
ac
e
(
const
unique_ptr
<
FBSurface
>&
surf
ac
e
)
void
Dialog
::
add
RenderCallb
ac
k
(
const
std
::
function
<
void
()
>&
callb
ac
k
)
{
// FIXME : add this to the stack somehow
// mySurfaceStack.push(surface);
_renderCallback
=
callback
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
src/gui/Dialog.hxx
View file @
95c8203f
...
...
@@ -28,7 +28,6 @@ class TabWidget;
class
CommandSender
;
class
ToolTip
;
#include "Stack.hxx"
#include "Widget.hxx"
#include "GuiObject.hxx"
#include "StellaKeys.hxx"
...
...
@@ -45,6 +44,8 @@ class Dialog : public GuiObject
friend
class
DialogContainer
;
public:
using
RenderCallback
=
std
::
function
<
void
()
>
;
Dialog
(
OSystem
&
instance
,
DialogContainer
&
parent
,
int
x
=
0
,
int
y
=
0
,
int
w
=
0
,
int
h
=
0
);
Dialog
(
OSystem
&
instance
,
DialogContainer
&
parent
,
const
GUI
::
Font
&
font
,
...
...
@@ -62,6 +63,8 @@ class Dialog : public GuiObject
virtual
void
saveConfig
()
{
}
virtual
void
setDefaults
()
{
}
virtual
void
resetSurfaces
();
void
setDirty
()
override
;
void
setDirtyChain
()
override
;
void
redraw
(
bool
force
=
false
);
...
...
@@ -85,12 +88,11 @@ class Dialog : public GuiObject
FBSurface
&
surface
()
const
{
return
*
_surface
;
}
/**
Adds a surface to this dialog, which is rendered on top of the
base surface whenever the base surface is re-rendered. Since
the surface render() call will always occur in such a case, the
surface should call setVisible() to enable/disable its output.
This method is called each time the main Dialog::render is called.
It is called *after* the dialog has been rendered, so it can be
used to render another surface on top of it, among other things.
*/
void
add
Surf
ac
e
(
const
unique_ptr
<
FBSurface
>&
surf
ac
e
);
void
add
RenderCallb
ac
k
(
const
RenderCallback
&
callb
ac
k
);
void
setTitle
(
const
string
&
title
);
bool
hasTitle
()
{
return
!
_title
.
empty
();
}
...
...
@@ -253,7 +255,7 @@ class Dialog : public GuiObject
uInt32
_max_w
{
0
};
// maximum wanted width
uInt32
_max_h
{
0
};
// maximum wanted height
Common
::
FixedStack
<
unique_ptr
<
FBSurface
>>
mySurfaceSt
ack
;
RenderCallback
_renderCallb
ack
;
private:
// Following constructors and assignment operators not supported
...
...
src/gui/DialogContainer.cxx
View file @
95c8203f
...
...
@@ -203,7 +203,7 @@ void DialogContainer::reStack()
void
DialogContainer
::
resetSurfaces
()
{
myDialogStack
.
applyAll
([
&
](
Dialog
*&
d
)
{
d
->
surface
().
reload
();
d
->
resetSurfaces
();
});
}
...
...
src/gui/LauncherDialog.cxx
View file @
95c8203f
...
...
@@ -350,6 +350,15 @@ void LauncherDialog::reload()
myPendingReload
=
false
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
LauncherDialog
::
resetSurfaces
()
{
if
(
myRomInfoWidget
)
myRomInfoWidget
->
resetSurfaces
();
Dialog
::
resetSurfaces
();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
LauncherDialog
::
tick
()
{
...
...
src/gui/LauncherDialog.hxx
View file @
95c8203f
...
...
@@ -108,6 +108,7 @@ class LauncherDialog : public Dialog
void
loadConfig
()
override
;
void
saveConfig
()
override
;
void
resetSurfaces
()
override
;
void
updateUI
();
/**
...
...
src/gui/RomInfoWidget.cxx
View file @
95c8203f
...
...
@@ -94,7 +94,11 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
myAvail
.
w
,
myAvail
.
h
,
ScalingInterpolation
::
blur
);
mySurface
->
applyAttributes
();
dialog
().
addSurface
(
mySurface
);
dialog
().
addRenderCallback
([
this
]()
{
if
(
mySurfaceIsValid
)
mySurface
->
render
();
}
);
}
// Initialize to empty properties entry
...
...
@@ -169,6 +173,13 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
setDirty
();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
RomInfoWidget
::
resetSurfaces
()
{
if
(
mySurface
)
mySurface
->
reload
();
}
#ifdef PNG_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool
RomInfoWidget
::
loadPng
(
const
string
&
filename
)
...
...
src/gui/RomInfoWidget.hxx
View file @
95c8203f
...
...
@@ -39,6 +39,8 @@ class RomInfoWidget : public Widget
void
clearProperties
();
void
reloadProperties
(
const
FilesystemNode
&
node
);
void
resetSurfaces
();
protected:
void
drawWidget
(
bool
hilite
)
override
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment