Daniele Bartolini il y a 10 ans
Parent
commit
de85855bb2

+ 3 - 9
src/device/device.cpp

@@ -167,7 +167,7 @@ Device::Device(const DeviceOptions& opts)
 {
 }
 
-void Device::init()
+void Device::run()
 {
 	profiler_globals::init();
 
@@ -690,17 +690,11 @@ bool Device::process_events()
 char _buffer[sizeof(Device)];
 Device* _device = NULL;
 
-void init(const DeviceOptions& opts)
+void run(const DeviceOptions& opts)
 {
 	CE_ASSERT(_device == NULL, "Crown already initialized");
 	_device = new (_buffer) Device(opts);
-	_device->init();
-}
-
-void shutdown()
-{
-	_device->~Device();
-	_device = NULL;
+	_device->run();
 }
 
 Device* device()

+ 6 - 4
src/device/device.h

@@ -88,8 +88,8 @@ public:
 
 	Device(const DeviceOptions& opts);
 
-	/// Initializes the engine.
-	void init();
+	/// Runs the engine.
+	void run();
 
 	/// Returns the number of command line parameters.
 	int argc() const { return _device_options._argc; }
@@ -188,8 +188,10 @@ private:
 	Device& operator=(const Device&);
 };
 
-void init(const DeviceOptions& opts);
-void shutdown();
+/// Runs the engine.
+void run(const DeviceOptions& opts);
+
+/// Returns the device.
 Device* device();
 
 } // namespace crown

+ 1 - 2
src/device/main_android.cpp

@@ -33,8 +33,7 @@ struct MainThreadArgs
 s32 func(void* data)
 {
 	MainThreadArgs* args = (MainThreadArgs*)data;
-	crown::init(*args->opts);
-	crown::shutdown();
+	crown::run(*args->opts);
 	s_exit = true;
 	return EXIT_SUCCESS;
 }

+ 1 - 2
src/device/main_linux.cpp

@@ -293,8 +293,7 @@ struct MainThreadArgs
 s32 func(void* data)
 {
 	MainThreadArgs* args = (MainThreadArgs*)data;
-	crown::init(*args->opts);
-	crown::shutdown();
+	crown::run(*args->opts);
 	s_exit = true;
 	return EXIT_SUCCESS;
 }

+ 1 - 2
src/device/main_windows.cpp

@@ -291,8 +291,7 @@ struct MainThreadArgs
 s32 func(void* data)
 {
 	MainThreadArgs* args = (MainThreadArgs*)data;
-	crown::init(*args->opts);
-	crown::shutdown();
+	crown::run(*args->opts);
 	s_exit = true;
 	return EXIT_SUCCESS;
 }