mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
v2019.08.21.1
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
using CefSharp;
|
using CefSharp;
|
||||||
using CefSharp.OffScreen;
|
using CefSharp.OffScreen;
|
||||||
using SharpDX.Direct3D11;
|
using SharpDX.Direct3D11;
|
||||||
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
var context = m_Texture.Device.ImmediateContext;
|
var context = m_Texture.Device.ImmediateContext;
|
||||||
var box = context.MapSubresource(m_Texture, 0, MapMode.WriteDiscard, MapFlags.None);
|
var box = context.MapSubresource(m_Texture, 0, MapMode.WriteDiscard, MapFlags.None);
|
||||||
if (!box.IsEmpty)
|
if (box.DataPointer != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
if (box.RowPitch == H.Width * 4)
|
if (box.RowPitch == H.Width * 4)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,10 +61,7 @@ namespace VRCX
|
|||||||
client = null;
|
client = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (client != null)
|
client?.Dispose();
|
||||||
{
|
|
||||||
client.Dispose();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
IsBackground = true
|
IsBackground = true
|
||||||
|
|||||||
@@ -63,11 +63,11 @@ namespace VRCX
|
|||||||
if (di.Exists)
|
if (di.Exists)
|
||||||
{
|
{
|
||||||
var files = di.GetFiles("output_log_*.txt", SearchOption.TopDirectoryOnly);
|
var files = di.GetFiles("output_log_*.txt", SearchOption.TopDirectoryOnly);
|
||||||
Array.Sort(files, (A, B) => A.CreationTime.CompareTo(B.CreationTime));
|
Array.Sort(files, (A, B) => A.CreationTimeUtc.CompareTo(B.CreationTimeUtc));
|
||||||
var bias = DateTime.Now.AddMinutes(-5d);
|
var bias = DateTime.UtcNow.AddMinutes(-5d);
|
||||||
foreach (var fi in files)
|
foreach (var fi in files)
|
||||||
{
|
{
|
||||||
if (bias.CompareTo(fi.LastWriteTime) <= 0)
|
if (bias.CompareTo(fi.LastWriteTimeUtc) <= 0)
|
||||||
{
|
{
|
||||||
fi.Refresh();
|
fi.Refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
if (m_Storage.Count > 0)
|
if (m_Storage.Count > 0)
|
||||||
{
|
{
|
||||||
|
m_Storage.Clear();
|
||||||
m_Dirty = true;
|
m_Dirty = true;
|
||||||
}
|
}
|
||||||
m_Storage.Clear();
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
14
VRCXVR.cs
14
VRCXVR.cs
@@ -98,13 +98,13 @@ namespace VRCX
|
|||||||
var system = OpenVR.System;
|
var system = OpenVR.System;
|
||||||
if (system == null)
|
if (system == null)
|
||||||
{
|
{
|
||||||
if (DateTime.Now.CompareTo(nextInit) <= 0)
|
if (DateTime.UtcNow.CompareTo(nextInit) <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var _err = EVRInitError.None;
|
var _err = EVRInitError.None;
|
||||||
system = OpenVR.Init(ref _err, EVRApplicationType.VRApplication_Overlay);
|
system = OpenVR.Init(ref _err, EVRApplicationType.VRApplication_Overlay);
|
||||||
nextInit = DateTime.Now.AddSeconds(5);
|
nextInit = DateTime.UtcNow.AddSeconds(5);
|
||||||
if (system == null)
|
if (system == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -118,22 +118,22 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
active = false;
|
active = false;
|
||||||
OpenVR.Shutdown();
|
OpenVR.Shutdown();
|
||||||
nextInit = DateTime.Now.AddSeconds(10);
|
nextInit = DateTime.UtcNow.AddSeconds(10);
|
||||||
system = null;
|
system = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (system != null)
|
if (system != null)
|
||||||
{
|
{
|
||||||
if (DateTime.Now.CompareTo(nextDeviceUpdate) >= 0)
|
if (DateTime.UtcNow.CompareTo(nextDeviceUpdate) >= 0)
|
||||||
{
|
{
|
||||||
overlayIndex = OpenVR.k_unTrackedDeviceIndexInvalid;
|
overlayIndex = OpenVR.k_unTrackedDeviceIndexInvalid;
|
||||||
UpdateDevices(system, ref overlayIndex);
|
UpdateDevices(system, ref overlayIndex);
|
||||||
if (overlayIndex != OpenVR.k_unTrackedDeviceIndexInvalid)
|
if (overlayIndex != OpenVR.k_unTrackedDeviceIndexInvalid)
|
||||||
{
|
{
|
||||||
nextOverlay = DateTime.Now.AddSeconds(10);
|
nextOverlay = DateTime.UtcNow.AddSeconds(10);
|
||||||
}
|
}
|
||||||
nextDeviceUpdate = DateTime.Now.AddSeconds(0.1);
|
nextDeviceUpdate = DateTime.UtcNow.AddSeconds(0.1);
|
||||||
}
|
}
|
||||||
var overlay = OpenVR.Overlay;
|
var overlay = OpenVR.Overlay;
|
||||||
if (overlay != null)
|
if (overlay != null)
|
||||||
@@ -457,7 +457,7 @@ namespace VRCX
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!dashboardVisible &&
|
if (!dashboardVisible &&
|
||||||
DateTime.Now.CompareTo(nextOverlay) <= 0)
|
DateTime.UtcNow.CompareTo(nextOverlay) <= 0)
|
||||||
{
|
{
|
||||||
var texture = new Texture_t
|
var texture = new Texture_t
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user