[Title] find out size of lcd before emulator booting
authorgiwoong.kim <giwoong.kim@samsung.com>
Wed, 5 Sep 2012 03:17:43 +0000 (12:17 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Wed, 5 Sep 2012 05:00:34 +0000 (14:00 +0900)
[Type] bugfix
[Module] Emualtor
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause] timing
[Solution]
[TestCase] booting

tizen/src/emul_state.c
tizen/src/emulator.c
tizen/src/maru_sdl.c

index 4896085837dd7baa3da737c617e54dc189e5d81c..da85a196003740538dd91c243ccc06ce8e5c6ee0 100644 (file)
@@ -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)
index 235ca1db8a106e473008de6a8c1a343fcd6ddca4..7dbbb60ce42fc445fc99d21cc32cabd57476f164 100644 (file)
@@ -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;
         }
     }
index af4034f15a2b85c0a4f3680289702ff707e787c4..9f61b855b396c329f63e100f3ca13fd485843685 100644 (file)
@@ -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);
     }