fix bgr2rgb16 and reduce mode change glitching
[pcsx_rearmed.git] / frontend / plugin_lib.c
index e2a0d58..35a23c1 100644 (file)
@@ -28,14 +28,18 @@ int pl_fbdev_init(void)
 
 int pl_fbdev_set_mode(int w, int h, int bpp)
 {
-       int ret;
+       void *ret;
 
        pl_fbdev_w = w;
-       printf("set mode %dx%d@%d\n", w, h, bpp);
+
+       vout_fbdev_clear(layer_fb);
        ret = vout_fbdev_resize(layer_fb, w, h, bpp, 0, 0, 0, 0, 3);
-       if (ret)
+       if (ret == NULL)
                fprintf(stderr, "failed to set mode\n");
-       return ret;
+       else
+               pl_fbdev_buf = ret;
+
+       return (ret != NULL) ? 0 : -1;
 }
 
 void *pl_fbdev_flip(void)