Daniele Bartolini 6 лет назад
Родитель
Сommit
84071d67fd
3 измененных файлов с 14 добавлено и 14 удалено
  1. 10 10
      src/device/device.cpp
  2. 3 3
      src/device/device.h
  3. 1 1
      tools-imgui/level_editor.cpp

+ 10 - 10
src/device/device.cpp

@@ -208,7 +208,7 @@ static void console_command(ConsoleServer& cs, TCPSocket client, const char* jso
 
 
 Device::Device(const DeviceOptions& opts, ConsoleServer& cs)
 Device::Device(const DeviceOptions& opts, ConsoleServer& cs)
 	: _allocator(default_allocator(), MAX_SUBSYSTEMS_HEAP)
 	: _allocator(default_allocator(), MAX_SUBSYSTEMS_HEAP)
-	, _device_options(opts)
+	, _options(opts)
 	, _boot_config(default_allocator())
 	, _boot_config(default_allocator())
 	, _console_server(&cs)
 	, _console_server(&cs)
 	, _data_filesystem(NULL)
 	, _data_filesystem(NULL)
@@ -293,16 +293,16 @@ void Device::run()
 {
 {
 	_console_server->register_command("command", console_command, this);
 	_console_server->register_command("command", console_command, this);
 
 
-	_console_server->listen(_device_options._console_port, _device_options._wait_console);
+	_console_server->listen(_options._console_port, _options._wait_console);
 
 
 #if CROWN_PLATFORM_ANDROID
 #if CROWN_PLATFORM_ANDROID
-	_data_filesystem = CE_NEW(_allocator, FilesystemApk)(default_allocator(), const_cast<AAssetManager*>((AAssetManager*)_device_options._asset_manager));
+	_data_filesystem = CE_NEW(_allocator, FilesystemApk)(default_allocator(), const_cast<AAssetManager*>((AAssetManager*)_options._asset_manager));
 #else
 #else
 	_data_filesystem = CE_NEW(_allocator, FilesystemDisk)(default_allocator());
 	_data_filesystem = CE_NEW(_allocator, FilesystemDisk)(default_allocator());
 	{
 	{
 		char cwd[1024];
 		char cwd[1024];
-		const char* data_dir = !_device_options._data_dir.empty()
-			? _device_options._data_dir.c_str()
+		const char* data_dir = !_options._data_dir.empty()
+			? _options._data_dir.c_str()
 			: os::getcwd(cwd, sizeof(cwd))
 			: os::getcwd(cwd, sizeof(cwd))
 			;
 			;
 		((FilesystemDisk*)_data_filesystem)->set_prefix(data_dir);
 		((FilesystemDisk*)_data_filesystem)->set_prefix(data_dir);
@@ -358,7 +358,7 @@ void Device::run()
 		TempAllocator512 ta;
 		TempAllocator512 ta;
 		DynamicString boot_dir(ta);
 		DynamicString boot_dir(ta);
 		path::join(boot_dir
 		path::join(boot_dir
-			, (_device_options._boot_dir != NULL) ? _device_options._boot_dir : ""
+			, (_options._boot_dir != NULL) ? _options._boot_dir : ""
 			, CROWN_BOOT_CONFIG
 			, CROWN_BOOT_CONFIG
 			);
 			);
 
 
@@ -379,11 +379,11 @@ void Device::run()
 	_height = _boot_config.window_h;
 	_height = _boot_config.window_h;
 
 
 	_window = window::create(_allocator);
 	_window = window::create(_allocator);
-	_window->open(_device_options._window_x
-		, _device_options._window_y
+	_window->open(_options._window_x
+		, _options._window_y
 		, _width
 		, _width
 		, _height
 		, _height
-		, _device_options._parent_window
+		, _options._parent_window
 		);
 		);
 	_window->set_title(_boot_config.window_title.c_str());
 	_window->set_title(_boot_config.window_title.c_str());
 	_window->set_fullscreen(_boot_config.fullscreen);
 	_window->set_fullscreen(_boot_config.fullscreen);
@@ -415,7 +415,7 @@ void Device::run()
 
 
 	_lua_environment->load_libs();
 	_lua_environment->load_libs();
 	_lua_environment->execute((LuaResource*)_resource_manager->get(RESOURCE_TYPE_SCRIPT, _boot_config.boot_script_name), 0);
 	_lua_environment->execute((LuaResource*)_resource_manager->get(RESOURCE_TYPE_SCRIPT, _boot_config.boot_script_name), 0);
-	_lua_environment->execute_string(_device_options._lua_string.c_str());
+	_lua_environment->execute_string(_options._lua_string.c_str());
 
 
 	_pipeline = CE_NEW(_allocator, Pipeline)();
 	_pipeline = CE_NEW(_allocator, Pipeline)();
 	_pipeline->create(_width, _height);
 	_pipeline->create(_width, _height);

+ 3 - 3
src/device/device.h

@@ -38,7 +38,7 @@ struct Device
 {
 {
 	LinearAllocator _allocator;
 	LinearAllocator _allocator;
 
 
-	const DeviceOptions& _device_options;
+	const DeviceOptions& _options;
 	BootConfig _boot_config;
 	BootConfig _boot_config;
 	ConsoleServer* _console_server;
 	ConsoleServer* _console_server;
 	Filesystem* _data_filesystem;
 	Filesystem* _data_filesystem;
@@ -74,10 +74,10 @@ struct Device
 	void run();
 	void run();
 
 
 	/// Returns the number of command line parameters.
 	/// Returns the number of command line parameters.
-	int argc() const { return _device_options._argc; }
+	int argc() const { return _options._argc; }
 
 
 	/// Returns command line parameters.
 	/// Returns command line parameters.
-	const char** argv() const { return (const char**)_device_options._argv; }
+	const char** argv() const { return (const char**)_options._argv; }
 
 
 	/// Quits the application.
 	/// Quits the application.
 	void quit();
 	void quit();

+ 1 - 1
tools-imgui/level_editor.cpp

@@ -1429,7 +1429,7 @@ struct LevelEditor
 
 
 void tool_init()
 void tool_init()
 {
 {
-	const DeviceOptions& opt = device()->_device_options;
+	const DeviceOptions& opt = device()->_options;
 	_project = CE_NEW(default_allocator(), Project)(default_allocator());
 	_project = CE_NEW(default_allocator(), Project)(default_allocator());
 	_project->_data_dir = opt._data_dir;
 	_project->_data_dir = opt._data_dir;
 	_editor = CE_NEW(default_allocator(), LevelEditor)(opt._source_dir);
 	_editor = CE_NEW(default_allocator(), LevelEditor)(opt._source_dir);