Browse Source

Merge branch 'master' of github.com:taylor001/crown

Daniele Bartolini 10 năm trước cách đây
mục cha
commit
bebdf3a5bd

+ 8 - 21
src/core/error/stacktrace_linux.cpp

@@ -7,43 +7,30 @@
 
 
 #if CROWN_PLATFORM_LINUX && CROWN_COMPILER_GCC
 #if CROWN_PLATFORM_LINUX && CROWN_COMPILER_GCC
 
 
+#include "macros.h"
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <cxxabi.h>
 #include <cxxabi.h>
 #include <execinfo.h>
 #include <execinfo.h>
+#include <string.h> // strchr
 
 
 namespace crown
 namespace crown
 {
 {
 
 
 void print_callstack()
 void print_callstack()
 {
 {
-	void* array[50];
-	int size = backtrace(array, 50);
+	void* array[64];
+	int size = backtrace(array, CE_COUNTOF(array));
 
 
 	char** messages = backtrace_symbols(array, size);
 	char** messages = backtrace_symbols(array, size);
 
 
 	// skip first stack frame (points here)
 	// skip first stack frame (points here)
 	for (int i = 1; i < size && messages != NULL; ++i)
 	for (int i = 1; i < size && messages != NULL; ++i)
 	{
 	{
-		char *mangled_name = 0, *offset_begin = 0, *offset_end = 0;
-
-		// find parantheses and +address offset surrounding mangled name
-		for (char *p = messages[i]; *p; ++p)
-		{
-			if (*p == '(')
-			{
-				mangled_name = p;
-			}
-			else if (*p == '+')
-			{
-				offset_begin = p;
-			}
-			else if (*p == ')')
-			{
-				offset_end = p;
-				break;
-			}
-		}
+		char* msg = messages[i];
+		char* mangled_name = strchr(msg, '(');
+		char* offset_begin = strchr(msg, '+');
+		char* offset_end = strchr(msg, ')');
 
 
 		// if the line could be processed, attempt to demangle the symbol
 		// if the line could be processed, attempt to demangle the symbol
 		if (mangled_name && offset_begin && offset_end && mangled_name < offset_begin)
 		if (mangled_name && offset_begin && offset_end && mangled_name < offset_begin)

+ 2 - 2
src/crown.cpp

@@ -56,13 +56,13 @@ static void help(const char* msg = NULL)
 	);
 	);
 }
 }
 
 
-bool init(const DeviceOptions& opts, Filesystem& fs)
+bool init(DeviceOptions& opts)
 {
 {
 	profiler_globals::init();
 	profiler_globals::init();
 	audio_globals::init();
 	audio_globals::init();
 	physics_globals::init();
 	physics_globals::init();
 	bgfx::init();
 	bgfx::init();
-	device_globals::init(opts, fs);
+	device_globals::init(opts);
 	return true;
 	return true;
 }
 }
 
 

+ 1 - 1
src/crown.h

@@ -12,7 +12,7 @@
 namespace crown
 namespace crown
 {
 {
 	/// Initializes the engine.
 	/// Initializes the engine.
-	bool init(const DeviceOptions& opts, Filesystem& fs);
+	bool init(DeviceOptions& opts);
 
 
 	/// Updates all the subsystems.
 	/// Updates all the subsystems.
 	void update();
 	void update();

+ 20 - 7
src/device.cpp

@@ -20,13 +20,18 @@
 #include "json_parser.h"
 #include "json_parser.h"
 #include "filesystem.h"
 #include "filesystem.h"
 #include "path.h"
 #include "path.h"
+#include "disk_filesystem.h"
+
+#if CROWN_PLATFORM_ANDROID
+	#include "apk_filesystem.h"
+#endif // CROWN_PLATFORM_ANDROID
 
 
 #define MAX_SUBSYSTEMS_HEAP 8 * 1024 * 1024
 #define MAX_SUBSYSTEMS_HEAP 8 * 1024 * 1024
 
 
 namespace crown
 namespace crown
 {
 {
 
 
-Device::Device(const DeviceOptions& opts, Filesystem& fs)
+Device::Device(DeviceOptions& opts)
 	: _allocator(default_allocator(), MAX_SUBSYSTEMS_HEAP)
 	: _allocator(default_allocator(), MAX_SUBSYSTEMS_HEAP)
 	, _width(0)
 	, _width(0)
 	, _height(0)
 	, _height(0)
@@ -39,7 +44,7 @@ Device::Device(const DeviceOptions& opts, Filesystem& fs)
 	, _last_delta_time(0.0f)
 	, _last_delta_time(0.0f)
 	, _time_since_start(0.0)
 	, _time_since_start(0.0)
 	, _device_options(opts)
 	, _device_options(opts)
-	, _fs(fs)
+	, _bundle_filesystem(NULL)
 	, _boot_package_id(uint64_t(0))
 	, _boot_package_id(uint64_t(0))
 	, _boot_script_id(uint64_t(0))
 	, _boot_script_id(uint64_t(0))
 	, _boot_package(NULL)
 	, _boot_package(NULL)
@@ -55,11 +60,17 @@ void Device::init()
 	// Initialize
 	// Initialize
 	CE_LOGI("Initializing Crown Engine %s...", version());
 	CE_LOGI("Initializing Crown Engine %s...", version());
 
 
+#if CROWN_PLATFORM_ANDROID
+	_bundle_filesystem = CE_NEW(_allocator, ApkFilesystem)(_device_options.asset_manager());
+#else
+	_bundle_filesystem = CE_NEW(_allocator, DiskFilesystem)(_device_options.bundle_dir());
+#endif // CROWN_PLATFORM_ANDROID
+
 	read_config();
 	read_config();
 
 
 	// Create resource manager
 	// Create resource manager
 	CE_LOGD("Creating resource manager...");
 	CE_LOGD("Creating resource manager...");
-	_resource_manager = CE_NEW(_allocator, ResourceManager)(_fs);
+	_resource_manager = CE_NEW(_allocator, ResourceManager)(*_bundle_filesystem);
 
 
 	CE_LOGD("Creating material manager...");
 	CE_LOGD("Creating material manager...");
 	material_manager::init();
 	material_manager::init();
@@ -106,6 +117,8 @@ void Device::shutdown()
 	CE_LOGD("Releasing resource manager...");
 	CE_LOGD("Releasing resource manager...");
 	CE_DELETE(_allocator, _resource_manager);
 	CE_DELETE(_allocator, _resource_manager);
 
 
+	CE_DELETE(_allocator, _bundle_filesystem);
+
 	_allocator.clear();
 	_allocator.clear();
 	_is_init = false;
 	_is_init = false;
 }
 }
@@ -259,9 +272,9 @@ void Device::read_config()
 
 
 	project_path += "crown.config";
 	project_path += "crown.config";
 
 
-	File* tmpfile = _fs.open(project_path.c_str(), FOM_READ);
+	File* tmpfile = _bundle_filesystem->open(project_path.c_str(), FOM_READ);
 	JSONParser config(*tmpfile);
 	JSONParser config(*tmpfile);
-	_fs.close(tmpfile);
+	_bundle_filesystem->close(tmpfile);
 	JSONElement root = config.root();
 	JSONElement root = config.root();
 
 
 	_boot_script_id = root.key("boot_script").to_resource_id();
 	_boot_script_id = root.key("boot_script").to_resource_id();
@@ -273,10 +286,10 @@ namespace device_globals
 	char _buffer[sizeof(Device)];
 	char _buffer[sizeof(Device)];
 	Device* _device = NULL;
 	Device* _device = NULL;
 
 
-	void init(const DeviceOptions& opts, Filesystem& fs)
+	void init(DeviceOptions& opts)
 	{
 	{
 		CE_ASSERT(_device == NULL, "Crown already initialized");
 		CE_ASSERT(_device == NULL, "Crown already initialized");
-		_device = new (_buffer) Device(opts, fs);
+		_device = new (_buffer) Device(opts);
 		_device->init();
 		_device->init();
 	}
 	}
 
 

+ 4 - 4
src/device.h

@@ -27,7 +27,7 @@ namespace crown
 /// @ingroup Device
 /// @ingroup Device
 struct Device
 struct Device
 {
 {
-	Device(const DeviceOptions& opts, Filesystem& fs);
+	Device(DeviceOptions& opts);
 
 
 	void init();
 	void init();
 
 
@@ -125,8 +125,8 @@ private:
 	float _last_delta_time;
 	float _last_delta_time;
 	double _time_since_start;
 	double _time_since_start;
 
 
-	const DeviceOptions& _device_options;
-	Filesystem& _fs;
+	DeviceOptions& _device_options;
+	Filesystem* _bundle_filesystem;
 	StringId64 _boot_package_id;
 	StringId64 _boot_package_id;
 	StringId64 _boot_script_id;
 	StringId64 _boot_script_id;
 	ResourcePackage* _boot_package;
 	ResourcePackage* _boot_package;
@@ -146,7 +146,7 @@ private:
 
 
 namespace device_globals
 namespace device_globals
 {
 {
-	void init(const DeviceOptions& opts, Filesystem& fs);
+	void init(DeviceOptions& opts);
 	void shutdown();
 	void shutdown();
 } // namespace device_globals
 } // namespace device_globals
 
 

+ 15 - 0
src/device_options.h

@@ -6,6 +6,11 @@
 #pragma once
 #pragma once
 
 
 #include "types.h"
 #include "types.h"
+#include "config.h"
+
+#if CROWN_PLATFORM_ANDROID
+	#include <android/asset_manager.h>
+#endif // CROWN_PLATFORM_ANDROID
 
 
 namespace crown
 namespace crown
 {
 {
@@ -28,6 +33,10 @@ struct DeviceOptions
 	uint16_t window_width() const { return _window_width; }
 	uint16_t window_width() const { return _window_width; }
 	uint16_t window_height() const { return _window_height; }
 	uint16_t window_height() const { return _window_height; }
 
 
+#if CROWN_PLATFORM_ANDROID
+	AAssetManager* asset_manager();
+#endif // CROWN_PLATFORM_ANDROID
+
 private:
 private:
 
 
 	const char* _source_dir;
 	const char* _source_dir;
@@ -43,6 +52,12 @@ private:
 	uint16_t _window_y;
 	uint16_t _window_y;
 	uint16_t _window_width;
 	uint16_t _window_width;
 	uint16_t _window_height;
 	uint16_t _window_height;
+
+public:
+
+#if CROWN_PLATFORM_ANDROID
+	AAssetManager* _asset_manager;
+#endif // CROWN_PLATFORM_ANDROID
 };
 };
 
 
 } // namespace crown
 } // namespace crown

+ 24 - 27
src/main/main_android.cpp

@@ -8,12 +8,13 @@
 #if CROWN_PLATFORM_ANDROID
 #if CROWN_PLATFORM_ANDROID
 
 
 #include "os_event_queue.h"
 #include "os_event_queue.h"
-#include "os_window_android.h"
 #include "thread.h"
 #include "thread.h"
 #include "main.h"
 #include "main.h"
-#include "apk_filesystem.h"
+#include "device_options.h"
 #include "console_server.h"
 #include "console_server.h"
 #include "crown.h"
 #include "crown.h"
+#include "memory.h"
+#include <stdlib.h>
 #include <jni.h>
 #include <jni.h>
 #include <android/sensor.h>
 #include <android/sensor.h>
 #include <android_native_app_glue.h>
 #include <android_native_app_glue.h>
@@ -46,14 +47,13 @@ static bool s_exit = false;
 
 
 struct MainThreadArgs
 struct MainThreadArgs
 {
 {
-	Filesystem* fs;
-	ConfigSettings* cs;
+	DeviceOptions* opts;
 };
 };
 
 
 int32_t func(void* data)
 int32_t func(void* data)
 {
 {
-	MainThreadArgs* args = (MainThreadArgs*) data;
-	crown::init(*args->fs, *args->cs);
+	MainThreadArgs* args = (MainThreadArgs*)data;
+	crown::init(*args->opts);
 	crown::update();
 	crown::update();
 	crown::shutdown();
 	crown::shutdown();
 	s_exit = true;
 	s_exit = true;
@@ -62,10 +62,9 @@ int32_t func(void* data)
 
 
 struct AndroidDevice
 struct AndroidDevice
 {
 {
-	void run(struct android_app* app, Filesystem& fs, ConfigSettings& cs)
+	void run(struct android_app* app, DeviceOptions& opts)
 	{
 	{
-		_margs.fs = &fs;
-		_margs.cs = &cs;
+		_margs.opts = &opts;
 
 
 		app->userData = this;
 		app->userData = this;
 		app->onAppCmd = crown::AndroidDevice::on_app_cmd;
 		app->onAppCmd = crown::AndroidDevice::on_app_cmd;
@@ -136,12 +135,12 @@ struct AndroidDevice
 		if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION)
 		if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION)
 		{
 		{
 			const int32_t action = AMotionEvent_getAction(event);
 			const int32_t action = AMotionEvent_getAction(event);
-			const int32_t pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
-			const int32_t pointerCount = AMotionEvent_getPointerCount(event);
+			const int32_t pointer_index = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
+			const int32_t pointer_count = AMotionEvent_getPointerCount(event);
 
 
-			const int32_t pointerId = AMotionEvent_getPointerId(event, pointerIndex);
-			const float x = AMotionEvent_getX(event, pointerIndex);
-			const float y = AMotionEvent_getY(event, pointerIndex);
+			const int32_t pointer_id = AMotionEvent_getPointerId(event, pointer_index);
+			const float x = AMotionEvent_getX(event, pointer_index);
+			const float y = AMotionEvent_getY(event, pointer_index);
 
 
 			const int32_t actionMasked = (action & AMOTION_EVENT_ACTION_MASK);
 			const int32_t actionMasked = (action & AMOTION_EVENT_ACTION_MASK);
 
 
@@ -150,24 +149,24 @@ struct AndroidDevice
 				case AMOTION_EVENT_ACTION_DOWN:
 				case AMOTION_EVENT_ACTION_DOWN:
 				case AMOTION_EVENT_ACTION_POINTER_DOWN:
 				case AMOTION_EVENT_ACTION_POINTER_DOWN:
 				{
 				{
-					_queue.push_touch_event((int16_t)x, (int16_t)y, (uint8_t)pointerId, true);
+					_queue.push_touch_event((int16_t)x, (int16_t)y, (uint8_t)pointer_id, true);
 					break;
 					break;
 				}
 				}
 				case AMOTION_EVENT_ACTION_UP:
 				case AMOTION_EVENT_ACTION_UP:
 				case AMOTION_EVENT_ACTION_POINTER_UP:
 				case AMOTION_EVENT_ACTION_POINTER_UP:
 				{
 				{
-					_queue.push_touch_event((int16_t)x, (int16_t)y, (uint8_t)pointerId, false);
+					_queue.push_touch_event((int16_t)x, (int16_t)y, (uint8_t)pointer_id, false);
 					break;
 					break;
 				}
 				}
 				case AMOTION_EVENT_ACTION_OUTSIDE:
 				case AMOTION_EVENT_ACTION_OUTSIDE:
 				case AMOTION_EVENT_ACTION_CANCEL:
 				case AMOTION_EVENT_ACTION_CANCEL:
 				{
 				{
-					_queue.push_touch_event((int16_t)x, (int16_t)y, (uint8_t)pointerId, false);
+					_queue.push_touch_event((int16_t)x, (int16_t)y, (uint8_t)pointer_id, false);
 					break;
 					break;
 				}
 				}
 				case AMOTION_EVENT_ACTION_MOVE:
 				case AMOTION_EVENT_ACTION_MOVE:
 				{
 				{
-					for (int index = 0; index < pointerCount; index++)
+					for (int index = 0; index < pointer_count; index++)
 					{
 					{
 						const float xx = AMotionEvent_getX(event, index);
 						const float xx = AMotionEvent_getX(event, index);
 						const float yy = AMotionEvent_getY(event, index);
 						const float yy = AMotionEvent_getY(event, index);
@@ -187,7 +186,8 @@ struct AndroidDevice
 
 
 			if (keycode == AKEYCODE_BACK)
 			if (keycode == AKEYCODE_BACK)
 			{
 			{
-				_queue.push_keyboard_event(0, KeyboardButton::ESCAPE, keyaction == AKEY_EVENT_ACTION_DOWN ? true : false);
+				_queue.push_keyboard_event(KeyboardButton::ESCAPE
+					, keyaction == AKEY_EVENT_ACTION_DOWN ? true : false);
 			}
 			}
 
 
 			return 1;
 			return 1;
@@ -231,15 +231,12 @@ void android_main(struct android_app* app)
 
 
 	memory_globals::init();
 	memory_globals::init();
 
 
-	{
-		ConfigSettings cs;
-		ApkFilesystem dst_fs(app->activity->assetManager);
-		parse_config_file(dst_fs, cs);
-		console_server_globals::init(cs.console_port, false);
-		crown::s_advc.run(app, dst_fs, cs);
-		console_server_globals::shutdown();
-	}
+	DeviceOptions opts(0, NULL);
+	opts._asset_manager = app->activity->assetManager;
 
 
+	console_server_globals::init(opts.console_port(), false);
+	crown::s_advc.run(app, opts);
+	console_server_globals::shutdown();
 	memory_globals::shutdown();
 	memory_globals::shutdown();
 }
 }
 
 

+ 19 - 28
src/main/main_linux.cpp

@@ -10,11 +10,9 @@
 #include "device.h"
 #include "device.h"
 #include "memory.h"
 #include "memory.h"
 #include "os_event_queue.h"
 #include "os_event_queue.h"
-#include "os_window_linux.h"
 #include "thread.h"
 #include "thread.h"
 #include "main.h"
 #include "main.h"
 #include "command_line.h"
 #include "command_line.h"
-#include "disk_filesystem.h"
 #include "crown.h"
 #include "crown.h"
 #include "bundle_compiler.h"
 #include "bundle_compiler.h"
 #include "console_server.h"
 #include "console_server.h"
@@ -165,14 +163,13 @@ static bool s_exit = false;
 
 
 struct MainThreadArgs
 struct MainThreadArgs
 {
 {
-	Filesystem* fs;
-	DeviceOptions* ds;
+	DeviceOptions* opts;
 };
 };
 
 
 int32_t func(void* data)
 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::update();
 	crown::shutdown();
 	crown::shutdown();
 	s_exit = true;
 	s_exit = true;
@@ -184,13 +181,12 @@ struct LinuxDevice
 	LinuxDevice()
 	LinuxDevice()
 		: _x11_display(NULL)
 		: _x11_display(NULL)
 		, _x11_window(None)
 		, _x11_window(None)
-		, _x11_parent_window(None)
 		, _x11_hidden_cursor(None)
 		, _x11_hidden_cursor(None)
 		, _screen_config(NULL)
 		, _screen_config(NULL)
 	{
 	{
 	}
 	}
 
 
-	int32_t run(Filesystem* fs, DeviceOptions* ds)
+	int32_t run(DeviceOptions* opts)
 	{
 	{
 		// http://tronche.com/gui/x/xlib/display/XInitThreads.html
 		// http://tronche.com/gui/x/xlib/display/XInitThreads.html
 		Status xs = XInitThreads();
 		Status xs = XInitThreads();
@@ -204,8 +200,9 @@ struct LinuxDevice
 		int depth = DefaultDepth(_x11_display, screen);
 		int depth = DefaultDepth(_x11_display, screen);
 		Visual* visual = DefaultVisual(_x11_display, screen);
 		Visual* visual = DefaultVisual(_x11_display, screen);
 
 
-		_x11_parent_window = (ds->parent_window() == 0) ? RootWindow(_x11_display, screen) :
-			(Window)ds->parent_window();
+		Window root_window = RootWindow(_x11_display, screen);
+		uint32_t pw = opts->parent_window();
+		Window parent_window = (pw == 0) ? root_window : (Window)pw;
 
 
 		// Create main window
 		// Create main window
 		XSetWindowAttributes win_attribs;
 		XSetWindowAttributes win_attribs;
@@ -220,11 +217,11 @@ struct LinuxDevice
 			| PointerMotionMask;
 			| PointerMotionMask;
 
 
 		_x11_window = XCreateWindow(_x11_display
 		_x11_window = XCreateWindow(_x11_display
-			, _x11_parent_window
-			, ds->window_x()
-			, ds->window_y()
-			, ds->window_width()
-			, ds->window_height()
+			, parent_window
+			, opts->window_x()
+			, opts->window_y()
+			, opts->window_width()
+			, opts->window_height()
 			, 0
 			, 0
 			, depth
 			, depth
 			, InputOutput
 			, InputOutput
@@ -233,6 +230,9 @@ struct LinuxDevice
 			, &win_attribs);
 			, &win_attribs);
 		CE_ASSERT(_x11_window != None, "XCreateWindow: error");
 		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?
 		// Do we have detectable autorepeat?
 		Bool detectable;
 		Bool detectable;
 		_x11_detectable_autorepeat = (bool) XkbSetDetectableAutoRepeat(_x11_display, true, &detectable);
 		_x11_detectable_autorepeat = (bool) XkbSetDetectableAutoRepeat(_x11_display, true, &detectable);
@@ -248,23 +248,18 @@ struct LinuxDevice
 		bm_no = XCreateBitmapFromData(_x11_display, _x11_window, no_data, 8, 8);
 		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);
 		_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);
 		bgfx::x11SetDisplayWindow(_x11_display, _x11_window);
 		XMapRaised(_x11_display, _x11_window);
 		XMapRaised(_x11_display, _x11_window);
 
 
 		// Save screen configuration
 		// Save screen configuration
-		_screen_config = XRRGetScreenInfo(_x11_display, RootWindow(_x11_display, screen));
+		_screen_config = XRRGetScreenInfo(_x11_display, parent_window);
 
 
 		Rotation rr_old_rot;
 		Rotation rr_old_rot;
 		const SizeID rr_old_sizeid = XRRConfigCurrentConfiguration(_screen_config, &rr_old_rot);
 		const SizeID rr_old_sizeid = XRRConfigCurrentConfiguration(_screen_config, &rr_old_rot);
 
 
 		// Start main thread
 		// Start main thread
 		MainThreadArgs mta;
 		MainThreadArgs mta;
-		mta.fs = fs;
-		mta.ds = ds;
+		mta.opts = opts;
 
 
 		Thread main_thread;
 		Thread main_thread;
 		main_thread.start(func, &mta);
 		main_thread.start(func, &mta);
@@ -284,7 +279,7 @@ struct LinuxDevice
 		{
 		{
 			XRRSetScreenConfig(_x11_display
 			XRRSetScreenConfig(_x11_display
 				, _screen_config
 				, _screen_config
-				, RootWindow(_x11_display, screen)
+				, root_window
 				, rr_old_sizeid
 				, rr_old_sizeid
 				, rr_old_rot
 				, rr_old_rot
 				, CurrentTime);
 				, CurrentTime);
@@ -381,7 +376,6 @@ public:
 
 
 	Display* _x11_display;
 	Display* _x11_display;
 	Window _x11_window;
 	Window _x11_window;
-	Window _x11_parent_window;
 	Cursor _x11_hidden_cursor;
 	Cursor _x11_hidden_cursor;
 	Atom _wm_delete_message;
 	Atom _wm_delete_message;
 	XRRScreenConfiguration* _screen_config;
 	XRRScreenConfiguration* _screen_config;
@@ -414,10 +408,7 @@ int main(int argc, char** argv)
 	do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
 	do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
 
 
 	if (do_continue)
 	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();
 	bundle_compiler_globals::shutdown();
 	console_server_globals::shutdown();
 	console_server_globals::shutdown();

+ 3 - 10
src/main/main_windows.cpp

@@ -8,13 +8,11 @@
 #if CROWN_PLATFORM_WINDOWS
 #if CROWN_PLATFORM_WINDOWS
 
 
 #include "os_event_queue.h"
 #include "os_event_queue.h"
-#include "os_window_windows.h"
 #include "thread.h"
 #include "thread.h"
 #include "crown.h"
 #include "crown.h"
 #include "command_line.h"
 #include "command_line.h"
 #include "console_server.h"
 #include "console_server.h"
 #include "bundle_compiler.h"
 #include "bundle_compiler.h"
-#include "disk_filesystem.h"
 #include <bgfxplatform.h>
 #include <bgfxplatform.h>
 #include <winsock2.h>
 #include <winsock2.h>
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
@@ -116,14 +114,13 @@ static bool s_exit = false;
 
 
 struct MainThreadArgs
 struct MainThreadArgs
 {
 {
-	Filesystem* fs;
 	DeviceOptions* opts;
 	DeviceOptions* opts;
 };
 };
 
 
 int32_t func(void* data)
 int32_t func(void* data)
 {
 {
 	MainThreadArgs* args = (MainThreadArgs*)data;
 	MainThreadArgs* args = (MainThreadArgs*)data;
-	crown::init(*args->opts, *args->fs);
+	crown::init(*args->opts);
 	crown::update();
 	crown::update();
 	crown::shutdown();
 	crown::shutdown();
 	s_exit = true;
 	s_exit = true;
@@ -138,7 +135,7 @@ struct WindowsDevice
 	{
 	{
 	}
 	}
 
 
-	int32_t	run(Filesystem* fs, DeviceOptions* opts)
+	int32_t	run(DeviceOptions* opts)
 	{
 	{
 		HINSTANCE instance = (HINSTANCE)GetModuleHandle(NULL);
 		HINSTANCE instance = (HINSTANCE)GetModuleHandle(NULL);
 		WNDCLASSEX wnd;
 		WNDCLASSEX wnd;
@@ -169,7 +166,6 @@ struct WindowsDevice
 		bgfx::winSetHwnd(_hwnd);
 		bgfx::winSetHwnd(_hwnd);
 
 
 		MainThreadArgs mta;
 		MainThreadArgs mta;
-		mta.fs = fs;
 		mta.opts = opts;
 		mta.opts = opts;
 
 
 		Thread main_thread;
 		Thread main_thread;
@@ -332,10 +328,7 @@ int main(int argc, char** argv)
 	do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
 	do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
 
 
 	if (do_continue)
 	if (do_continue)
-	{
-		DiskFilesystem dst_fs(opts.bundle_dir());
-		exitcode = crown::s_wdvc.run(&dst_fs, &opts);
-	}
+		exitcode = crown::s_wdvc.run(&opts);
 
 
 	bundle_compiler_globals::shutdown();
 	bundle_compiler_globals::shutdown();
 	console_server_globals::shutdown();
 	console_server_globals::shutdown();

+ 3 - 1
src/renderers/shader.cpp

@@ -26,7 +26,9 @@
 #	define SHADERC_PATH SHADERC_NAME""SHADERC_BITS
 #	define SHADERC_PATH SHADERC_NAME""SHADERC_BITS
 #elif CROWN_PLATFORM_WINDOWS
 #elif CROWN_PLATFORM_WINDOWS
 #	define SHADERC_PATH SHADERC_NAME""SHADERC_BITS".exe"
 #	define SHADERC_PATH SHADERC_NAME""SHADERC_BITS".exe"
-#endif // CROWN_PLATFORM_WINDOWS
+#else
+# 	define SHADERC_PATH ""
+#endif // CROWN_PLATFORM_LINUX
 
 
 namespace crown
 namespace crown
 {
 {