1. André Schnabel
  2. Kosu

Commits

André Schnabel  committed 85f9b0c

Removed redundant code

  • Participants
  • Parent commits 2b38a89
  • Branches default

Comments (0)

Files changed (2)

File Cameras/PerspectiveCamera.cs

View file
  • Ignore whitespace
 using Kosu.Math;
-using Kosu.Utilities;
-
 #if MOBILE
 using OpenTK.Graphics.ES11;
 using MatrixMode = OpenTK.Graphics.ES11.All;

File Platforms/Desktop/DesktopBasecode.cs

View file
  • Ignore whitespace
 				state = (State) constructor.Invoke(new object[] {this});
 			}
 
-			if(Environment.OSVersion.Platform != PlatformID.Unix || IsRunningOnMac())
+			if(Environment.OSVersion.Platform != PlatformID.Unix || Utils.IsRunningOnMac())
 				RegisterMouseHandlers();
 		}
 
-		//From Managed.Windows.Forms/XplatUI
-		[DllImport("libc")]
-		private static extern int uname(IntPtr buf);
-
-		private static bool IsRunningOnMac() {
-			IntPtr buf = IntPtr.Zero;
-			try {
-				buf = Marshal.AllocHGlobal(8192);
-				// This is a hacktastic way of getting sysname from uname ()
-				if(uname(buf) == 0) {
-					string os = Marshal.PtrToStringAnsi(buf);
-					if(os == "Darwin")
-						return true;
-				}
-			}
-			catch {}
-			finally {
-				if(buf != IntPtr.Zero)
-					Marshal.FreeHGlobal(buf);
-			}
-			return false;
-		}
-
 		protected override void OnMove(EventArgs e) {
 			base.OnMove(e);
 		}
 
 		#region Count update stuff
 		private long timeCtr = Utils.GetTicks();
-		private long frameCtr = 0;
+		private long frameCtr;
 
 		private void CountUpdates() {
 			if(Utils.GetTicks() - timeCtr >= 1000) {
 			}
 
 			// Linux case
-			if(Environment.OSVersion.Platform == PlatformID.Unix && !IsRunningOnMac()) {
+			if(Environment.OSVersion.Platform == PlatformID.Unix && !Utils.IsRunningOnMac()) {
 				MouseState mstate = OpenTK.Input.Mouse.GetState();
 				mouseX = Mouse.X;
 				mouseY = Mouse.Y;