Correct cast operator position.
This commit is contained in:
parent
5db88e0a8f
commit
b08acb758a
10 changed files with 16 additions and 16 deletions
|
@ -184,7 +184,7 @@ namespace OpenTK
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return obj is Box2 && Equals((Box2) obj);
|
return obj is Box2 && Equals((Box2)obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -185,7 +185,7 @@ namespace OpenTK
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return obj is Box2d && Equals((Box2d) obj);
|
return obj is Box2d && Equals((Box2d)obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -306,7 +306,7 @@ namespace OpenTK
|
||||||
}
|
}
|
||||||
|
|
||||||
private static unsafe int FloatToInt32Bits(float f) {
|
private static unsafe int FloatToInt32Bits(float f) {
|
||||||
return *((int*) &f);
|
return *((int*)&f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace OpenTK.Platform.Egl
|
||||||
public override IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window,
|
public override IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window,
|
||||||
IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
|
IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
|
||||||
{
|
{
|
||||||
var angle_window = (IAngleWindowInfoInternal) window;
|
var angle_window = (IAngleWindowInfoInternal)window;
|
||||||
var egl_window = CreateWindowInfo(angle_window, major, flags);
|
var egl_window = CreateWindowInfo(angle_window, major, flags);
|
||||||
var egl_context = new EglWinContext(mode, egl_window, shareContext, major, minor, flags);
|
var egl_context = new EglWinContext(mode, egl_window, shareContext, major, minor, flags);
|
||||||
angle_window.EglContext = egl_context;
|
angle_window.EglContext = egl_context;
|
||||||
|
@ -63,7 +63,7 @@ namespace OpenTK.Platform.Egl
|
||||||
public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window,
|
public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window,
|
||||||
IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
|
IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
|
||||||
{
|
{
|
||||||
var angle_window = (IAngleWindowInfoInternal) window;
|
var angle_window = (IAngleWindowInfoInternal)window;
|
||||||
var egl_window = CreateWindowInfo(angle_window, major, flags);
|
var egl_window = CreateWindowInfo(angle_window, major, flags);
|
||||||
var egl_context = new EglWinContext(handle, egl_window, shareContext, major, minor, flags);
|
var egl_context = new EglWinContext(handle, egl_window, shareContext, major, minor, flags);
|
||||||
angle_window.EglContext = egl_context;
|
angle_window.EglContext = egl_context;
|
||||||
|
|
|
@ -152,12 +152,12 @@ namespace OpenTK.Platform.Egl
|
||||||
{
|
{
|
||||||
if (window is EglWindowInfo)
|
if (window is EglWindowInfo)
|
||||||
{
|
{
|
||||||
WindowInfo = (EglWindowInfo) window;
|
WindowInfo = (EglWindowInfo)window;
|
||||||
}
|
}
|
||||||
#if !ANDROID
|
#if !ANDROID
|
||||||
else if (window is IAngleWindowInfoInternal)
|
else if (window is IAngleWindowInfoInternal)
|
||||||
{
|
{
|
||||||
WindowInfo = ((IAngleWindowInfoInternal) window).EglWindowInfo;
|
WindowInfo = ((IAngleWindowInfoInternal)window).EglWindowInfo;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -263,9 +263,9 @@ namespace OpenTK.Platform.Egl
|
||||||
var internalContext = sharedContext as IGraphicsContextInternal;
|
var internalContext = sharedContext as IGraphicsContextInternal;
|
||||||
if (internalContext != null)
|
if (internalContext != null)
|
||||||
{
|
{
|
||||||
return (EglContext) internalContext.Implementation;
|
return (EglContext)internalContext.Implementation;
|
||||||
}
|
}
|
||||||
return (EglContext) sharedContext;
|
return (EglContext)sharedContext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace OpenTK.Platform.Egl
|
||||||
IntPtr[] configs = new IntPtr[1];
|
IntPtr[] configs = new IntPtr[1];
|
||||||
int[] attribList = new int[]
|
int[] attribList = new int[]
|
||||||
{
|
{
|
||||||
Egl.SURFACE_TYPE, (int) surfaceType,
|
Egl.SURFACE_TYPE, (int)surfaceType,
|
||||||
Egl.RENDERABLE_TYPE, (int)renderableFlags,
|
Egl.RENDERABLE_TYPE, (int)renderableFlags,
|
||||||
|
|
||||||
Egl.RED_SIZE, color.Red,
|
Egl.RED_SIZE, color.Red,
|
||||||
|
|
|
@ -426,8 +426,8 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
if (stick.AxisCaps[i].LogicalMin > 0)
|
if (stick.AxisCaps[i].LogicalMin > 0)
|
||||||
{
|
{
|
||||||
short scaled_value = (short) HidHelper.ScaleValue(
|
short scaled_value = (short)HidHelper.ScaleValue(
|
||||||
(int) ((long) value + stick.AxisCaps[i].LogicalMin),
|
(int)((long)value + stick.AxisCaps[i].LogicalMin),
|
||||||
stick.AxisCaps[i].LogicalMin, stick.AxisCaps[i].LogicalMax,
|
stick.AxisCaps[i].LogicalMin, stick.AxisCaps[i].LogicalMax,
|
||||||
Int16.MinValue, Int16.MaxValue);
|
Int16.MinValue, Int16.MaxValue);
|
||||||
stick.SetAxis(collection, page, usage, scaled_value);
|
stick.SetAxis(collection, page, usage, scaled_value);
|
||||||
|
|
|
@ -109,7 +109,7 @@ namespace OpenTK.Platform.Windows
|
||||||
// making a guess at backwards compatability. Not sure what older windows returns in these cases...
|
// making a guess at backwards compatability. Not sure what older windows returns in these cases...
|
||||||
if (deviceClass == null || deviceClass.Equals(string.Empty)){
|
if (deviceClass == null || deviceClass.Equals(string.Empty)){
|
||||||
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID);
|
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID);
|
||||||
deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty;
|
deviceClass = classGUIDKey != null ? (string)classGUIDKey.GetValue("Class") : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(deviceDesc))
|
if (String.IsNullOrEmpty(deviceDesc))
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace OpenTK.Platform.Windows
|
||||||
// Added to address OpenTK issue 3198 with mouse on Windows 8
|
// Added to address OpenTK issue 3198 with mouse on Windows 8
|
||||||
string deviceClassGUID = (string)regkey.GetValue("ClassGUID");
|
string deviceClassGUID = (string)regkey.GetValue("ClassGUID");
|
||||||
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID);
|
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID);
|
||||||
deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty;
|
deviceClass = classGUIDKey != null ? (string)classGUIDKey.GetValue("Class") : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
// deviceDesc remained null on a new Win7 system - not sure why.
|
// deviceDesc remained null on a new Win7 system - not sure why.
|
||||||
|
|
|
@ -553,7 +553,7 @@ namespace OpenTK.Platform.X11
|
||||||
public byte A, R, G, B;
|
public byte A, R, G, B;
|
||||||
public Pixel(byte a, byte r, byte g, byte b)
|
public Pixel(byte a, byte r, byte g, byte b)
|
||||||
{
|
{
|
||||||
A= a;
|
A = a;
|
||||||
R = r;
|
R = r;
|
||||||
G = g;
|
G = g;
|
||||||
B = b;
|
B = b;
|
||||||
|
@ -602,7 +602,7 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
for (int x = 0; x < width; ++x)
|
for (int x = 0; x < width; ++x)
|
||||||
{
|
{
|
||||||
byte bit = (byte) (1 << (msbfirst ? (7 - (x & 7)) : (x & 7)));
|
byte bit = (byte)(1 << (msbfirst ? (7 - (x & 7)) : (x & 7)));
|
||||||
int offset = y * stride + (x >> 3);
|
int offset = y * stride + (x >> 3);
|
||||||
|
|
||||||
if (image.GetPixel(x, y).A >= 128)
|
if (image.GetPixel(x, y).A >= 128)
|
||||||
|
|
Loading…
Reference in a new issue