Make TargetZoomFactor a per systemId setting
This commit is contained in:
parent
5e89e563d0
commit
8168031bed
|
@ -56,6 +56,31 @@ namespace BizHawk.Client.Common
|
|||
public int Input_Hotkey_OverrideOptions = 0;
|
||||
public bool StackOSDMessages = true;
|
||||
public int TargetZoomFactor = 2;
|
||||
|
||||
// TODO: move me
|
||||
public class ToomFactors : Dictionary<string, int>
|
||||
{
|
||||
public new int this[string index]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!ContainsKey(index))
|
||||
{
|
||||
Add(index, 2);
|
||||
}
|
||||
|
||||
return base[index];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
base[index] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ToomFactors TargetZoomFactors = new ToomFactors();
|
||||
|
||||
public int TargetScanlineFilterIntensity = 128; // choose between 0 and 256
|
||||
public int TargetDisplayFilter = 0;
|
||||
public int DispFinalFilter = 0;
|
||||
|
|
|
@ -786,7 +786,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
x4MenuItem.Checked =
|
||||
x5MenuItem.Checked = false;
|
||||
|
||||
switch (Global.Config.TargetZoomFactor)
|
||||
switch (Global.Config.TargetZoomFactors[Global.Emulator.SystemId])
|
||||
{
|
||||
case 1: x1MenuItem.Checked = true; break;
|
||||
case 2: x2MenuItem.Checked = true; break;
|
||||
|
@ -799,12 +799,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void WindowSize_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (sender == x1MenuItem) Global.Config.TargetZoomFactor = 1;
|
||||
if (sender == x2MenuItem) Global.Config.TargetZoomFactor = 2;
|
||||
if (sender == x3MenuItem) Global.Config.TargetZoomFactor = 3;
|
||||
if (sender == x4MenuItem) Global.Config.TargetZoomFactor = 4;
|
||||
if (sender == x5MenuItem) Global.Config.TargetZoomFactor = 5;
|
||||
if (sender == mzMenuItem) Global.Config.TargetZoomFactor = 10;
|
||||
if (sender == x1MenuItem) Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 1;
|
||||
if (sender == x2MenuItem) Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 2;
|
||||
if (sender == x3MenuItem) Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 3;
|
||||
if (sender == x4MenuItem) Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 4;
|
||||
if (sender == x5MenuItem) Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 5;
|
||||
if (sender == mzMenuItem) Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 10;
|
||||
|
||||
FrameBufferResized();
|
||||
}
|
||||
|
|
|
@ -964,7 +964,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
var video = Global.Emulator.VideoProvider();
|
||||
int zoom = Global.Config.TargetZoomFactor;
|
||||
int zoom = Global.Config.TargetZoomFactors[Global.Emulator.SystemId];
|
||||
var area = Screen.FromControl(this).WorkingArea;
|
||||
|
||||
int borderWidth = Size.Width - PresentationPanel.Control.Size.Width;
|
||||
|
@ -2257,55 +2257,55 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void IncreaseWindowSize()
|
||||
{
|
||||
switch (Global.Config.TargetZoomFactor)
|
||||
switch (Global.Config.TargetZoomFactors[Global.Emulator.SystemId])
|
||||
{
|
||||
case 1:
|
||||
Global.Config.TargetZoomFactor = 2;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 2;
|
||||
break;
|
||||
case 2:
|
||||
Global.Config.TargetZoomFactor = 3;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 3;
|
||||
break;
|
||||
case 3:
|
||||
Global.Config.TargetZoomFactor = 4;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 4;
|
||||
break;
|
||||
case 4:
|
||||
Global.Config.TargetZoomFactor = 5;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 5;
|
||||
break;
|
||||
case 5:
|
||||
Global.Config.TargetZoomFactor = 10;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 10;
|
||||
break;
|
||||
case 10:
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalWin.OSD.AddMessage("Screensize set to " + Global.Config.TargetZoomFactor + "x");
|
||||
GlobalWin.OSD.AddMessage("Screensize set to " + Global.Config.TargetZoomFactors[Global.Emulator.SystemId] + "x");
|
||||
FrameBufferResized();
|
||||
}
|
||||
|
||||
private void DecreaseWindowSize()
|
||||
{
|
||||
switch (Global.Config.TargetZoomFactor)
|
||||
switch (Global.Config.TargetZoomFactors[Global.Emulator.SystemId])
|
||||
{
|
||||
case 1:
|
||||
return;
|
||||
case 2:
|
||||
Global.Config.TargetZoomFactor = 1;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 1;
|
||||
break;
|
||||
case 3:
|
||||
Global.Config.TargetZoomFactor = 2;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 2;
|
||||
break;
|
||||
case 4:
|
||||
Global.Config.TargetZoomFactor = 3;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 3;
|
||||
break;
|
||||
case 5:
|
||||
Global.Config.TargetZoomFactor = 4;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 4;
|
||||
break;
|
||||
case 10:
|
||||
Global.Config.TargetZoomFactor = 5;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 5;
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalWin.OSD.AddMessage("Screensize set to " + Global.Config.TargetZoomFactor + "x");
|
||||
GlobalWin.OSD.AddMessage("Screensize set to " + Global.Config.TargetZoomFactors[Global.Emulator.SystemId] + "x");
|
||||
FrameBufferResized();
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
)]
|
||||
public static int GetWindowSize()
|
||||
{
|
||||
return Global.Config.TargetZoomFactor;
|
||||
return Global.Config.TargetZoomFactors[Global.Emulator.SystemId];
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -387,7 +387,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (size == 1 || size == 2 || size == 3 || size == 4 || size == 5 || size == 10)
|
||||
{
|
||||
Global.Config.TargetZoomFactor = size;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = size;
|
||||
GlobalWin.MainForm.FrameBufferResized();
|
||||
GlobalWin.OSD.AddMessage("Window size set to " + size + "x");
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
var video = Emulator.VideoProvider();
|
||||
int zoom = Global.Config.TargetZoomFactor;
|
||||
int zoom = Global.Config.TargetZoomFactors[Global.Emulator.SystemId];
|
||||
var area = Screen.FromControl(this).WorkingArea;
|
||||
|
||||
int borderWidth = Size.Width - PresentationPanel.Control.Size.Width;
|
||||
|
|
|
@ -1469,33 +1469,33 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
private void ViewSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
_1xMenuItem.Checked = Global.Config.TargetZoomFactor == 1;
|
||||
_2xMenuItem.Checked = Global.Config.TargetZoomFactor == 2;
|
||||
_3xMenuItem.Checked = Global.Config.TargetZoomFactor == 3;
|
||||
_4xMenuItem.Checked = Global.Config.TargetZoomFactor == 4;
|
||||
_1xMenuItem.Checked = Global.Config.TargetZoomFactors[Global.Emulator.SystemId] == 1;
|
||||
_2xMenuItem.Checked = Global.Config.TargetZoomFactors[Global.Emulator.SystemId] == 2;
|
||||
_3xMenuItem.Checked = Global.Config.TargetZoomFactors[Global.Emulator.SystemId] == 3;
|
||||
_4xMenuItem.Checked = Global.Config.TargetZoomFactors[Global.Emulator.SystemId] == 4;
|
||||
}
|
||||
|
||||
private void _1xMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.TargetZoomFactor = 1;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 1;
|
||||
ReRenderAllWindows();
|
||||
}
|
||||
|
||||
private void _2xMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.TargetZoomFactor = 2;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 2;
|
||||
ReRenderAllWindows();
|
||||
}
|
||||
|
||||
private void _3xMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.TargetZoomFactor = 3;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 3;
|
||||
ReRenderAllWindows();
|
||||
}
|
||||
|
||||
private void _4xMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.TargetZoomFactor = 4;
|
||||
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = 4;
|
||||
ReRenderAllWindows();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue