Ver código fonte

Update mains

Daniele Bartolini 10 anos atrás
pai
commit
f560eec2bb
3 arquivos alterados com 22 adições e 10 exclusões
  1. 1 1
      src/main/main_android.cpp
  2. 6 1
      src/main/main_linux.cpp
  3. 15 8
      src/main/main_windows.cpp

+ 1 - 1
src/main/main_android.cpp

@@ -231,7 +231,7 @@ void android_main(struct android_app* app)
 	memory_globals::init();
 
 	DeviceOptions opts(0, NULL);
-	opts._asset_manager = app->activity->assetManager;
+	opts.set_asset_manager(app->activity->assetManager);
 
 	console_server_globals::init(opts.console_port(), false);
 	crown::s_advc.run(app, opts);

+ 6 - 1
src/main/main_linux.cpp

@@ -594,10 +594,15 @@ int main(int argc, char** argv)
 
 	DeviceOptions opts(argc, argv);
 
+	int exitcode = opts.parse();
+	if (exitcode == EXIT_FAILURE)
+	{
+		return exitcode;
+	}
+
 	console_server_globals::init(opts.console_port(), opts.wait_console());
 
 	bool do_continue = true;
-	int exitcode = EXIT_SUCCESS;
 
 	if (opts.do_compile())
 	{

+ 15 - 8
src/main/main_windows.cpp

@@ -499,22 +499,29 @@ int main(int argc, char** argv)
 
 	DeviceOptions opts(argc, argv);
 
+	int exitcode = opts.parse();
+	if (exitcode == EXIT_FAILURE)
+	{
+		return exitcode;
+	}
+
 	console_server_globals::init(opts.console_port(), opts.wait_console());
-	bundle_compiler_globals::init(opts.source_dir(), opts.bundle_dir());
 
 	bool do_continue = true;
-	int exitcode = EXIT_SUCCESS;
 
-	do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
+	if (opts.do_compile())
+	{
+		bundle_compiler_globals::init(opts.source_dir(), opts.bundle_dir());
+		do_continue = bundle_compiler::main(opts.do_compile(), opts.do_continue(), opts.platform());
+	}
 
 	if (do_continue)
-		exitcode = crown::s_wdvc.run(&opts);
-
-	bundle_compiler_globals::shutdown();
-	console_server_globals::shutdown();
+		exitcode = crown::s_ldvc.run(&opts);
 
-	WSACleanup();
+	if (opts.do_compile())
+		bundle_compiler_globals::shutdown();
 
+	console_server_globals::shutdown();
 	memory_globals::shutdown();
 	return exitcode;
 }