settings cleanup
This commit is contained in:
parent
9644c3d29f
commit
1b4a8a0b23
|
@ -33,8 +33,8 @@ namespace BizHawk.Client.EmuHawk.config.GB
|
|||
gbPrefControl1.GetSettings(out sl, out ssl);
|
||||
gbPrefControl2.GetSettings(out sr, out ssr);
|
||||
|
||||
s = new GambatteLink.GambatteLinkSettings { L = sl, R = sr };
|
||||
ss = new GambatteLink.GambatteLinkSyncSettings { L = ssl, R = ssr };
|
||||
s = new GambatteLink.GambatteLinkSettings(sl, sr);
|
||||
ss = new GambatteLink.GambatteLinkSyncSettings(ssl, ssr);
|
||||
}
|
||||
|
||||
public static void DoDGBPrefsDialog(IWin32Window owner)
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace BizHawk.Client.EmuHawk.config.GB
|
|||
|
||||
public void PutSettings(Gameboy.GambatteSettings s, Gameboy.GambatteSyncSettings ss)
|
||||
{
|
||||
this.s = s ?? Gameboy.GambatteSettings.GetDefaults();
|
||||
this.s = s ?? new Gameboy.GambatteSettings();
|
||||
this.ss = ss ?? new Gameboy.GambatteSyncSettings();
|
||||
propertyGrid1.SelectedObject = this.ss;
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
throw new Exception("gambatte_load() returned non-zero (is this not a gb or gbc rom?)");
|
||||
|
||||
// set real default colors (before anyone mucks with them at all)
|
||||
PutSettings(Settings ?? GambatteSettings.GetDefaults());
|
||||
PutSettings(Settings ?? new GambatteSettings());
|
||||
|
||||
InitSound();
|
||||
|
||||
|
@ -1006,20 +1006,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
public class GambatteSettings
|
||||
{
|
||||
public int[] GBPalette;
|
||||
public GBColors.ColorType CGBColors;
|
||||
|
||||
public static GambatteSettings GetDefaults()
|
||||
{
|
||||
var ret = new GambatteSettings();
|
||||
ret.GBPalette = new[]
|
||||
private static readonly int[] DefaultPalette = new[]
|
||||
{
|
||||
10798341, 8956165, 1922333, 337157,
|
||||
10798341, 8956165, 1922333, 337157,
|
||||
10798341, 8956165, 1922333, 337157
|
||||
};
|
||||
ret.CGBColors = GBColors.ColorType.gambatte;
|
||||
return ret;
|
||||
|
||||
public int[] GBPalette;
|
||||
public GBColors.ColorType CGBColors;
|
||||
|
||||
public GambatteSettings()
|
||||
{
|
||||
GBPalette = (int[])DefaultPalette.Clone();
|
||||
CGBColors = GBColors.ColorType.gambatte;
|
||||
}
|
||||
|
||||
public GambatteSettings Clone()
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom, object Settings, object SyncSettings, bool deterministic)
|
||||
{
|
||||
GambatteLinkSettings _Settings = (GambatteLinkSettings)Settings ?? GambatteLinkSettings.GetDefaults();
|
||||
GambatteLinkSettings _Settings = (GambatteLinkSettings)Settings ?? new GambatteLinkSettings();
|
||||
GambatteLinkSyncSettings _SyncSettings = (GambatteLinkSyncSettings)SyncSettings ?? new GambatteLinkSyncSettings();
|
||||
|
||||
CoreComm = comm;
|
||||
|
@ -449,18 +449,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
public object GetSettings()
|
||||
{
|
||||
return new GambatteLinkSettings
|
||||
{
|
||||
L = (Gameboy.GambatteSettings)L.GetSettings(),
|
||||
R = (Gameboy.GambatteSettings)R.GetSettings()
|
||||
};
|
||||
(
|
||||
(Gameboy.GambatteSettings)L.GetSettings(),
|
||||
(Gameboy.GambatteSettings)R.GetSettings()
|
||||
);
|
||||
}
|
||||
public object GetSyncSettings()
|
||||
{
|
||||
return new GambatteLinkSyncSettings
|
||||
{
|
||||
L = (Gameboy.GambatteSyncSettings)L.GetSyncSettings(),
|
||||
R = (Gameboy.GambatteSyncSettings)R.GetSyncSettings()
|
||||
};
|
||||
(
|
||||
(Gameboy.GambatteSyncSettings)L.GetSyncSettings(),
|
||||
(Gameboy.GambatteSyncSettings)R.GetSyncSettings()
|
||||
);
|
||||
}
|
||||
public bool PutSettings(object o)
|
||||
{
|
||||
|
@ -478,24 +478,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
public Gameboy.GambatteSettings L;
|
||||
public Gameboy.GambatteSettings R;
|
||||
|
||||
public static GambatteLinkSettings GetDefaults()
|
||||
public GambatteLinkSettings()
|
||||
{
|
||||
return new GambatteLinkSettings
|
||||
{
|
||||
L = Gameboy.GambatteSettings.GetDefaults(),
|
||||
R = Gameboy.GambatteSettings.GetDefaults()
|
||||
};
|
||||
L = new Gameboy.GambatteSettings();
|
||||
R = new Gameboy.GambatteSettings();
|
||||
}
|
||||
|
||||
public GambatteLinkSettings(Gameboy.GambatteSettings L, Gameboy.GambatteSettings R)
|
||||
{
|
||||
this.L = L;
|
||||
this.R = R;
|
||||
}
|
||||
|
||||
public GambatteLinkSettings Clone()
|
||||
{
|
||||
return new GambatteLinkSettings
|
||||
{
|
||||
L = L.Clone(),
|
||||
R = R.Clone()
|
||||
};
|
||||
return new GambatteLinkSettings(L.Clone(), R.Clone());
|
||||
}
|
||||
}
|
||||
|
||||
public class GambatteLinkSyncSettings
|
||||
{
|
||||
public Gameboy.GambatteSyncSettings L;
|
||||
|
@ -507,13 +507,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
R = new Gameboy.GambatteSyncSettings();
|
||||
}
|
||||
|
||||
public GambatteLinkSyncSettings(Gameboy.GambatteSyncSettings L, Gameboy.GambatteSyncSettings R)
|
||||
{
|
||||
this.L = L;
|
||||
this.R = R;
|
||||
}
|
||||
|
||||
public GambatteLinkSyncSettings Clone()
|
||||
{
|
||||
return new GambatteLinkSyncSettings
|
||||
{
|
||||
L = L.Clone(),
|
||||
R = R.Clone()
|
||||
};
|
||||
return new GambatteLinkSyncSettings(L.Clone(), R.Clone());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue