本文整理汇总了C++中InStream类的典型用法代码示例。如果您正苦于以下问题:C++ InStream类的具体用法?C++ InStream怎么用?C++ InStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadBiped
//----------------------------------------------------------------------------
void PlanarReflections::LoadBiped ()
{
#ifdef WM5_LITTLE_ENDIAN
std::string path = Environment::GetPathR("SkinnedBipedPN.wmof");
#else
std::string path = Environment::GetPathR("SkinnedBipedPN.be.wmof");
#endif
InStream source;
source.Load(path);
mBiped = (Node*)source.GetObjectAt(0);
// This guarantees that the reflection is drawn, even when the biped is
// not visible to the camera.
mBiped->Culling = Spatial::CULL_NEVER;
}
示例2: recv
void recv(InStream & stream, uint16_t len)override {
this->len = len;
unsigned int expected = 2 + 2 + ((this->len < 10) ? 0 : 2); /* colorPointerFlag(2) + colorPointerCacheSize(2) + pointerCacheSize*/
if (!stream.in_check_rem(expected)){
LOG(LOG_ERR, "Truncated CAPSTYPE_POINTER, need=%u remains=%zu",
expected, stream.in_remain());
throw Error(ERR_MCS_PDU_TRUNCATED);
}
this->colorPointerFlag = stream.in_uint16_le();
this->colorPointerCacheSize = stream.in_uint16_le();
if (this->len < 10) return;
this->pointerCacheSize = stream.in_uint16_le();
}
示例3: Load
//----------------------------------------------------------------------------
void Portal::Load (InStream& source)
{
WM5_BEGIN_DEBUG_STREAM_LOAD(source);
Object::Load(source);
source.ReadRR(mNumVertices, mModelVertices);
source.ReadAggregate(mModelPlane);
source.ReadBool(Open);
source.ReadPointer(AdjacentRegion);
mWorldVertices = new1<APoint>(mNumVertices);
WM5_END_DEBUG_STREAM_LOAD(Portal, source);
}
示例4: Load
//----------------------------------------------------------------------------
void Renderable::Load (InStream& source)
{
PX2_BEGIN_DEBUG_STREAM_LOAD(source);
Movable::Load(source);
source.ReadEnum(mType);
source.ReadAggregate(mModelBound);
source.ReadPointer(mVFormat);
source.ReadPointer(mVBuffer);
source.ReadPointer(mIBuffer);
source.ReadPointer(mMaterial);
PX2_END_DEBUG_STREAM_LOAD(Renderable, source);
}
示例5: Load
//----------------------------------------------------------------------------
void ScriptController::Load(InStream& source)
{
PX2_BEGIN_DEBUG_STREAM_LOAD(source);
Controller::Load(source);
PX2_VERSION_LOAD(source);
source.Read(mNumFixUpdatePerSeconds);
mOneFrameSeconds = 1.0f / (float)mNumFixUpdatePerSeconds;
source.ReadString(mFilename);
source.ReadString(mClassName);
PX2_END_DEBUG_STREAM_LOAD(ScriptController, source);
}
示例6: Load
//----------------------------------------------------------------------------
void Visual::Load (InStream& source)
{
WM5_BEGIN_DEBUG_STREAM_LOAD(source);
Spatial::Load(source);
source.ReadEnum(mType);
source.ReadAggregate(mModelBound);
source.ReadPointer(mVFormat);
source.ReadPointer(mVBuffer);
source.ReadPointer(mIBuffer);
source.ReadPointer(mEffect);
WM5_END_DEBUG_STREAM_LOAD(Visual, source);
}
示例7: Link
//----------------------------------------------------------------------------
void RawTerrain::Link (InStream& source)
{
Node::Link(source);
source.ResolveLink(mVFormat);
source.ResolveLink(mCamera);
source.ResolveLink(mShine);
for (int row = 0; row < mNumRows; ++row)
{
for (int col = 0; col < mNumCols; ++col)
{
source.ResolveLink(mPages[row][col]);
}
}
}
示例8: Link
//----------------------------------------------------------------------------
void CurveMesh::Link (InStream& source)
{
Polysegment::Link(source);
source.ResolveLink(mOrigVBuffer);
source.ResolveLink(mOrigParams);
source.ResolveLink(mNumSegments, mSegments);
if (mCInfo)
{
for (int i = 0; i < mNumFullVertices; ++i)
{
source.ResolveLink(mCInfo[i].Segment);
}
}
}
示例9: ExtendedMouseEvent_Recv
explicit ExtendedMouseEvent_Recv(InStream & stream)
: pointerFlags(0)
, xPos(0)
, yPos(0) {
const unsigned expected =
6; // pointerFlags(2) + xPos(2) + yPos(2)
if (!stream.in_check_rem(expected)) {
LOG(LOG_ERR, "SlowPath::ExtendedMouseEvent: data truncated, expected=%u remains=%zu",
expected, stream.in_remain());
throw Error(ERR_RDP_SLOWPATH);
}
this->pointerFlags = stream.in_uint16_le();
this->xPos = stream.in_uint16_le();
this->yPos = stream.in_uint16_le();
}
示例10: UnicodeKeyboardEvent_Recv
explicit UnicodeKeyboardEvent_Recv(InStream & stream)
: keyboardFlags(0)
, unicodeCode(0) {
const unsigned expected =
6; // keyboardFlags(2) + unicodeCode(2) + pad2Octets(2)
if (!stream.in_check_rem(expected)) {
LOG(LOG_ERR, "SlowPath::UnicodeKeyboardEvent: data truncated, expected=%u remains=%zu",
expected, stream.in_remain());
throw Error(ERR_RDP_SLOWPATH);
}
this->keyboardFlags = stream.in_uint16_le();
this->unicodeCode = stream.in_uint16_le();
stream.in_skip_bytes(2); // pad2Octets
}
示例11: InputEvent_Recv
explicit InputEvent_Recv(InStream & stream)
: eventTime([&stream](){
// time(4) + mes_type(2) + device_flags(2) + param1(2) + param2(2)
if (!stream.in_check_rem(12)) {
LOG(LOG_ERR, "SlowPath::InputEvent: data truncated, expected=12 remains=%zu", stream.in_remain());
throw Error(ERR_RDP_SLOWPATH);
}
return stream.in_uint32_le();
}())
, messageType(stream.in_uint16_le())
// device_flags(2) + param1(2) + param2(2)
, payload(stream.get_current(), 6)
// Body of constructor
{
stream.in_skip_bytes(this->payload.get_capacity());
}
示例12: Load
//----------------------------------------------------------------------------
void SimpleSegment::Load (InStream& source)
{
WM5_BEGIN_DEBUG_STREAM_LOAD(source);
CurveSegment::Load(source);
source.Read(mAmplitude);
source.Read(mFrequency);
source.Read(mHeight);
mAmplFreq = mAmplitude*mFrequency;
mAmplFreqFreq = mAmplFreq*mFrequency;
mAmplFreqFreqFreq = mAmplFreqFreq*mFrequency;
WM5_END_DEBUG_STREAM_LOAD(SimpleSegment, source);
}
示例13: RDPMultiDstBlt
RDPMultiDstBlt(int16_t nLeftRect, int16_t nTopRect, int16_t nWidth, int16_t nHeight, uint8_t bRop, uint8_t nDeltaEntries,
InStream & deltaEncodedRectangles)
: nLeftRect(nLeftRect)
, nTopRect(nTopRect)
, nWidth(nWidth)
, nHeight(nHeight)
, bRop(bRop)
, nDeltaEntries(nDeltaEntries) {
::memset(this->deltaEncodedRectangles, 0, sizeof(this->deltaEncodedRectangles));
for (int i = 0; i < this->nDeltaEntries; i++) {
this->deltaEncodedRectangles[i].leftDelta = deltaEncodedRectangles.in_sint16_le();
this->deltaEncodedRectangles[i].topDelta = deltaEncodedRectangles.in_sint16_le();
this->deltaEncodedRectangles[i].width = deltaEncodedRectangles.in_sint16_le();
this->deltaEncodedRectangles[i].height = deltaEncodedRectangles.in_sint16_le();
}
}
示例14: Load
//----------------------------------------------------------------------------
void InterpCurveSpeedController::Load (InStream& source)
{
PX2_BEGIN_DEBUG_STREAM_LOAD(source);
InterpCurveFloat3Controller::Load(source);
PX2_VERSION_LOAD(source);
source.Read(mMaxLength);
if (1 == GetReadedVersion())
{
source.ReadAggregate(mInitPos);
}
PX2_END_DEBUG_STREAM_LOAD(InterpCurveSpeedController, source);
}
示例15: process_format_data_request
void process_format_data_request(
InStream& chunk,
FieldIndex nb_paste_text, FieldIndex nb_paste_image, FieldIndex nb_paste_file)
{
this->last_formatID = chunk.in_uint32_le();
switch (this->last_formatID) {
case RDPECLIP::CF_TEXT:
case RDPECLIP::CF_OEMTEXT:
case RDPECLIP::CF_UNICODETEXT:
case RDPECLIP::CF_DSPTEXT:
case RDPECLIP::CF_LOCALE:
this->metrics->add_to_current_data(nb_paste_text, 1);
break;
case RDPECLIP::CF_METAFILEPICT:
case RDPECLIP::CF_DSPMETAFILEPICT:
this->metrics->add_to_current_data(nb_paste_image, 1);
break;
default:
if (this->file_contents_format_ID == this->last_formatID){
this->metrics->add_to_current_data(nb_paste_file, 1);
}
break;
}
}