فهرست منبع

device: cleanup

Daniele Bartolini 10 ماه پیش
والد
کامیت
fcac142eb0
6فایلهای تغییر یافته به همراه9 افزوده شده و 10 حذف شده
  1. 3 3
      src/device/device.cpp
  2. 2 3
      src/device/device.h
  3. 1 1
      src/device/main_android.cpp
  4. 1 1
      src/device/main_html5.cpp
  5. 1 1
      src/device/main_linux.cpp
  6. 1 1
      src/device/main_windows.cpp

+ 3 - 3
src/device/device.cpp

@@ -509,7 +509,7 @@ bool Device::frame()
 	return false;
 	return false;
 }
 }
 
 
-int Device::run()
+int Device::main_loop()
 {
 {
 	s64 run_t0 = time::now();
 	s64 run_t0 = time::now();
 
 
@@ -1001,12 +1001,12 @@ void Device::screenshot(const char *path)
 
 
 Device *_device = NULL;
 Device *_device = NULL;
 
 
-int run(const DeviceOptions &opts)
+int main_runtime(const DeviceOptions &opts)
 {
 {
 	CE_ASSERT(_device == NULL, "Crown already initialized");
 	CE_ASSERT(_device == NULL, "Crown already initialized");
 	console_server_globals::init();
 	console_server_globals::init();
 	_device = CE_NEW(default_allocator(), Device)(opts, *console_server());
 	_device = CE_NEW(default_allocator(), Device)(opts, *console_server());
-	int ec = _device->run();
+	int ec = _device->main_loop();
 	CE_DELETE(default_allocator(), _device);
 	CE_DELETE(default_allocator(), _device);
 	_device = NULL;
 	_device = NULL;
 	console_server_globals::shutdown();
 	console_server_globals::shutdown();

+ 2 - 3
src/device/device.h

@@ -99,7 +99,7 @@ struct Device
 	bool frame();
 	bool frame();
 
 
 	/// Runs the application until quit() is called.
 	/// Runs the application until quit() is called.
-	int run();
+	int main_loop();
 
 
 	/// Returns the number of command line parameters.
 	/// Returns the number of command line parameters.
 	int argc() const;
 	int argc() const;
@@ -145,8 +145,7 @@ struct Device
 	void screenshot(const char *path);
 	void screenshot(const char *path);
 };
 };
 
 
-/// Runs the engine.
-int run(const DeviceOptions &opts);
+int main_runtime(const DeviceOptions &opts);
 
 
 /// Returns the device.
 /// Returns the device.
 Device *device();
 Device *device();

+ 1 - 1
src/device/main_android.cpp

@@ -87,7 +87,7 @@ struct AndroidDevice
 
 
 			if (!_main_thread.is_running()) {
 			if (!_main_thread.is_running()) {
 				_main_thread.start([](void *user_data) {
 				_main_thread.start([](void *user_data) {
-						return crown::run(*((DeviceOptions *)user_data));
+						return crown::main_runtime(*((DeviceOptions *)user_data));
 					}
 					}
 					, _opts
 					, _opts
 					);
 					);

+ 1 - 1
src/device/main_html5.cpp

@@ -442,7 +442,7 @@ struct EmscriptenDevice
 		emscripten_get_element_css_size("#" CROWN_HTML5_CANVAS_NAME, &width, &height);
 		emscripten_get_element_css_size("#" CROWN_HTML5_CANVAS_NAME, &width, &height);
 		_queue.push_resolution_event(width, height);
 		_queue.push_resolution_event(width, height);
 
 
-		return crown::run(*opts);
+		return crown::main_runtime(*opts);
 	}
 	}
 };
 };
 
 

+ 1 - 1
src/device/main_linux.cpp

@@ -501,7 +501,7 @@ struct LinuxDevice
 		// Start main thread
 		// Start main thread
 		Thread main_thread;
 		Thread main_thread;
 		main_thread.start([](void *user_data) {
 		main_thread.start([](void *user_data) {
-				int ec = crown::run(*((DeviceOptions *)user_data));
+				int ec = crown::main_runtime(*((DeviceOptions *)user_data));
 				s_exit = true;
 				s_exit = true;
 				// Write something just to unlock the listening select().
 				// Write something just to unlock the listening select().
 				write(exit_pipe[1], &s_exit, sizeof(s_exit));
 				write(exit_pipe[1], &s_exit, sizeof(s_exit));

+ 1 - 1
src/device/main_windows.cpp

@@ -416,7 +416,7 @@ struct WindowsDevice
 		Thread main_thread;
 		Thread main_thread;
 		main_thread.start([](void *user_data) {
 		main_thread.start([](void *user_data) {
 				WindowsDevice *win = (WindowsDevice *)user_data;
 				WindowsDevice *win = (WindowsDevice *)user_data;
-				int ec = crown::run(*win->_options);
+				int ec = crown::main_runtime(*win->_options);
 				s_exit = true;
 				s_exit = true;
 				PostMessageA(win->_hwnd, WM_USER + 1, 0, 0);
 				PostMessageA(win->_hwnd, WM_USER + 1, 0, 0);
 				return ec;
 				return ec;