예제 #1
0
파일: ANIM.cpp 프로젝트: AxioDL/urde
void ANIM::ANIM2::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s) {
  Header head;

  WordBitmap keyBmp;
  for (atUint32 frame : frames) {
    while (keyBmp.getBit(frame))
      ++frame;
    keyBmp.setBit(frame);
  }

  head.binarySize(s);
  keyBmp.binarySize(s);
  s += 4;
  for (const std::pair<atUint32, std::tuple<bool, bool, bool>>& bone : bones) {
    s += 7;
    if (std::get<0>(bone.second))
      s += 9;
    if (std::get<1>(bone.second))
      s += 9;
    if (std::get<2>(bone.second))
      s += 9;
  }

  s += DNAANIM::ComputeBitstreamSize(frames.size(), channels);
}
예제 #2
0
파일: ANIM.cpp 프로젝트: KalDragon/urde
size_t ANIM::ANIM2::binarySize(size_t __isz) const
{
    Header head;

    WordBitmap keyBmp;
    for (atUint32 frame : frames)
    {
        while (keyBmp.getBit(frame))
            ++frame;
        keyBmp.setBit(frame);
    }

    __isz = head.binarySize(__isz);
    __isz = keyBmp.binarySize(__isz);
    __isz += 8;
    for (const std::pair<atUint32, bool>& bone : bones)
    {
        __isz += 17;
        if (bone.second)
            __isz += 9;
    }

    return __isz + DNAANIM::ComputeBitstreamSize(frames.size(), channels);
}