Browse code

Add warnings to building with GCC/Clang.

* These were mostly copied from the old Makefile.
* The files including wxWidgets need -Wno-old-style-cast done in the code via pragmas because I do not want to disable that warning for the rest of the files. (It might've been overkill for some places where wxWidgets was included, but whatever.)

Naram Qashat authored on 2021/04/04 23:35:09
Showing 1 changed files
... ...
@@ -6,17 +6,29 @@
6 6
  */
7 7
 
8 8
 #include <string>
9
+#ifdef __GNUC__
10
+# pragma GCC diagnostic push
11
+# pragma GCC diagnostic ignored "-Wold-style-cast"
12
+#elif defined(__clang__)
13
+# pragma clang diagnostic push
14
+# pragma clang diagnostic ignored "-Wold-style-cast"
15
+#endif
9 16
 #include <wx/arrstr.h>
10 17
 #include <wx/choice.h>
11 18
 #include <wx/gbsizer.h>
12 19
 #include <wx/listbox.h>
13 20
 #include <wx/stattext.h>
14 21
 #include <wx/valgen.h>
22
+#ifdef __GNUC__
23
+# pragma GCC diagnostic pop
24
+#elif defined(__clang__)
25
+# pragma clang diagnostic pop
26
+#endif
15 27
 #include "XSFConfig.h"
16 28
 #include "XSFConfigDialog.h"
17 29
 #include "XSFConfigDialog_2SF.h"
18 30
 
19
-XSFConfigDialog_2SF::XSFConfigDialog_2SF(XSFConfig &config, wxWindow *parent, const wxString &title) : XSFConfigDialog(config, parent, title)
31
+XSFConfigDialog_2SF::XSFConfigDialog_2SF(XSFConfig &newConfig, wxWindow *parent, const wxString &title) : XSFConfigDialog(newConfig, parent, title)
20 32
 {
21 33
 	auto interpolationLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Interpolation");
22 34
 	this->outputSizer->Add(interpolationLabel, { 4, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
Browse code

Add wxWidgets-based configuration dialog boxes.

* Removes the configuration dialog boxes that used my DialogBuilder.
* Move default configuration values to be inlined within the headers.
* Moved 2SF's and GSF's XSFConfig classes to their own headers to accommodate the new wxWidgets dialog boxes.
* Make it so NCSF's SoundView dialog can be toggled on or off from the configuration dialog box.

Naram Qashat authored on 2021/04/04 12:46:14
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+/*
2
+ * xSF - 2SF configuration dialog
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ *
5
+ * Partially based on the vio*sf framework
6
+ */
7
+
8
+#include <string>
9
+#include <wx/arrstr.h>
10
+#include <wx/choice.h>
11
+#include <wx/gbsizer.h>
12
+#include <wx/listbox.h>
13
+#include <wx/stattext.h>
14
+#include <wx/valgen.h>
15
+#include "XSFConfig.h"
16
+#include "XSFConfigDialog.h"
17
+#include "XSFConfigDialog_2SF.h"
18
+
19
+XSFConfigDialog_2SF::XSFConfigDialog_2SF(XSFConfig &config, wxWindow *parent, const wxString &title) : XSFConfigDialog(config, parent, title)
20
+{
21
+	auto interpolationLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Interpolation");
22
+	this->outputSizer->Add(interpolationLabel, { 4, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
23
+	wxArrayString interpolationChoices;
24
+	interpolationChoices.Add("None");
25
+	interpolationChoices.Add("Linear");
26
+	interpolationChoices.Add("Cosine");
27
+	interpolationChoices.Add("Sharp");
28
+	auto interpolationChoice = new wxChoice(this->outputPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, interpolationChoices, 0, wxGenericValidator{ &this->interpolation });
29
+	this->outputSizer->Add(interpolationChoice, { 4, 1 }, { 1, 1 }, wxALL, 5);
30
+
31
+	auto muteLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Mute");
32
+	this->outputSizer->Add(muteLabel, { 5, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
33
+	wxArrayString muteChoices;
34
+	for (int i = 0; i < 16; ++i)
35
+		muteChoices.Add("SPU " + std::to_string(i + 1));
36
+	auto muteListBox = new wxListBox(this->outputPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, muteChoices, wxLB_MULTIPLE, wxGenericValidator{ &this->mute });
37
+	this->outputSizer->Add(muteListBox, { 5, 1 }, { 1, 1 }, wxALL, 5);
38
+}