gpu_unai: basic frameskip
authornotaz <notasas@gmail.com>
Sun, 2 Jan 2011 22:14:35 +0000 (00:14 +0200)
committernotaz <notasas@gmail.com>
Sun, 2 Jan 2011 22:14:35 +0000 (00:14 +0200)
only partially works but oh well

frontend/plugin_lib.c
frontend/plugin_lib.h
plugins/dfxvideo/fps.c
plugins/gpu_unai/gpu.cpp

index d69a0b4..4e65e2e 100644 (file)
@@ -198,11 +198,14 @@ static void pl_get_layer_pos(int *x, int *y, int *w, int *h)
        *h = g_layer_h;
 }
 
+extern int UseFrameSkip; // hmh
+
 const struct rearmed_cbs pl_rearmed_cbs = {
        pl_get_layer_pos,
        pl_fbdev_open,
        pl_fbdev_set_mode,
        pl_fbdev_flip,
        pl_fbdev_close,
+       &UseFrameSkip,
 };
 
index 7a25b81..f5c4985 100644 (file)
@@ -34,6 +34,7 @@ struct rearmed_cbs {
        int   (*pl_fbdev_set_mode)(int w, int h, int bpp);
        void *(*pl_fbdev_flip)(void);
        void  (*pl_fbdev_close)(void);
+       int  *fskip_option;
 };
 
 extern const struct rearmed_cbs pl_rearmed_cbs;
index 2edcd30..b0c87dd 100644 (file)
@@ -57,7 +57,7 @@ void CheckFrameRate(void)
  else                                                  // non-skipping mode:
   {
    if(UseFrameLimit) FrameCap();                       // -> do it
-   if(ulKeybits&KEY_SHOWFPS) calcfps();                // -> and calc fps display
+   /*if(ulKeybits&KEY_SHOWFPS)*/ calcfps();                // -> and calc fps display
   }
 }
 
index 8a13521..fa19b63 100644 (file)
@@ -911,7 +911,15 @@ void GPU_updateLace(void)
        if (!fb_dirty || (GPU_GP1&0x08800000))
                return;
 
-       blit();
+       if (!isSkip) {
+               blit();
+
+               fb_dirty = false;
+               if (*cbs->fskip_option)
+                       isSkip = true;
+       }
+       else
+               isSkip = false;
 }
 
 long GPUopen(unsigned long *, char *, char *)