Skip to content

Commit

Permalink
Merged up to r9284 This marks the 1.9.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
hegyak committed Apr 6, 2015
1 parent e789fa7 commit 6e535d5
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 99 deletions.
112 changes: 83 additions & 29 deletions BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 88 additions & 21 deletions BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public partial class N64VideoPluginconfig : Form
"1400 x 1050",
"1600 x 1200",
"1920 x 1440",
"2048 x 1536"
"2048 x 1536",
"Custom"
};

string[] validResolutionsJabo = {
Expand Down Expand Up @@ -126,10 +127,23 @@ private void button1_Click(object sender, EventArgs e)
private void SaveSettings()
{
// Global
var video_settings = VideoResolutionComboBox.SelectedItem.ToString();
var strArr = video_settings.Split('x');
s.VideoSizeX = int.Parse(strArr[0].Trim());
s.VideoSizeY = int.Parse(strArr[1].Trim());
if (VideoResolutionComboBox.Text != "Custom")
{
var video_settings = VideoResolutionComboBox.SelectedItem.ToString();
var strArr = video_settings.Split('x');
s.VideoSizeX = int.Parse(strArr[0].Trim());
s.VideoSizeY = int.Parse(strArr[1].Trim());
}
else
{
s.VideoSizeX =
VideoResolutionXTextBox.Text.IsUnsigned() ?
int.Parse(VideoResolutionXTextBox.Text) : 320;

s.VideoSizeY =
VideoResolutionYTextBox.Text.IsUnsigned() ?
int.Parse(VideoResolutionYTextBox.Text) : 240;
}
switch (PluginComboBox.Text)
{
case "Rice": ss.VideoPlugin = PluginType.Rice; break;
Expand Down Expand Up @@ -420,6 +434,9 @@ private void N64VideoPluginconfig_Load(object sender, EventArgs e)
break;
}

VideoResolutionXTextBox.Text = s.VideoSizeX.ToString();
VideoResolutionYTextBox.Text = s.VideoSizeY.ToString();

var video_setting = s.VideoSizeX
+ " x "
+ s.VideoSizeY;
Expand All @@ -429,6 +446,11 @@ private void N64VideoPluginconfig_Load(object sender, EventArgs e)
{
VideoResolutionComboBox.SelectedIndex = index;
}
else if (PluginComboBox.SelectedIndex != 4)
{
VideoResolutionComboBox.SelectedIndex = 13;
ShowCustomVideoResolutionControls();
}

// Jabo
JaboUseForGameCheckbox.Checked = ss.JaboPlugin.UseDefaultHacks;
Expand Down Expand Up @@ -958,10 +980,21 @@ private void PluginComboBox_SelectedIndexChanged(object sender, EventArgs e)
VideoResolutionComboBox.SelectedIndex = 0;
}

var strArr = new string[] {};
int OldSizeX, OldSizeY;

var oldResolution = VideoResolutionComboBox.SelectedItem.ToString();
var strArr = oldResolution.Split('x');
int OldSizeX = int.Parse(strArr[0].Trim());
int OldSizeY = int.Parse(strArr[1].Trim());
if (oldResolution != "Custom")
{
strArr = oldResolution.Split('x');
OldSizeX = int.Parse(strArr[0].Trim());
OldSizeY = int.Parse(strArr[1].Trim());
}
else
{
OldSizeX = int.Parse(VideoResolutionXTextBox.Text);
OldSizeY = int.Parse(VideoResolutionYTextBox.Text);
}

if (PluginComboBox.Text == "Jabo 1.6.1")
{
Expand All @@ -988,21 +1021,24 @@ private void PluginComboBox_SelectedIndexChanged(object sender, EventArgs e)
int bestFit = -1;
for (int i = 0; i < VideoResolutionComboBox.Items.Count; i++)
{
string option = (string)VideoResolutionComboBox.Items[i];
strArr = option.Split('x');
int newSizeX = int.Parse(strArr[0].Trim());
int newSizeY = int.Parse(strArr[1].Trim());
if (OldSizeX < newSizeX || OldSizeX == newSizeX && OldSizeY < newSizeY)
if ((string)VideoResolutionComboBox.Items[i] != "Custom")
{
if (i == 0)
string option = (string)VideoResolutionComboBox.Items[i];
strArr = option.Split('x');
int newSizeX = int.Parse(strArr[0].Trim());
int newSizeY = int.Parse(strArr[1].Trim());
if (OldSizeX < newSizeX || OldSizeX == newSizeX && OldSizeY < newSizeY)
{
bestFit = 0;
break;
}
else
{
bestFit = i - 1;
break;
if (i == 0)
{
bestFit = 0;
break;
}
else
{
bestFit = i - 1;
break;
}
}
}
}
Expand Down Expand Up @@ -1048,5 +1084,36 @@ private void JaboUpdateHacksSection()
}
}

private void VideoResolutionComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (VideoResolutionComboBox.Text == "Custom")
{
ShowCustomVideoResolutionControls();
}
else
{
HideCustomVideoResolutionControls();
var new_resolution = VideoResolutionComboBox.SelectedItem.ToString();
var strArr = new_resolution.Split('x');
VideoResolutionXTextBox.Text = strArr[0].Trim();
VideoResolutionYTextBox.Text = strArr[1].Trim();
}
}

private void ShowCustomVideoResolutionControls()
{
LabelVideoResolutionX.Visible = true;
LabelVideoResolutionY.Visible = true;
VideoResolutionXTextBox.Visible = true;
VideoResolutionYTextBox.Visible = true;
}

private void HideCustomVideoResolutionControls()
{
LabelVideoResolutionX.Visible = false;
LabelVideoResolutionY.Visible = false;
VideoResolutionXTextBox.Visible = false;
VideoResolutionYTextBox.Visible = false;
}
}
}
Loading

0 comments on commit 6e535d5

Please sign in to comment.