//---------------------------------------------------------------------------- void UIButtonBase::Load(InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); UIFrame::Load(source); PX2_VERSION_LOAD(source); source.ReadEnum(mButType); source.ReadAggregate(mNormalColor); source.ReadAggregate(mHoveredColor); source.ReadAggregate(mPressedColor); source.ReadAggregate(mDisableColor); source.Read(mNormalAlpha); source.Read(mHoveredAlpha); source.Read(mPressedAlpha); source.Read(mDisableAlpha); source.Read(mNormalBrightness); source.Read(mHoveredBrightness); source.Read(mPressedBrightness); source.Read(mDisableBrightness); source.ReadPointer(mPicBoxNormal); source.ReadPointer(mPicBoxOver); source.ReadPointer(mPicBoxDown); source.ReadPointer(mPicBoxDisabled); source.ReadEnum(mButtonState); PX2_END_DEBUG_STREAM_LOAD(UIButtonBase, source); }
//---------------------------------------------------------------------------- void Jungler::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); TriMesh::Load(source); PX2_VERSION_LOAD(source); source.ReadEnum(mJunglerType); source.Read(mMaxNum); source.ReadPointer(mMtlInst); source.ReadPointer(mTexture); int num = 0; source.Read(num); if (num > 0) { mPoses.resize(num); mNormals.resize(num); mWidths.resize(num); mHeights.resize(num); source.ReadAggregateVV(num, &mPoses[0]); source.ReadAggregateVV(num, &mNormals[0]); source.ReadVV(num, &mWidths[0]); source.ReadVV(num, &mHeights[0]); } PX2_END_DEBUG_STREAM_LOAD(Jungler, source); }
//---------------------------------------------------------------------------- void RawTerrain::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Node::Load(source); source.ReadEnum(mMode); source.Read(mNumRows); source.Read(mNumCols); source.Read(mSize); source.Read(mMinElevation); source.Read(mMaxElevation); source.Read(mSpacing); source.Read(mCameraRow); source.Read(mCameraCol); source.ReadPointer(mVFormat); source.ReadPointer(mCamera); source.ReadPointer(mShine); mPages = new2<RawTerrainPagePtr>(mNumCols, mNumRows); for (int row = 0; row < mNumRows; ++row) { for (int col = 0; col < mNumCols; ++col) { source.ReadPointer(mPages[row][col]); } } PX2_END_DEBUG_STREAM_LOAD(RawTerrain, source); }
//---------------------------------------------------------------------------- void Light::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadEnum(mType); source.ReadAggregate(Ambient); source.ReadAggregate(Diffuse); source.ReadAggregate(Specular); source.Read(Constant); source.Read(Linear); source.Read(Quadratic); source.Read(Intensity); source.Read(Angle); source.Read(CosAngle); source.Read(SinAngle); source.Read(Exponent); source.ReadAggregate(Position); source.ReadAggregate(DVector); source.ReadAggregate(UVector); source.ReadAggregate(RVector); PX2_END_DEBUG_STREAM_LOAD(Light, source); }
//---------------------------------------------------------------------------- void StencilState::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadBool(Enabled); source.ReadEnum(Compare); source.Read(Reference); source.Read(Mask); source.Read(WriteMask); source.ReadEnum(OnFail); source.ReadEnum(OnZFail); source.ReadEnum(OnZPass); WM5_END_DEBUG_STREAM_LOAD(StencilState, source); }
//---------------------------------------------------------------------------- void DepthState::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadBool(Enabled); source.ReadBool(Writable); source.ReadEnum(Compare); WM5_END_DEBUG_STREAM_LOAD(DepthState, source); }
//---------------------------------------------------------------------------- void UIButton::Load(InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); UIButtonBase::Load(source); PX2_VERSION_LOAD(source); source.ReadEnum(mAfterReleasedType); source.Read(mAfterReleasedRecoverTime); PX2_END_DEBUG_STREAM_LOAD(UIButton, source); }
//---------------------------------------------------------------------------- void VertexFormat::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.Read(mNumAttributes); for (int i = 0; i < AM_MAX_ATTRIBUTES; ++i) { source.Read(mElements[i].StreamIndex); source.Read(mElements[i].Offset); source.ReadEnum(mElements[i].Type); source.ReadEnum(mElements[i].Usage); source.Read(mElements[i].UsageIndex); } source.Read(mStride); WM5_END_DEBUG_STREAM_LOAD(VertexFormat, source); }
//---------------------------------------------------------------------------- void DepthProperty::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadBool(Enabled); source.ReadBool(Writable); source.ReadEnum(Compare); PX2_END_DEBUG_STREAM_LOAD(DepthProperty, source); }
//---------------------------------------------------------------------------- void Buffer::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.Read(mNumElements); source.Read(mElementSize); source.ReadEnum(mUsage); source.ReadRR(mNumBytes, mData); WM5_END_DEBUG_STREAM_LOAD(Buffer, source); }
//---------------------------------------------------------------------------- void Texture::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadEnum(mFormat); source.ReadEnum(mType); source.ReadEnum(mUsage); source.Read(mNumLevels); source.Read(mNumDimensions); source.ReadVV(MM_MAX_MIPMAP_LEVELS, mDimension[0]); source.ReadVV(MM_MAX_MIPMAP_LEVELS, mDimension[1]); source.ReadVV(MM_MAX_MIPMAP_LEVELS, mDimension[2]); source.ReadVV(MM_MAX_MIPMAP_LEVELS, mNumLevelBytes); source.Read(mNumTotalBytes); source.ReadVV(MM_MAX_MIPMAP_LEVELS, mLevelOffsets); source.ReadVV(MAX_USER_FIELDS, mUserField); source.ReadVR(mNumTotalBytes, mData); WM5_END_DEBUG_STREAM_LOAD(Texture, source); }
//---------------------------------------------------------------------------- void Projector::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Camera::Load(source); PX2_VERSION_LOAD(source); source.ReadEnum(mDepthType); // 改变了mDepthType,需要重新计算相机投影矩阵。 OnFrustumChange(); PX2_END_DEBUG_STREAM_LOAD(Projector, source); }
//---------------------------------------------------------------------------- void UIGridFrame::Load(InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); UIFrame::Load(source); PX2_VERSION_LOAD(source); source.ReadBool(mIsBagFrameNeedUpdate); source.ReadEnum(mAlignItemType); source.ReadAggregate(mItemSize); source.ReadAggregate(mAlignItemNum); PX2_END_DEBUG_STREAM_LOAD(UIGridFrame, source); }
//---------------------------------------------------------------------------- void PushTransformController::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Controller::Load(source); PX2_VERSION_LOAD(source); source.ReadEnum(mTransType); source.Read(mMaxVelocity); source.Read(mFriction); source.ReadAggregate(mVelocity); PX2_END_DEBUG_STREAM_LOAD(PushTransformController, source); }
//---------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------------- void Projector::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Camera::Load(source); source.ReadEnum(mDepthType); // The Camera::Load sets mDepthType and updates the projection matrix, // which depends on the depth type. Because we have now changed the depth // type, we need to update the projection matrix again. OnFrustumChange(); WM5_END_DEBUG_STREAM_LOAD(Projector, source); }
//---------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------------- void Controller::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadEnum(Repeat); source.Read(MinTime); source.Read(MaxTime); source.Read(Phase); source.Read(Frequency); source.ReadBool(Active); source.ReadPointer(mObject); mApplicationTime = -Mathd::MAX_REAL; PX2_END_DEBUG_STREAM_LOAD(Controller, source); }
//---------------------------------------------------------------------------- void Movable::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Controlledable::Load(source); source.ReadAggregate(LocalTransform); source.ReadAggregate(WorldTransform); source.ReadBool(WorldTransformIsCurrent); source.ReadAggregate(WorldBound); source.ReadBool(WorldBoundIsCurrent); source.ReadEnum(Culling); // mParent不被保存,它会在Node::Link中调用Node::SetChild被设置。 PX2_END_DEBUG_STREAM_LOAD(Movable, source); }
//---------------------------------------------------------------------------- void Spatial::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); ControlledObject::Load(source); source.ReadAggregate(LocalTransform); source.ReadAggregate(WorldTransform); source.ReadBool(WorldTransformIsCurrent); source.ReadAggregate(WorldBound); source.ReadBool(WorldBoundIsCurrent); source.ReadEnum(Culling); // mParent was not saved. It will be set in Node::Link when the child // pointers of the Node are resolved by Node::SetChild. WM5_END_DEBUG_STREAM_LOAD(Spatial, source); }
//---------------------------------------------------------------------------- void RevolutionSurface::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); TriMesh::Load(source); source.Read(mXCenter); source.ReadEnum(mTopology); source.Read(mNumCurveSamples); source.Read(mNumRadialSamples); source.ReadVR(mNumRadialSamples + 1, mSin); source.ReadVR(mNumRadialSamples + 1, mCos); source.ReadBool(mSampleByArcLength); // TODO. See note in RevolutionSurface::Save. mCurve = 0; WM5_END_DEBUG_STREAM_LOAD(RevolutionSurface, source); }
//---------------------------------------------------------------------------- void TriggerActor::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Actor::Load(source); PX2_VERSION_LOAD(source); source.ReadBool(mEnable); source.ReadEnum(mAreaType); source.Read(mBox.Min[0]); source.Read(mBox.Min[1]); source.Read(mBox.Min[2]); source.Read(mBox.Max[0]); source.Read(mBox.Max[1]); source.Read(mBox.Max[2]); source.ReadAggregate<Vector3f>(mSphere.Center); source.Read(mSphere.Radius); PX2_END_DEBUG_STREAM_LOAD(TriggerActor, source); }