aboutsummaryrefslogtreecommitdiffstats
path: root/android/main.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-02-02 13:21:03 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-02-02 13:46:39 +0100
commit74d7acec6643694132a127feb5ccadda7ea793d6 (patch)
tree3ad25af28d6e8747666f9e0c800de4e37116aba8 /android/main.c
parentf845627c83ce6ce3e306f9b6842d1e30ef89ae97 (diff)
downloadexternal_qemu-74d7acec6643694132a127feb5ccadda7ea793d6.zip
external_qemu-74d7acec6643694132a127feb5ccadda7ea793d6.tar.gz
external_qemu-74d7acec6643694132a127feb5ccadda7ea793d6.tar.bz2
Separate init_skinned_ui() into two functions.
This removes init_skinned_ui() and adds parse_skin_files() and init_sdl_ui(). The first function only parses skin files and options, and doesn't do anything related to the UI. The second function does setup the SDL UI after all options/skin processing has been performed. We also modify main.c and main-ui.c to move the call to init_sdl_ui() as far as possible after the options parsing. + Move core attachment code to the end of qemu_main() in main-ui.c Change-Id: I2bf5f0a096d827ae1fee070a8fa45cbd4629d54f
Diffstat (limited to 'android/main.c')
-rw-r--r--android/main.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/android/main.c b/android/main.c
index 078cfbb..64fe617 100644
--- a/android/main.c
+++ b/android/main.c
@@ -40,7 +40,6 @@
#include "android/utils/bufprint.h"
#include "android/utils/dirscanner.h"
#include "android/utils/path.h"
-#include "android/utils/timezone.h"
#include "android/utils/tempfile.h"
#include "android/main-common.h"
@@ -286,6 +285,8 @@ int main(int argc, char **argv)
AndroidHwConfig* hw;
AvdInfo* avd;
+ AConfig* skinConfig;
+ char* skinPath;
//const char *appdir = get_app_dir();
char* android_build_root = NULL;
@@ -352,10 +353,6 @@ int main(int argc, char **argv)
exit(1);
}
- if (android_charmap_setup(opts->charmap)) {
- exit(1);
- }
-
if (opts->version) {
printf("Android emulator version %s\n"
"Copyright (C) 2006-2008 The Android Open Source Project and many others.\n"
@@ -376,10 +373,8 @@ int main(int argc, char **argv)
exit(0);
}
- if (opts->timezone) {
- if ( timezone_set(opts->timezone) < 0 ) {
- fprintf(stderr, "emulator: it seems the timezone '%s' is not in zoneinfo format\n", opts->timezone);
- }
+ if (android_charmap_setup(opts->charmap)) {
+ exit(1);
}
/* legacy support: we used to use -system <dir> and -image <file>
@@ -667,7 +662,8 @@ int main(int argc, char **argv)
emulator_config_init();
- init_skinned_ui(opts->skindir, opts->skin, opts);
+ parse_skin_files(opts->skindir, opts->skin, opts,
+ &skinConfig, &skinPath);
if (!opts->netspeed) {
if (skin_network_speed)
@@ -744,6 +740,11 @@ int main(int argc, char **argv)
}
#endif
+ if (opts->timezone) {
+ args[n++] = "-timezone";
+ args[n++] = opts->timezone;
+ }
+
if (opts->netspeed) {
args[n++] = "-netspeed";
args[n++] = opts->netspeed;
@@ -1053,9 +1054,7 @@ int main(int argc, char **argv)
* size through its hardware.ini (i.e. legacy ones) or when
* in the full Android build system.
*/
- int width, height, pixels;
- qemulator_get_screen_size(qemulator_get(), &width, &height);
- pixels = width*height;
+ int64_t pixels = get_screen_pixels(skinConfig);
/* The following thresholds are a bit liberal, but we
* essentially want to ensure the following mappings:
@@ -1281,5 +1280,9 @@ int main(int argc, char **argv)
}
printf("\n");
}
+
+ /* Setup SDL UI just before calling the code */
+ init_sdl_ui(skinConfig, skinPath, opts);
+
return qemu_main(n, args);
}