bool unpack(const UByte& _b1, const UByte& _b2)
 {
   loadR(  utypeGet<UByte,  true>(_b1, 5, 0));
   loadG(  utypeGet<UByte,  true>(_b1, 3, 5)
         | utypeGet<UByte, false>(_b2, 3, 3));
   loadB(  utypeGet<UByte,  true>(_b2, 5, 3));
   return true;
 }
    bool unpack(const UByte& _b1, const UByte& _b2, const UByte& _b3)
    {
      loadR(utypeGet<UByte, true>(_b1, 8, 0));
      loadG(utypeGet<UByte, true>(_b2, 8, 0));
      loadB(utypeGet<UByte, true>(_b3, 8, 0));

      return true;
    }
Exemplo n.º 3
0
bool Save::load(int num)
{
    if (!checkSaveFileExist(num))
    {
        return false;
    }

    loadR(num);
    loadRFromDB(num);
    loadSD(num);

    //内部编码为cp936
    if (Encode != 936)
    {
        Encode = 936;
        for (auto i : roles_)
        {
            PotConv::fromCP950ToCP936(i->Name);
            PotConv::fromCP950ToCP936(i->Nick);
        }
        for (auto i : items_)
        {
            PotConv::fromCP950ToCP936(i->Name);
            PotConv::fromCP950ToCP936(i->Introduction);
        }
        for (auto i : magics_)
        {
            PotConv::fromCP950ToCP936(i->Name);
        }
        for (auto i : submap_infos_)
        {
            PotConv::fromCP950ToCP936(i->Name);
        }
    }

    makeMaps();

    return true;
}