Clear FB before running autodetection.

This commit is contained in:
Christian Speckner 2017-11-26 23:24:05 +01:00
parent 1c10f55bb0
commit 35ae38572c
5 changed files with 34 additions and 2 deletions

16
.vscode/settings.json vendored
View File

@ -12,5 +12,19 @@
"editor.trimAutoWhitespace": true, "editor.trimAutoWhitespace": true,
"editor.useTabStops": false, "editor.useTabStops": false,
"C_Cpp.intelliSenseEngine": "Default", "C_Cpp.intelliSenseEngine": "Default",
"files.insertFinalNewline": true "files.insertFinalNewline": true,
"files.associations": {
"__split_buffer": "cpp",
"__tree": "cpp",
"atomic": "cpp",
"deque": "cpp",
"ios": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"vector": "cpp"
}
} }

View File

@ -298,3 +298,10 @@ void FrameBufferSDL2::readPixels(uInt8* pixels, uInt32 pitch,
SDL_RenderReadPixels(myRenderer, &r, 0, pixels, pitch); SDL_RenderReadPixels(myRenderer, &r, 0, pixels, pitch);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSDL2::clear()
{
invalidate();
postFrameUpdate();
}

View File

@ -95,6 +95,11 @@ class FrameBufferSDL2 : public FrameBuffer
*/ */
void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const override; void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const override;
/**
Clear the frame buffer
*/
void clear() override;
protected: protected:
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// The following are derived from protected methods in FrameBuffer.hxx // The following are derived from protected methods in FrameBuffer.hxx

View File

@ -117,8 +117,9 @@ Console::Console(OSystem& osystem, unique_ptr<Cartridge>& cart,
const string& md5 = myProperties.get(Cartridge_MD5); const string& md5 = myProperties.get(Cartridge_MD5);
setControllers(md5); setControllers(md5);
// Mute audio while autodetection runs // Mute audio and clear framebuffer while autodetection runs
myOSystem.sound().mute(1); myOSystem.sound().mute(1);
myOSystem.frameBuffer().clear();
if(myDisplayFormat == "AUTO" || myOSystem.settings().getBool("rominfo")) if(myDisplayFormat == "AUTO" || myOSystem.settings().getBool("rominfo"))
{ {

View File

@ -304,6 +304,11 @@ class FrameBuffer
*/ */
virtual void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const = 0; virtual void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const = 0;
/**
Clear the framebuffer.
*/
virtual void clear() = 0;
protected: protected:
/** /**
This method is called to query and initialize the video hardware This method is called to query and initialize the video hardware