[Title] added sdl bpp feature
authorgiwoong.kim <giwoong.kim@samsung.com>
Mon, 26 Mar 2012 05:41:37 +0000 (14:41 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 26 Mar 2012 05:41:37 +0000 (14:41 +0900)
[Type]
[Module] Emulator
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/maru_finger.c [changed mode: 0755->0644]
tizen/src/maru_sdl.c

index 948245d..9a76712 100644 (file)
@@ -70,6 +70,21 @@ int get_emul_lcd_height(void)
     return _emul_info.lcd_size_h;
 }
 
+/* sdl bits per pixel */
+void set_emul_sdl_bpp(int bpp)
+{
+    _emul_info.sdl_bpp = bpp;
+
+    if (_emul_info.sdl_bpp != 32) {
+        INFO("?? sdl bpp = %d\n", _emul_info.sdl_bpp);
+    }
+}
+
+int get_emul_sdl_bpp(void)
+{
+    return _emul_info.sdl_bpp;
+}
+
 /* emulator window scale */
 void set_emul_win_scale(double scale_factor)
 {
index c715a12..fbe341f 100644 (file)
@@ -68,7 +68,8 @@ typedef  struct EmulatorConfigInfo {
     char emulator_name[256]; //TODO:
     int lcd_size_w;
     int lcd_size_h;
-    int dpi; //not used yet
+    int guest_dpi; //not used yet
+    int sdl_bpp;
     //TODO:
 } EmulatorConfigInfo;
 
@@ -86,6 +87,7 @@ void set_emulator_condition(int state);
 void set_emul_lcd_size(int width, int height);
 void set_emul_win_scale(double scale);
 void set_emul_rotation(short rotation_type);
+void set_emul_sdl_bpp(int bpp);
 
 /* getter */
 int get_emulator_condition(void);
@@ -93,6 +95,7 @@ int get_emul_lcd_width(void);
 int get_emul_lcd_height(void);
 double get_emul_win_scale(void);
 short get_emul_rotation(void);
+int get_emul_sdl_bpp(void);
 MultiTouchState *get_emul_multi_touch_state(void);
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 0886bd0..282f74d
@@ -194,7 +194,7 @@ void init_multi_touch_state(void)
 #endif
 
     SDL_Surface *point = SDL_CreateRGBSurface(SDL_SRCALPHA | SDL_HWSURFACE,
-               mts->finger_point_size + 2, mts->finger_point_size + 2, 32, rmask, gmask, bmask, amask);
+               mts->finger_point_size + 2, mts->finger_point_size + 2, get_emul_sdl_bpp(), rmask, gmask, bmask, amask);
 
     sdl_fill_circle(point, finger_point_size_half, finger_point_size_half,
         finger_point_size_half, mts->finger_point_color); //finger point circle
index b69cc93..468120f 100644 (file)
@@ -66,19 +66,19 @@ static void qemu_update(void)
     int i;
     SDL_Surface *processing_screen = NULL;
 
-    if (scale_factor != 1.0 || screen_degree != 0.0) {
+    if (surface_qemu != NULL) {
+        if (scale_factor != 1.0 || screen_degree != 0.0) {
 
-        // workaround
-        if ( surface_qemu ) {
+            // workaround
             // set color key 'magenta'
             surface_qemu->format->colorkey = 0xFF00FF;
-        }
 
-        //image processing
-        processing_screen = rotozoomSurface(surface_qemu, screen_degree, scale_factor, 1);
-        SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
-    } else {
-        SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
+            //image processing
+            processing_screen = rotozoomSurface(surface_qemu, screen_degree, scale_factor, 1);
+            SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
+        } else {
+            SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
+        }
     }
 
     /* draw multi-touch finger points */
@@ -331,10 +331,12 @@ void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height)
     w = lcd_size_width * scale_factor;
     h = lcd_size_height * scale_factor;
 
+    set_emul_sdl_bpp(SDL_BPP);
+
     INFO( "maru sdl initialization\n");
-    surface_screen = SDL_SetVideoMode(w, h, SDL_BPP, SDL_FLAGS);
+    surface_screen = SDL_SetVideoMode(w, h, get_emul_sdl_bpp(), SDL_FLAGS);
     if (surface_screen == NULL) {
-        ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, SDL_BPP, SDL_GetError());
+        ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, get_emul_sdl_bpp(), SDL_GetError());
     }
 
 #ifndef _WIN32