From 996c9fc0baadb8e79b3d83a5638f6c57c36b6656 Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Wed, 5 Sep 2012 12:17:43 +0900 Subject: [PATCH] [Title] find out size of lcd before emulator booting [Type] bugfix [Module] Emualtor [Priority] major [Jira#] [Redmine#] [Problem] [Cause] timing [Solution] [TestCase] booting --- tizen/src/emul_state.c | 2 +- tizen/src/emulator.c | 42 ++++++++++++++++++++++++++++++++++++++++++ tizen/src/maru_sdl.c | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index 4896085..da85a19 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -74,7 +74,7 @@ void set_emul_lcd_size(int width, int height) _emul_info.lcd_size_w = width; _emul_info.lcd_size_h = height; - INFO("emulator graphic resolution = %dx%d\n", _emul_info.lcd_size_w, _emul_info.lcd_size_h); + //INFO("emulator graphic resolution = %dx%d\n", _emul_info.lcd_size_w, _emul_info.lcd_size_h); } int get_emul_lcd_width(void) diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 235ca1d..7dbbb60 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -257,12 +257,54 @@ static void parse_options(int argc, char *argv[], int *skin_argc, { int i; int j; + int q = 0; /* TODO: */ for (i = 1; i < argc; ++i) { if (strncmp(argv[i], "--skin-args", 11) == 0) { + int w = 0; + int h = 0; + char *temp = NULL; + *skin_argv = &(argv[i + 1]); + + /* find out the size of lcd */ + for(q = 0; q < (argc - i - 7); ++q) { + if (strncmp(**skin_argv + q, "width=", 6) == 0) { + char *width = NULL; + char *width_argv = **skin_argv + q; + int len = strlen(width_argv) + 1; + + temp = calloc(0, len * sizeof(char)); + strcpy(temp, width_argv); + temp[len - 1] = '\0'; + + width = strtok(temp + 6, " "); + w = atoi(width); + + free(temp); + } else if (strncmp(**skin_argv + q, "height=", 7) == 0) { + char *height = NULL; + char *height_argv = **skin_argv + q; + int len = strlen(height_argv) + 1; + + temp = calloc(0, len * sizeof(char)); + strcpy(temp, height_argv); + temp[len - 1] = '\0'; + + height = strtok(temp + 7, " "); + h = atoi(height); + + free(temp); + } + + if (w != 0 && h != 0) { + set_emul_lcd_size(w, h); + break; + } + } + break; } } diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index af4034f..9f61b85 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -117,7 +117,7 @@ void qemu_ds_sdl_resize(DisplayState *ds) ds->surface->pf.bmask, ds->surface->pf.amask); } else { - INFO("create blank screen\n"); + INFO("create blank screen = (%d, %d)\n", get_emul_lcd_width(), get_emul_lcd_height()); surface_qemu = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, ds_get_bits_per_pixel(ds), 0, 0, 0, 0); } -- 2.7.4