Skip to content

Commit

Permalink
workaround images not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
rehdi93 committed Oct 18, 2018
1 parent a8e47a1 commit 6455d6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Src/BRClib/RenderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System.IO;
using System.Diagnostics;
using FrameSet = System.Collections.Concurrent.ConcurrentHashSet<int>;
using Timer = System.Timers.Timer;
using static BRClib.Global;

namespace BRClib
Expand Down Expand Up @@ -49,7 +48,7 @@ public void StartAsync()

_RunWorker = true;
_Worker = new Thread(QLoop);
_Worker.Name = "Render queueing thread";
_Worker.Name = "Render queue thread";
_Worker.Start();
}

Expand Down
14 changes: 10 additions & 4 deletions Src/BlenderRenderController_gtk/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ static class Program
[STAThread]
static void Main()
{
//string pstr = System.Configuration.ConfigurationManager.AppSettings["portable"];
//bool portable = bool.TryParse(pstr, out bool r) ? r : false;
var pstr = Environment.GetEnvironmentVariable("BRC_PORTABLE_MODE");
bool portable_mode = false;
bool.TryParse(pstr, out portable_mode);

Global.Init(portable_mode);

Global.Init(true); // TODO: Control portable mode
Environment.CurrentDirectory = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources");
Application.Init();

// TODO: figure out a way to make GTK look for the images in the Resources dir.
// as a workaround, set the CWD to Resources dir
var resDir = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources");
Environment.CurrentDirectory = resDir;

var app = new Application("org.BlenderRenderController", GLib.ApplicationFlags.None);
app.Register(GLib.Cancellable.Current);

Expand Down

0 comments on commit 6455d6a

Please sign in to comment.