Ejemplo n.º 1
0
static void DrawCliparts() {
  GreetingT *grt = greeting;
  Area2D *area = grt_area[active];
  BitmapT *dst = screen[active];
  WORD step = (frameCount - lastFrameCount) * 3;
  WORD n = PNUM;

  while (--n >= 0) {
    BitmapT *src = grt->bitmap;
    WORD dy = grt->pos.y;
    WORD sy = 0;
    WORD sh = src->height;

    if (dy < 0) { sy -= dy; sh += dy; dy = 0; }
    if (dy + sh >= HEIGHT) { sh = HEIGHT - dy; }

    if (sh > 0) {
      area->x = grt->pos.x;
      area->y = dy;
      area->w = src->width;
      area->h = sh;

      BitmapCopyArea(dst, grt->pos.x, dy, src, 0, sy, src->width, sh);
      BlitterSetSync(dst, 3, grt->pos.x, dy, src->width, sh, grt->color ? 0 : -1);
      BlitterSetSync(dst, 4, grt->pos.x, dy, src->width, sh, -1);
    } else {
      area->h = 0;
    }

    grt->pos.y -= step;
    grt++;
    area++;
  }
}
Ejemplo n.º 2
0
static void Init() {
  WORD i;

  screen[0] = NewBitmap(WIDTH, HEIGHT, DEPTH);
  screen[1] = NewBitmap(WIDTH, HEIGHT, DEPTH);

  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;

  for (i = 0; i < 8; i++) {
    Area2D flare_area = { 0, i * SIZE, SIZE, SIZE };
    flare[i] = NewBitmap(SIZE, SIZE, DEPTH);
    BitmapCopyArea(flare[i], 0, 0, flares, &flare_area);
  }

  carry = NewBitmap(SIZE + 16, SIZE, 2);
  cp = NewCopList(50);

  for (i = 0; i < 2; i++)
    BitmapClear(screen[i]);

  CopInit(cp);
  CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT);
  CopSetupBitplanes(cp, bplptr, screen[active], DEPTH);
  CopLoadPal(cp, flares->palette, 0);
  CopEnd(cp);
  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;
}
Ejemplo n.º 3
0
static void ClearCliparts() {
  Area2D *area = grt_area[active];
  BitmapT *dst = screen[active];
  WORD n = PNUM;

  while (--n >= 0) {
    WORD x = area->x;
    WORD y = area->y;
    WORD w = area->w;
    WORD h = area->h;

    if (h > 0) {
      if (h > 8) { y += h - 8; h = 8; }
      BlitterSetSync(dst, 4, x, y, w, h, 0);
      BitmapCopyArea(dst, x, y, background, x, y, w, h);
    }

    area++;
  }
}