//---------------------------------------------------------------------------- void CullState::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteBool(Enabled); target.WriteBool(CCWOrder); WM5_END_DEBUG_STREAM_SAVE(CullState, target); }
//---------------------------------------------------------------------------- void DepthProperty::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteBool(Enabled); target.WriteBool(Writable); target.WriteEnum(Compare); PX2_END_DEBUG_STREAM_SAVE(DepthProperty, target); }
//---------------------------------------------------------------------------- void DepthState::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteBool(Enabled); target.WriteBool(Writable); target.WriteEnum(Compare); WM5_END_DEBUG_STREAM_SAVE(DepthState, target); }
//---------------------------------------------------------------------------- void OffsetProperty::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteBool(FillEnabled); target.WriteBool(LineEnabled); target.WriteBool(PointEnabled); target.Write(Scale); target.Write(Bias); PX2_END_DEBUG_STREAM_SAVE(OffsetProperty, target); }
//---------------------------------------------------------------------------- void OffsetState::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteBool(FillEnabled); target.WriteBool(LineEnabled); target.WriteBool(PointEnabled); target.Write(Scale); target.Write(Bias); WM5_END_DEBUG_STREAM_SAVE(OffsetState, target); }
//---------------------------------------------------------------------------- void BlendTransformController::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); TransformController::Save(target); target.WritePointer(mController0); target.WritePointer(mController1); target.Write(mWeight); target.WriteBool(mRSMatrices); target.WriteBool(mGeometricRotation); target.WriteBool(mGeometricScale); WM5_END_DEBUG_STREAM_SAVE(BlendTransformController, target); }
//---------------------------------------------------------------------------- void Terrain::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Node::Save(target); target.Write(mNumRows); target.Write(mNumCols); target.Write(mSize); target.Write(mMinElevation); target.Write(mMaxElevation); target.Write(mSpacing); for (int row = 0; row < mNumRows; ++row) { for (int col = 0; col < mNumCols; ++col) { target.WritePointer(mPages[row][col]); } } target.WriteBool(mIsUseSimpleMtl); target.WritePointer(mVFormatEdit); target.WritePointer(mVFormatSimple); target.WritePointer(mMtlEdit); target.WritePointer(mMtlSimple); target.WritePointer(mShine); target.Write(mJunglerFrequency); target.Write(mJunglerStrength); PX2_END_DEBUG_STREAM_SAVE(Terrain, target); }
//---------------------------------------------------------------------------- void CurveMesh::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Polysegment::Save(target); PX2_VERSION_SAVE(target); target.Write(mNumFullVertices); target.Write(mNumSegments); target.Write(mLevel); target.WriteBool(mAllowDynamicChange); target.WritePointer(mOrigVBuffer); target.WritePointer(mOrigParams); target.WritePointerN(mNumSegments, mSegments); if (mCInfo) { for (int i = 0; i < mNumFullVertices; ++i) { target.WritePointer(mCInfo[i].Segment); target.Write(mCInfo[i].Param); } } PX2_END_DEBUG_STREAM_SAVE(CurveMesh, target); }
//---------------------------------------------------------------------------- void Object::Save(OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); // 写入Rtti 名称 target.WriteString(GetRttiType().GetName()); // 写入Rtti version target.Write(TYPE.GetVersion()); // 写入ID target.WriteUniqueID(this); //是否有效 target.WriteBool(mIsEnable); // 资源路径 target.WriteString(mResourcePath); // 写入对象名称 target.WriteString(mName); target.Write(mID); PX2_END_DEBUG_STREAM_SAVE(Object, target); }
//---------------------------------------------------------------------------- void Movable::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Controlledable::Save(target); target.WriteAggregate(LocalTransform); target.WriteAggregate(WorldTransform); target.WriteBool(WorldTransformIsCurrent); target.WriteAggregate(WorldBound); target.WriteBool(WorldBoundIsCurrent); target.WriteEnum(Culling); // mParent不被保存,它会在Node::Link中调用Node::SetChild被设置。 PX2_END_DEBUG_STREAM_SAVE(Movable, target); }
//---------------------------------------------------------------------------- void Actor::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Netable::Save(target); target.WriteAggregate(mScale); target.WriteAggregate(mRotation); target.WriteAggregate(mPosition); target.WriteBool(mVisible); target.Write(mTransAlpha); target.WritePointer(mMovable); target.WritePointer(mHelpMovable); target.WriteBool(mShowHelpMovable); PX2_END_DEBUG_STREAM_SAVE(Actor, target); }
//---------------------------------------------------------------------------- void Spatial::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); ControlledObject::Save(target); target.WriteAggregate(LocalTransform); target.WriteAggregate(WorldTransform); target.WriteBool(WorldTransformIsCurrent); target.WriteAggregate(WorldBound); target.WriteBool(WorldBoundIsCurrent); target.WriteEnum(Culling); // mParent is not saved. On load, it will be set in Node::Link when the // child pointers of the Node are resolved by Node::SetChild. WM5_END_DEBUG_STREAM_SAVE(Spatial, target); }
//---------------------------------------------------------------------------- void LODTerrain::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Terrain::Save(target); target.Write(mPixelTolerance); target.WriteBool(mIsCloseAssumption); PX2_END_DEBUG_STREAM_SAVE(LODTerrain, target); }
//---------------------------------------------------------------------------- void InterpCurveTranslateController::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); InterpCurveFloat3Controller::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mIsWorld); PX2_END_DEBUG_STREAM_SAVE(InterpCurveTranslateController, target); }
//---------------------------------------------------------------------------- void ShaderFloat::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteW(mNumElements, mData); target.WriteBool(mAllowUpdater); WM5_END_DEBUG_STREAM_SAVE(ShaderFloat, target); }
//---------------------------------------------------------------------------- void RenderTarget::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); PX2_VERSION_SAVE(target); target.Write(mNumTargets); target.Write(mWidth); target.Write(mHeight); target.Write(mHasMipmaps); target.WriteBool(mHasDepthStencil); target.WriteBool(mIsOnlyDepth16NoStencil); target.WritePointerN(mNumTargets, mColorTextures); target.WritePointer(mDepthStencilTexture); target.WriteBool(mHasMipmaps); PX2_END_DEBUG_STREAM_SAVE(RenderTarget, target); }
//---------------------------------------------------------------------------- void Polysegment::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Visual::Save(target); target.Write(mNumSegments); target.WriteBool(mContiguous); WM5_END_DEBUG_STREAM_SAVE(Polysegment, target); }
//---------------------------------------------------------------------------- void LightConstant::Save(OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); ShaderFloat::Save(target); PX2_VERSION_SAVE(target); target.WritePointer(mLight); target.WriteBool(mIsDefualtDir); PX2_END_DEBUG_STREAM_SAVE(LightConstant, target); }
//---------------------------------------------------------------------------- void RenderTarget::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WritePointerW(mNumTargets, mColorTextures); target.WritePointer(mDepthStencilTexture); target.WriteBool(mHasMipmaps); WM5_END_DEBUG_STREAM_SAVE(RenderTarget, target); }
//---------------------------------------------------------------------------- void ProjectorMatrixConstant::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); ShaderFloat::Save(target); PX2_VERSION_SAVE(target); target.WritePointer(mProjector); target.WriteBool(mBiased); PX2_END_DEBUG_STREAM_SAVE(ProjectorMatrixConstant, target); }
//---------------------------------------------------------------------------- void TerrainActor::Save(OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Actor::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mIsUseLOD); target.WritePointer(mRawTerrain); target.WritePointer(mLODTerrain); PX2_END_DEBUG_STREAM_SAVE(TerrainActor, target); }
//---------------------------------------------------------------------------- void SurfacePatch::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.Write(mUMin); target.Write(mUMax); target.Write(mVMin); target.Write(mVMax); target.WriteBool(mRectangular); WM5_END_DEBUG_STREAM_SAVE(SurfacePatch, target); }
//---------------------------------------------------------------------------- void UIInputText::Save(OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); UIText::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mIsPassword); target.WriteString(mRealText); target.Write(mFixedWidth); PX2_END_DEBUG_STREAM_SAVE(UIInputText, target); }
//---------------------------------------------------------------------------- void UIGridFrame::Save(OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); UIFrame::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mIsBagFrameNeedUpdate); target.WriteEnum(mAlignItemType); target.WriteAggregate(mItemSize); target.WriteAggregate(mAlignItemNum); PX2_END_DEBUG_STREAM_SAVE(UIGridFrame, target); }
//---------------------------------------------------------------------------- void Controller::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteEnum(Repeat); target.Write(MinTime); target.Write(MaxTime); target.Write(Phase); target.Write(Frequency); target.WriteBool(Active); target.WritePointer(mObject); WM5_END_DEBUG_STREAM_SAVE(Controller, target); }
//---------------------------------------------------------------------------- void StencilState::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteBool(Enabled); target.WriteEnum(Compare); target.Write(Reference); target.Write(Mask); target.Write(WriteMask); target.WriteEnum(OnFail); target.WriteEnum(OnZFail); target.WriteEnum(OnZPass); WM5_END_DEBUG_STREAM_SAVE(StencilState, target); }
//---------------------------------------------------------------------------- void Portal::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteW(mNumVertices, mModelVertices); target.WriteAggregate(mModelPlane); target.WriteBool(Open); target.WritePointer(AdjacentRegion); // World vertices are computed form model vertices in the update call, // so no need to save them. The world plane is also computed in the // update call, so no need to save it. WM5_END_DEBUG_STREAM_SAVE(Portal, target); }
//---------------------------------------------------------------------------- void TriggerActor::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Actor::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mEnable); target.WriteEnum(mAreaType); target.Write(mBox.Min[0]); target.Write(mBox.Min[1]); target.Write(mBox.Min[2]); target.Write(mBox.Max[0]); target.Write(mBox.Max[1]); target.Write(mBox.Max[2]); target.WriteAggregate<Vector3f>(mSphere.Center); target.Write(mSphere.Radius); PX2_END_DEBUG_STREAM_SAVE(TriggerActor, target); }
//---------------------------------------------------------------------------- void MaterialInstance::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mIsShareMtl); target.WriteString(mMaterialFilename); target.WriteString(mInstanceTechName); target.WritePointer(mMaterial); target.Write(mTechniqueIndex); target.WritePointerW(mNumPasses, mVertexParameters); target.WritePointerN(mNumPasses, mPixelParameters); PX2_END_DEBUG_STREAM_SAVE(MaterialInstance, target); }
//---------------------------------------------------------------------------- void Shader::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteStringW(mNumInputs, mInputName); target.WriteEnumN(mNumInputs, mInputType); target.WriteEnumN(mNumInputs, mInputSemantic); target.WriteStringW(mNumOutputs, mOutputName); target.WriteEnumN(mNumOutputs, mOutputType); target.WriteEnumN(mNumOutputs, mOutputSemantic); target.WriteStringW(mNumConstants, mConstantName); target.WriteN(mNumConstants, mNumRegistersUsed); target.WriteStringW(mNumSamplers, mSamplerName); target.WriteEnumN(mNumSamplers, mSamplerType); target.WriteEnumN(mNumSamplers, mFilter); target.WriteEnumN(mNumSamplers, mCoordinate[0]); target.WriteEnumN(mNumSamplers, mCoordinate[1]); target.WriteEnumN(mNumSamplers, mCoordinate[2]); target.WriteN(mNumSamplers, mLodBias); target.WriteN(mNumSamplers, mAnisotropy); target.WriteAggregateN(mNumSamplers, mBorderColor); // On load, test this against MAX_PROFILES just in case a user increases // MAX_PROFILES and tries to load old data sets. target.Write((int)MAX_PROFILES); target.WriteBool(mProfileOwner); if (mProfileOwner) { for (int i = 0; i < MAX_PROFILES; ++i) { target.WriteN(mNumConstants, mBaseRegister[i]); target.WriteN(mNumSamplers, mTextureUnit[i]); target.WriteString(*mProgram[i]); } } WM5_END_DEBUG_STREAM_SAVE(Shader, target); }