当前位置: 首页>>代码示例>>C++>>正文


C++ serializer::mode方法代码示例

本文整理汇总了C++中serializer::mode方法的典型用法代码示例。如果您正苦于以下问题:C++ serializer::mode方法的具体用法?C++ serializer::mode怎么用?C++ serializer::mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在serializer的用法示例。


在下文中一共展示了serializer::mode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: serialize

void SuperScope::serialize(serializer& s) {
  Processor::serialize(s);
  //Save block.
  unsigned char block[Controller::SaveSize] = {0};
  block[0] = latched ? 1 : 0;
  block[1] = counter;
  block[2] = trigger ? 1 : 0;
  block[3] = cursor ? 1 : 0;
  block[4] = turbo ? 1 : 0;
  block[5] = pause ? 1 : 0;
  block[6] = offscreen ? 1 : 0;
  block[7] = (unsigned short)x >> 8;
  block[8] = (unsigned short)x;
  block[9] = (unsigned short)y >> 8;
  block[10] = (unsigned short)y;

  s.array(block, Controller::SaveSize);
  if(s.mode() == nall::serializer::Load) {
    latched = (block[0] != 0);
    counter = block[1];
    trigger = (block[2] != 0);
    cursor = (block[3] != 0);
    turbo = (block[4] != 0);
    pause = (block[5] != 0);
    offscreen = (block[6] != 0);
    x = (short)(((unsigned short)block[7] << 8) | (unsigned short)block[8]);
    y = (short)(((unsigned short)block[9] << 8) | (unsigned short)block[10]);
  }
}
开发者ID:RetroAchievements,项目名称:RASuite,代码行数:29,代码来源:superscope.cpp

示例2: serialize

void Gamepad::serialize(serializer& s) {
  Processor::serialize(s);
  //Save block.
  unsigned char block[Controller::SaveSize] = {0};
  block[0] = latched ? 1 : 0;
  block[1] = counter;
  s.array(block, Controller::SaveSize);
  if(s.mode() == nall::serializer::Load) {
    latched = (block[0] != 0);
    counter = block[1];
  }
}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:12,代码来源:gamepad.cpp

示例3: serialize

void Mouse::serialize(serializer& s) {
  Processor::serialize(s);
  //Save block.
  unsigned char block[Controller::SaveSize] = {0};
  block[0] = latched ? 1 : 0;
  block[1] = counter;
  block[2] = (unsigned short)position_x >> 8;
  block[3] = (unsigned short)position_x;
  block[4] = (unsigned short)position_y >> 8;
  block[5] = (unsigned short)position_y;
  s.array(block, Controller::SaveSize);
  if(s.mode() == nall::serializer::Load) {
    latched = (block[0] != 0);
    counter = block[1];
    position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]);
    position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]);
  }
}
开发者ID:RetroAchievements,项目名称:RASuite,代码行数:18,代码来源:mouse.cpp


注:本文中的serializer::mode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。