Exemplo n.º 1
0
Arquivo: ANIM.cpp Projeto: 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);
}
Exemplo n.º 2
0
Arquivo: ANIM.cpp Projeto: AxioDL/urde
void ANIM::ANIM0::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s) {
  Header head;

  atUint32 maxId = 0;
  for (const std::pair<atUint32, std::tuple<bool, bool, bool>>& bone : bones)
    maxId = std::max(maxId, bone.first);

  head.binarySize(s);
  s += maxId + 1;
  s += bones.size() * 3 + 12;

  s += 12;
  for (const std::pair<atUint32, std::tuple<bool, bool, bool>>& bone : bones) {
    if (std::get<0>(bone.second))
      s += head.keyCount * 16;
    if (std::get<1>(bone.second))
      s += head.keyCount * 12;
    if (std::get<2>(bone.second))
      s += head.keyCount * 12;
  }
}
Exemplo n.º 3
0
size_t ANIM::ANIM0::binarySize(size_t __isz) const
{
    Header head;

    atUint32 maxId = 0;
    for (const std::pair<atUint32, bool>& bone : bones)
        maxId = std::max(maxId, bone.first);

    __isz = head.binarySize(__isz);
    __isz += maxId + 1;
    __isz += bones.size() + 4;

    __isz += 8;
    for (const std::pair<atUint32, bool>& bone : bones)
    {
        __isz += head.keyCount * 16;
        if (bone.second)
            __isz += head.keyCount * 12;
    }

    return __isz + 4;
}
Exemplo n.º 4
0
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);
}