Some misc cleanup of redundant qualifiers

This commit is contained in:
adelikat 2014-05-04 14:10:28 +00:00
parent 5c9977e7b3
commit 0b6795fffc
6 changed files with 32 additions and 44 deletions

View File

@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
public MainForm(string[] args) public MainForm(string[] args)
{ {
GlobalWin.MainForm = this; GlobalWin.MainForm = this;
Global.Rewinder = new Rewinder() Global.Rewinder = new Rewinder
{ {
MessageCallback = GlobalWin.OSD.AddMessage MessageCallback = GlobalWin.OSD.AddMessage
}; };
@ -703,25 +703,24 @@ namespace BizHawk.Client.EmuHawk
// also handle floats // also handle floats
conInput.AcceptNewFloats(Input.Instance.GetFloats().Select(o => conInput.AcceptNewFloats(Input.Instance.GetFloats().Select(o =>
{
// hackish
if (o.Item1 == "WMouse X")
{ {
// hackish var P = GlobalWin.DisplayManager.UntransformPoint(new System.Drawing.Point((int)o.Item2, 0));
if (o.Item1 == "WMouse X") float x = P.X / (float)Global.Emulator.VideoProvider.BufferWidth;
{ return new Tuple<string, float>("WMouse X", x * 20000 - 10000);
var P = GlobalWin.DisplayManager.UntransformPoint(new System.Drawing.Point((int)o.Item2, 0)); }
float x = P.X / (float)Global.Emulator.VideoProvider.BufferWidth;
return new Tuple<string, float>("WMouse X", x * 20000 - 10000); if (o.Item1 == "WMouse Y")
} {
else if (o.Item1 == "WMouse Y") var P = GlobalWin.DisplayManager.UntransformPoint(new System.Drawing.Point(0, (int)o.Item2));
{ float y = P.Y / (float)Global.Emulator.VideoProvider.BufferHeight;
var P = GlobalWin.DisplayManager.UntransformPoint(new System.Drawing.Point(0, (int)o.Item2)); return new Tuple<string, float>("WMouse Y", y * 20000 - 10000);
float y = P.Y / (float)Global.Emulator.VideoProvider.BufferHeight; }
return new Tuple<string, float>("WMouse Y", y * 20000 - 10000);
} return o;
else }));
{
return o;
}
}));
} }
public void RebootCore() public void RebootCore()
@ -2345,38 +2344,38 @@ namespace BizHawk.Client.EmuHawk
if (!attributes.Ported) if (!attributes.Ported)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.CorpHawkSmall; CoreNameStatusBarButton.Image = Properties.Resources.CorpHawkSmall;
} }
else else
{ {
if (Global.Emulator is QuickNES) if (Global.Emulator is QuickNES)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.QuickNes; CoreNameStatusBarButton.Image = Properties.Resources.QuickNes;
} }
else if (Global.Emulator is LibsnesCore) else if (Global.Emulator is LibsnesCore)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.bsnes; CoreNameStatusBarButton.Image = Properties.Resources.bsnes;
CoreNameStatusBarButton.Text += " (" + ((LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings()).Profile + ")"; CoreNameStatusBarButton.Text += " (" + ((LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings()).Profile + ")";
} }
else if (Global.Emulator is Yabause) else if (Global.Emulator is Yabause)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.yabause; CoreNameStatusBarButton.Image = Properties.Resources.yabause;
} }
else if (Global.Emulator is Atari7800) else if (Global.Emulator is Atari7800)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.emu7800; CoreNameStatusBarButton.Image = Properties.Resources.emu7800;
} }
else if (Global.Emulator is GBA) else if (Global.Emulator is GBA)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.meteor; CoreNameStatusBarButton.Image = Properties.Resources.meteor;
} }
else if (Global.Emulator is GPGX) else if (Global.Emulator is GPGX)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.genplus; CoreNameStatusBarButton.Image = Properties.Resources.genplus;
} }
else if (Global.Emulator is PSP) else if (Global.Emulator is PSP)
{ {
CoreNameStatusBarButton.Image = BizHawk.Client.EmuHawk.Properties.Resources.ppsspp; CoreNameStatusBarButton.Image = Properties.Resources.ppsspp;
} }
else if (Global.Emulator is Gameboy) else if (Global.Emulator is Gameboy)
{ {

View File

@ -1,10 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Emulation.Cores.Nintendo.SNES; using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Client.Common; using BizHawk.Client.Common;
@ -42,13 +36,13 @@ namespace BizHawk.Client.EmuHawk
private void btnOk_Click(object sender, EventArgs e) private void btnOk_Click(object sender, EventArgs e)
{ {
DialogResult = System.Windows.Forms.DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
} }
private void btnCancel_Click(object sender, EventArgs e) private void btnCancel_Click(object sender, EventArgs e)
{ {
DialogResult = System.Windows.Forms.DialogResult.Cancel; DialogResult = DialogResult.Cancel;
Close(); Close();
} }

View File

@ -1853,7 +1853,7 @@ namespace BizHawk.Client.EmuHawk
return; return;
} }
if ((Control.ModifierKeys & (Keys.Control | Keys.Shift | Keys.Alt)) != 0) if ((ModifierKeys & (Keys.Control | Keys.Shift | Keys.Alt)) != 0)
{ {
return; return;
} }

View File

@ -404,7 +404,7 @@ namespace BizHawk.Client.EmuHawk
} }
catch (Exception ex) catch (Exception ex)
{ {
if (ex is LuaInterface.LuaScriptException || ex is LuaInterface.LuaException) if (ex is LuaScriptException || ex is LuaException)
{ {
lf.Enabled = false; lf.Enabled = false;
lf.Thread = null; lf.Thread = null;

View File

@ -206,7 +206,7 @@ namespace BizHawk.Client.EmuHawk
DrawPatternView(PatternView, _ppuBus); DrawPatternView(PatternView, _ppuBus);
} }
var bmpdata2 = SpriteView.sprites.LockBits(new Rectangle(new Point(0, 0), SpriteView.sprites.Size), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); var bmpdata2 = SpriteView.sprites.LockBits(new Rectangle(new Point(0, 0), SpriteView.sprites.Size), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
var framebuf2 = (int*)bmpdata2.Scan0.ToPointer(); var framebuf2 = (int*)bmpdata2.Scan0.ToPointer();
int pt_add = _nes.ppu.reg_2000.obj_pattern_hi ? 0x1000 : 0; int pt_add = _nes.ppu.reg_2000.obj_pattern_hi ? 0x1000 : 0;

View File

@ -1,9 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
@ -22,7 +17,7 @@ namespace BizHawk.Client.EmuHawk
SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.DoubleBuffer, true);
Appearance = System.Windows.Forms.Appearance.Button; Appearance = Appearance.Button;
ForeColor = Color.Black; ForeColor = Color.Black;
} }