本文整理汇总了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]);
}
}
示例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];
}
}
示例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]);
}
}