|
|
@@ -165,14 +165,13 @@ static bool s_exit = false;
|
|
|
|
|
|
struct MainThreadArgs
|
|
|
{
|
|
|
- Filesystem* fs;
|
|
|
- DeviceOptions* ds;
|
|
|
+ DeviceOptions* opts;
|
|
|
};
|
|
|
|
|
|
int32_t func(void* data)
|
|
|
{
|
|
|
- MainThreadArgs* args = (MainThreadArgs*) data;
|
|
|
- crown::init(*args->ds, *args->fs);
|
|
|
+ MainThreadArgs* args = (MainThreadArgs*)data;
|
|
|
+ crown::init(*args->opts);
|
|
|
crown::update();
|
|
|
crown::shutdown();
|
|
|
s_exit = true;
|
|
|
@@ -190,7 +189,7 @@ struct LinuxDevice
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- int32_t run(Filesystem* fs, DeviceOptions* ds)
|
|
|
+ int32_t run(DeviceOptions* opts)
|
|
|
{
|
|
|
// http://tronche.com/gui/x/xlib/display/XInitThreads.html
|
|
|
Status xs = XInitThreads();
|
|
|
@@ -204,8 +203,8 @@ struct LinuxDevice
|
|
|
int depth = DefaultDepth(_x11_display, screen);
|
|
|
Visual* visual = DefaultVisual(_x11_display, screen);
|
|
|
|
|
|
- _x11_parent_window = (ds->parent_window() == 0) ? RootWindow(_x11_display, screen) :
|
|
|
- (Window)ds->parent_window();
|
|
|
+ _x11_parent_window = (opts->parent_window() == 0) ? RootWindow(_x11_display, screen) :
|
|
|
+ (Window)opts->parent_window();
|
|
|
|
|
|
// Create main window
|
|
|
XSetWindowAttributes win_attribs;
|
|
|
@@ -221,10 +220,10 @@ struct LinuxDevice
|
|
|
|
|
|
_x11_window = XCreateWindow(_x11_display
|
|
|
, _x11_parent_window
|
|
|
- , ds->window_x()
|
|
|
- , ds->window_y()
|
|
|
- , ds->window_width()
|
|
|
- , ds->window_height()
|
|
|
+ , opts->window_x()
|
|
|
+ , opts->window_y()
|
|
|
+ , opts->window_width()
|
|
|
+ , opts->window_height()
|
|
|
, 0
|
|
|
, depth
|
|
|
, InputOutput
|
|
|
@@ -233,6 +232,9 @@ struct LinuxDevice
|
|
|
, &win_attribs);
|
|
|
CE_ASSERT(_x11_window != None, "XCreateWindow: error");
|
|
|
|
|
|
+ _wm_delete_message = XInternAtom(_x11_display, "WM_DELETE_WINDOW", False);
|
|
|
+ XSetWMProtocols(_x11_display, _x11_window, &_wm_delete_message, 1);
|
|
|
+
|
|
|
// Do we have detectable autorepeat?
|
|
|
Bool detectable;
|
|
|
_x11_detectable_autorepeat = (bool) XkbSetDetectableAutoRepeat(_x11_display, true, &detectable);
|
|
|
@@ -248,10 +250,6 @@ struct LinuxDevice
|
|
|
bm_no = XCreateBitmapFromData(_x11_display, _x11_window, no_data, 8, 8);
|
|
|
_x11_hidden_cursor = XCreatePixmapCursor(_x11_display, bm_no, bm_no, &black, &black, 0, 0);
|
|
|
|
|
|
- _wm_delete_message = XInternAtom(_x11_display, "WM_DELETE_WINDOW", False);
|
|
|
- XSetWMProtocols(_x11_display, _x11_window, &_wm_delete_message, 1);
|
|
|
-
|
|
|
- oswindow_set_window(_x11_display, _x11_window);
|
|
|
bgfx::x11SetDisplayWindow(_x11_display, _x11_window);
|
|
|
XMapRaised(_x11_display, _x11_window);
|
|
|
|
|
|
@@ -263,8 +261,7 @@ struct LinuxDevice
|
|
|
|
|
|
// Start main thread
|
|
|
MainThreadArgs mta;
|
|
|
- mta.fs = fs;
|
|
|
- mta.ds = ds;
|
|
|
+ mta.opts = opts;
|
|
|
|
|
|
Thread main_thread;
|
|
|
main_thread.start(func, &mta);
|
|
|
@@ -414,10 +411,7 @@ int main(int argc, char** argv)
|
|
|
do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
|
|
|
|
|
|
if (do_continue)
|
|
|
- {
|
|
|
- DiskFilesystem dst_fs(opts.bundle_dir());
|
|
|
- exitcode = crown::s_ldvc.run(&dst_fs, &opts);
|
|
|
- }
|
|
|
+ exitcode = crown::s_ldvc.run(&opts);
|
|
|
|
|
|
bundle_compiler_globals::shutdown();
|
|
|
console_server_globals::shutdown();
|