/* ================================================================
   毎フレームの処理
================================================================ */
bool VnWipeMaskLtoR::Draw()
{
  const int end_frame = (640 + MASK_PATTERN_WIDTH) / MASK_WIDTH;
  const int now_frame = GetNowFrame(end_frame);

  cerr << "WipeMaskLtoR(" << now_frame << ")" << endl;

  if (end_frame <= now_frame) {
    LastFrame();
    return true;
  }

  if (now_frame != GetPastFrame()) {
    // 透明色を切替える
    u_int32_t old_trans = mrDirector.GetImage(2).SetTransColor(0x00000000);
    VnSprite mask(mrDirector.GetImage(2),
                  MASK_LEFT, MASK_TOP, MASK_PATTERN_WIDTH, MASK_HEIGHT);
    int x = (now_frame - MASK_PATTERN_WIDTH / MASK_WIDTH) * MASK_WIDTH;
    for(int y = 0; y < 480; y += mask.Height()) {
      mrDirector.GetImage(1).
        CopyWithMask(mrDirector.GetImage(0), x, y, mask, x, y);
    }
    mrDirector.UpdateWindow(VnRect(x, 0, mask.Width(), 480));
    // 透明色を元に戻す
    mrDirector.GetImage(2).SetTransColor(old_trans);

    // mPastFrameを更新
    IncPastFrame();
  }
  return false;
}
Exemple #2
0
/* ================================================================
   毎フレームの処理
================================================================ */
bool VnFadeMask::Draw()
{
  const int end_frame = sizeof(sMaskBits) / sizeof(sMaskBits[0]);
  const int now_frame = GetNowFrame(end_frame);

  if (end_frame <= now_frame) { 
    LastFrame();
    return true;
  }

  // 一定時間経過ごとに画像を更新する
  if (now_frame != GetPastFrame()) {
    mrDirector.GetImage(1).
//       Copy(mrDirector.GetImage(0), VnRect(0, 0, 640, 480), 0, 0, VnImageOperation::CopyMask(sMaskBits[now_frame]));
      CopyWithMask(mrDirector.GetImage(0), 0, 0, 640, 480, sMaskBits[now_frame], 0, 0);
    mrDirector.UpdateWindow(VnRect(0, 0, 640, 480));
    IncPastFrame();
  }

  return false;
}
/* ================================================================
   処理の中断要求
   最終画像を表示する
================================================================ */
void VnWipeMaskLtoR::Suspend()
{
  LastFrame();
}
Exemple #4
0
/* ================================================================
   処理の中断要求
   最終画像を表示する
================================================================ */
void VnFadeMask::Suspend()
{
  LastFrame();
}
Exemple #5
0
int32_t IngexShm::CurrentTimecode(unsigned int channel)
{
    // Could check (channel < mChannels) first.
    return Timecode(channel, LastFrame(channel));
}