mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 06:36:08 +00:00
Ensure C# UI uses consistent culture on all threads. Closes #72
* This means that e.g. decimal separator will always be . and similar effects, which avoids the need to have culture specific formatting or special-case handling around CSV export etc.
This commit is contained in:
@@ -105,6 +105,8 @@ namespace renderdocui.Code
|
||||
// propogate float formatting settings to the Formatter class used globally to format float values
|
||||
cfg.SetupFormatter();
|
||||
|
||||
Application.CurrentCulture = new System.Globalization.CultureInfo("en-GB");
|
||||
|
||||
var core = new Core(filename, temp, cfg);
|
||||
|
||||
try
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace renderdocui.Code
|
||||
// We'll close it down when log loading finishes (whether it succeeds or fails)
|
||||
ModalPopup modal = new ModalPopup(LogLoadCallback, true);
|
||||
|
||||
Thread modalThread = new Thread(new ThreadStart(() =>
|
||||
Thread modalThread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
modal.SetModalText(string.Format("Loading Log {0}.", m_LogFile));
|
||||
|
||||
@@ -396,7 +396,7 @@ namespace renderdocui.Code
|
||||
|
||||
// this thread continually ticks and notifies any threads of the progress, through a float
|
||||
// that is updated by the main loading code
|
||||
Thread thread = new Thread(new ThreadStart(() =>
|
||||
Thread thread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
modal.LogfileProgressBegin();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
using Microsoft.Win32;
|
||||
@@ -82,6 +83,20 @@ namespace renderdocui.Code
|
||||
}
|
||||
}
|
||||
|
||||
public static Thread NewThread(ParameterizedThreadStart s)
|
||||
{
|
||||
Thread ret = new Thread(s);
|
||||
ret.CurrentCulture = Application.CurrentCulture;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static Thread NewThread(ThreadStart s)
|
||||
{
|
||||
Thread ret = new Thread(s);
|
||||
ret.CurrentCulture = Application.CurrentCulture;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void RefreshAssociations()
|
||||
{
|
||||
Win32PInvoke.SHChangeNotify(Win32PInvoke.HChangeNotifyEventID.SHCNE_ASSOCCHANGED,
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace renderdocui.Code
|
||||
|
||||
InitException = null;
|
||||
|
||||
m_Thread = new Thread(new ThreadStart(this.RunThread));
|
||||
m_Thread = Helpers.NewThread(new ThreadStart(this.RunThread));
|
||||
m_Thread.Priority = ThreadPriority.Highest;
|
||||
m_Thread.Start();
|
||||
|
||||
|
||||
@@ -1351,7 +1351,7 @@ namespace renderdocui.Windows
|
||||
Input input = state.m_Input;
|
||||
uint instance = m_CurInst;
|
||||
|
||||
Thread th = new Thread(new ThreadStart(() =>
|
||||
Thread th = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
byte[][] d = data.Buffers;
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace renderdocui.Windows
|
||||
|
||||
private void LiveCapture_Shown(object sender, EventArgs e)
|
||||
{
|
||||
m_ConnectThread = new Thread(new ThreadStart(ConnectionThreadEntry));
|
||||
m_ConnectThread = Helpers.NewThread(new ThreadStart(ConnectionThreadEntry));
|
||||
m_ConnectThread.Start();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace renderdocui.Windows.Dialogs
|
||||
|
||||
refresh.Enabled = false;
|
||||
|
||||
Thread th = new Thread(new ParameterizedThreadStart(LookupHostConnections));
|
||||
Thread th = Helpers.NewThread(new ParameterizedThreadStart(LookupHostConnections));
|
||||
th.Start(node);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace renderdocui.Windows.Dialogs
|
||||
n.Image = global::renderdocui.Properties.Resources.hourglass;
|
||||
n.Bold = false;
|
||||
|
||||
Thread th = new Thread(new ParameterizedThreadStart(LookupHostConnections));
|
||||
Thread th = Helpers.NewThread(new ParameterizedThreadStart(LookupHostConnections));
|
||||
th.Start(n);
|
||||
}
|
||||
hosts.EndUpdate();
|
||||
|
||||
@@ -561,7 +561,7 @@ namespace renderdocui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
thread = new Thread(new ThreadStart(() =>
|
||||
thread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
string[] drivers = new string[0];
|
||||
try
|
||||
@@ -644,7 +644,7 @@ namespace renderdocui.Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
thread = new Thread(new ThreadStart(() => m_Core.LoadLogfile(filename, temporary)));
|
||||
thread = Helpers.NewThread(new ThreadStart(() => m_Core.LoadLogfile(filename, temporary)));
|
||||
}
|
||||
|
||||
thread.Start();
|
||||
@@ -879,7 +879,7 @@ namespace renderdocui.Windows
|
||||
|
||||
m_Core.Config.CheckUpdate_LastUpdate = today;
|
||||
|
||||
var updateThread = new Thread(new ThreadStart(() =>
|
||||
var updateThread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
// spawn thread to check update
|
||||
WebRequest g = HttpWebRequest.Create(String.Format("http://renderdoc.org/checkupdate/{0}", VersionString));
|
||||
@@ -1263,7 +1263,7 @@ namespace renderdocui.Windows
|
||||
{
|
||||
bool killReplay = false;
|
||||
|
||||
Thread thread = new Thread(new ThreadStart(() =>
|
||||
Thread thread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
StaticExports.SpawnReplayHost(ref killReplay);
|
||||
}));
|
||||
|
||||
@@ -2302,7 +2302,7 @@ namespace renderdocui.Windows
|
||||
return;
|
||||
}
|
||||
|
||||
rangePaintThread = new Thread(new ThreadStart(() =>
|
||||
rangePaintThread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
m_Core.Renderer.Invoke((ReplayRenderer r) => { RT_UpdateAndDisplay(r); if (m_Output != null) m_Output.Display(); });
|
||||
Thread.Sleep(8);
|
||||
|
||||
Reference in New Issue
Block a user