From 7904f3e900ded8f05056074c828bab78dfe45e4b Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 13 Jul 2017 21:45:57 -0230 Subject: [PATCH] Updated Visual Studio project file for ColorWidget move. Fixed crash when attempting to enter "Video Settings" from the ROM launcher; in that case, 'Debug Colors' must be disabled, since the widgets only take effect in emulation mode. --- src/gui/OptionsDialog.cxx | 4 ++-- src/gui/SnapshotDialog.cxx | 5 ++--- src/gui/SnapshotDialog.hxx | 2 +- src/gui/VideoDialog.cxx | 9 +++++++-- src/gui/VideoDialog.hxx | 2 +- src/windows/Stella.vcxproj | 4 ++-- src/windows/Stella.vcxproj.filters | 12 ++++++------ 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index ff30df2f5..6db2ba897 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -116,11 +116,11 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, addCancelWidget(b); // Now create all the dialogs attached to each menu button - myVideoDialog = make_ptr(osystem, parent, font, max_w, max_h); + myVideoDialog = make_ptr(osystem, parent, font, max_w, max_h, myIsGlobal); myAudioDialog = make_ptr(osystem, parent, font); myInputDialog = make_ptr(osystem, parent, font, max_w, max_h); myUIDialog = make_ptr(osystem, parent, font); - mySnapshotDialog = make_ptr(osystem, parent, font, boss); + mySnapshotDialog = make_ptr(osystem, parent, font); myConfigPathDialog = make_ptr(osystem, parent, font, boss); myRomAuditDialog = make_ptr(osystem, parent, font, max_w, max_h); myGameInfoDialog = make_ptr(osystem, parent, font, this); diff --git a/src/gui/SnapshotDialog.cxx b/src/gui/SnapshotDialog.cxx index b3c3785ed..e6e0b4c3c 100644 --- a/src/gui/SnapshotDialog.cxx +++ b/src/gui/SnapshotDialog.cxx @@ -27,9 +27,8 @@ #include "SnapshotDialog.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SnapshotDialog::SnapshotDialog( - OSystem& osystem, DialogContainer& parent, - const GUI::Font& font, GuiObject* boss) +SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent, + const GUI::Font& font) : Dialog(osystem, parent), myFont(font) { diff --git a/src/gui/SnapshotDialog.hxx b/src/gui/SnapshotDialog.hxx index 343fc2923..989967d83 100644 --- a/src/gui/SnapshotDialog.hxx +++ b/src/gui/SnapshotDialog.hxx @@ -35,7 +35,7 @@ class SnapshotDialog : public Dialog { public: SnapshotDialog(OSystem& osystem, DialogContainer& parent, - const GUI::Font& font, GuiObject* boss); + const GUI::Font& font); virtual ~SnapshotDialog() = default; private: diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx index 2b87da86c..5d9aa5e7d 100644 --- a/src/gui/VideoDialog.cxx +++ b/src/gui/VideoDialog.cxx @@ -37,7 +37,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent, - const GUI::Font& font, int max_w, int max_h) + const GUI::Font& font, int max_w, int max_h, bool isGlobal) : Dialog(osystem, parent) { const int lineHeight = font.getLineHeight(), @@ -333,6 +333,11 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent, myDbgColourSwatch[idx] = new ColorWidget(myTab, font, x, ypos, uInt32(2*lineHeight), lineHeight); ypos += lineHeight + 8; + if(isGlobal) + { + myDbgColour[idx]->clearFlags(WIDGET_ENABLED); + myDbgColourSwatch[idx]->clearFlags(WIDGET_ENABLED); + } }; createDebugColourWidgets(0, "Player 0 "); @@ -676,7 +681,7 @@ void VideoDialog::handleTVJitterChange(bool enable) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void VideoDialog::handleDebugColours(int idx, int color) { - if(idx < 0 || idx > 5) + if(!instance().hasConsole() || idx < 0 || idx > 5) return; static constexpr int dbg_color[2][6] = { diff --git a/src/gui/VideoDialog.hxx b/src/gui/VideoDialog.hxx index 3f2cad55b..9286a250d 100644 --- a/src/gui/VideoDialog.hxx +++ b/src/gui/VideoDialog.hxx @@ -35,7 +35,7 @@ class VideoDialog : public Dialog { public: VideoDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, - int max_w, int max_h); + int max_w, int max_h, bool isGlobal); virtual ~VideoDialog() = default; private: diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index 7d36d61a3..26e4bb0d4 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -327,6 +327,7 @@ + @@ -400,7 +401,6 @@ - @@ -609,6 +609,7 @@ + @@ -695,7 +696,6 @@ - diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index 39086efa3..b70ee5d94 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -267,9 +267,6 @@ Source Files\debugger - - Source Files\debugger - Source Files\debugger @@ -849,6 +846,9 @@ Source Files\emucore + + Source Files\gui + @@ -1079,9 +1079,6 @@ Header Files\debugger - - Header Files\debugger - Header Files\debugger @@ -1727,6 +1724,9 @@ Header Files\emucore + + Header Files\gui +