[Title] sdl_rotozoom was replaced by maru_rotozoom
authorgiwoong.kim <giwoong.kim@samsung.com>
Tue, 7 Aug 2012 07:47:31 +0000 (16:47 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Tue, 7 Aug 2012 07:47:31 +0000 (16:47 +0900)
[Type] feature
[Module] Emulator / skin
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause] anti-aliasing
[Solution]
[TestCase]

tizen/src/maru_sdl.c
tizen/src/maru_sdl_rotozoom.h

index aeeff69..f7ed385 100644 (file)
@@ -29,6 +29,7 @@
 
 
 #include <pthread.h>
+#include <math.h>
 #include "console.h"
 #include "maru_sdl.h"
 #include "emul_state.h"
@@ -348,18 +349,18 @@ static void qemu_update(void)
         { //sdl surface
             SDL_Surface *processing_screen = NULL;
 
-            if (current_scale_factor <= 0.5) {
-                /* zoom filter : c00 c0-1 c01 c-10 c10 */
-                processing_screen = maru_rotozoom(surface_qemu, (int)current_screen_degree, current_scale_factor);
-                SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
-            } else if (current_scale_factor != 1.0 || current_screen_degree != 0.0) {
+            if (current_scale_factor < 0.5) {
                 // workaround
                 // set color key 'magenta'
                 surface_qemu->format->colorkey = 0xFF00FF;
 
-                /* zoom filter : c00 c01 c10 c11  */
+                //image processing
                 processing_screen = rotozoomSurface(surface_qemu, current_screen_degree, current_scale_factor, 1);
                 SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
+            } else if (current_scale_factor != 1.0 || current_screen_degree != 0.0) {
+                //image processing
+                processing_screen = maru_rotozoom(surface_qemu, (int)current_screen_degree, current_scale_factor);
+                SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
             } else { //as-is
                 SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
             }
index 7f7888d..4faf2c4 100644 (file)
@@ -105,9 +105,9 @@ static void interpolate_pixel_cpy(unsigned int *dst, unsigned int *src_addr, uns
     unsigned int sum_b = 0; //0x000000ff
 
     unsigned int c00 = (x * src_w) + y;
-    unsigned int c01 = (y + 1 > src_w) ? c00 : c00 + 1;
-    unsigned int c10 = (x + 1 > src_h) ? c00 : ((x + 1) * src_w) + y;
-    unsigned int c11 = (y + 1 > src_w) ? c00 : c10 + 1;
+    unsigned int c01 = (y + 1 >= src_w) ? c00 : c00 + 1;
+    unsigned int c10 = (x + 1 >= src_h) ? c00 : ((x + 1) * src_w) + y;
+    unsigned int c11 = (y + 1 >= src_w) ? c00 : c10 + 1;
 
     sum_r = (src_addr[c00] & R_CHANNEL_MASK) + (src_addr[c01] & R_CHANNEL_MASK) +
         (src_addr[c10] & R_CHANNEL_MASK) + (src_addr[c11] & R_CHANNEL_MASK);