Ejemplo n.º 1
0
/*
 * Effect rendering functions.
 */
void RenderEffect(int frameNumber) {
  PixBufT *canvas = R_("Canvas");
  UVMapT *uvmap = R_("Map");
  PixBufT *comp = R_("Component");
  PixBufT *shades = R_("Shades");
  uint8_t *cfunc = R_("ColFunc");

  int du = 2 * frameNumber;
  int dv = 4 * frameNumber;

  {
    int i;

    for (i = 0; i < 256; i++) {
      uint8_t v = i + du;

      if (v >= 128)
        cfunc[i] = ~v * 2;
      else 
        cfunc[i] = v * 2;
    }
  }

  PixBufSetBlitMode(comp, BLIT_COLOR_FUNC);
  PixBufSetColorFunc(comp, cfunc);
  PROFILE (PixBufBlitWithColorFunc)
    PixBufBlit(shades, 0, 0, comp, NULL);

  UVMapSetOffset(uvmap, du, dv);
  PROFILE (UVMapRenderFast)
    UVMapRender(uvmap, canvas);

  c2p1x1_8_c5_bm(canvas->data, GetCurrentBitMap(), WIDTH, HEIGHT, 0, 0);
}
Ejemplo n.º 2
0
static void Render(int frameNumber) {
  int du = 2 * frameNumber;
  int dv = 4 * frameNumber;

  {
    int i;

    for (i = 0; i < 256; i++) {
      uint8_t v = i + du;

      if (v >= 128)
        colorFunc[i] = ~v * 2;
      else 
        colorFunc[i] = v * 2;
    }
  }

  PixBufSetBlitMode(component, BLIT_COLOR_FUNC);
  PixBufSetColorFunc(component, colorFunc);
  PROFILE (PixBufBlitWithColorFunc)
    PixBufBlit(shades, 0, 0, component, NULL);

  UVMapSetOffset(uvmap, du, dv);
  PROFILE (UVMapRenderFast)
    UVMapRender(uvmap, canvas);

  c2p1x1_8_c5_bm(canvas->data, GetCurrentBitMap(), WIDTH, HEIGHT, 0, 0);
}