//---------------------------------------------------------------------------- void EffectBuf::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Buf::Load(source); PX2_VERSION_LOAD(source); source.ReadString(mEffectFilename); source.ReadString(mAnchor); source.ReadPointer(mEffect); PX2_END_DEBUG_STREAM_LOAD(EffectBuf, source); }
//---------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------------- void UIAnimPicBox::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); UIPicBox::Load(source); source.ReadPointer(mAPBCtrl); source.ReadString(mFrameTexPack); source.Read(mIntervalTime); int numAnim = 0; source.Read(numAnim); mElements.resize(numAnim); for (int i=0; i<numAnim; i++) { source.Read(mElements[i].Index); source.ReadAggregate(mElements[i].UV0); source.ReadAggregate(mElements[i].UV1); source.ReadAggregate(mElements[i].UV2); source.ReadAggregate(mElements[i].UV3); source.ReadPointer(mElements[i].Tex); } PX2_END_DEBUG_STREAM_LOAD(UIAnimPicBox, source); }
//---------------------------------------------------------------------------- void Object::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); // RTTI名称已经被读取了 // 读取ID,提供对象的链接信息 source.ReadUniqueID(this); // 资源路径 source.ReadString(mResourcePath); // 读取对象的名称 source.ReadString(mName); PX2_END_DEBUG_STREAM_LOAD(Object, source); }
//---------------------------------------------------------------------------- void UIFrame::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Node::Load(source); source.ReadString(mScriptHandler); PX2_END_DEBUG_STREAM_LOAD(UIFrame, source); }
//---------------------------------------------------------------------------- void Shader::Load (InStream& source) { WM5_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); source.ReadStringRR(mNumInputs, mInputName); source.ReadEnumVR(mNumInputs, mInputType); source.ReadEnumVR(mNumInputs, mInputSemantic); source.ReadStringRR(mNumOutputs, mOutputName); source.ReadEnumVR(mNumOutputs, mOutputType); source.ReadEnumVR(mNumOutputs, mOutputSemantic); source.ReadStringRR(mNumConstants, mConstantName); source.ReadVR(mNumConstants, mNumRegistersUsed); source.ReadStringRR(mNumSamplers, mSamplerName); source.ReadEnumVR(mNumSamplers, mSamplerType); source.ReadEnumVR(mNumSamplers, mFilter); source.ReadEnumVR(mNumSamplers, mCoordinate[0]); source.ReadEnumVR(mNumSamplers, mCoordinate[1]); source.ReadEnumVR(mNumSamplers, mCoordinate[2]); source.ReadVR(mNumSamplers, mLodBias); source.ReadVR(mNumSamplers, mAnisotropy); source.ReadAggregateVR(mNumSamplers, mBorderColor); // Test for modified MAX_PROFILES. int maxProfiles; source.Read(maxProfiles); #ifdef WM5_ASSERT_ON_CHANGED_MAX_PROFILES assertion(maxProfiles == MAX_PROFILES, "You changed MAX_PROFILES and are loading an old data set.\n"); #endif source.ReadBool(mProfileOwner); if (mProfileOwner) { int i; for (i = 0; i < maxProfiles; ++i) { source.ReadVR(mNumConstants, mBaseRegister[i]); source.ReadVR(mNumSamplers, mTextureUnit[i]); mProgram[i] = new0 std::string(); source.ReadString(*mProgram[i]); } for (i = maxProfiles; i < MAX_PROFILES; ++i) { mBaseRegister[i] = 0; mTextureUnit[i] = 0; mProgram[i] = 0; } } WM5_END_DEBUG_STREAM_LOAD(Shader, source); }
//---------------------------------------------------------------------------- void Object::Load(InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); // Rtti 名称已经被读取了 // Rtti version source.Read(mReadedVersion); // 读取ID,提供对象的链接信息 source.ReadUniqueID(this); source.ReadBool(mIsEnable); // 资源路径 source.ReadString(mResourcePath); // 读取对象的名称 source.ReadString(mName); source.Read(mID); PX2_END_DEBUG_STREAM_LOAD(Object, source); }
//---------------------------------------------------------------------------- void UIInputText::Load(InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); UIText::Load(source); PX2_VERSION_LOAD(source); source.ReadBool(mIsPassword); source.ReadString(mRealText); int readedVersion = GetReadedVersion(); if (1 <= readedVersion) { source.Read(mFixedWidth); } PX2_END_DEBUG_STREAM_LOAD(UIInputText, source); }
//---------------------------------------------------------------------------- void MaterialInstance::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); Object::Load(source); PX2_VERSION_LOAD(source); source.ReadBool(mIsShareMtl); source.ReadString(mMaterialFilename); source.ReadString(mInstanceTechName); source.ReadPointer(mMaterial); source.Read(mTechniqueIndex); source.ReadPointerRR(mNumPasses, mVertexParameters); source.ReadPointerVR(mNumPasses, mPixelParameters); PX2_END_DEBUG_STREAM_LOAD(MaterialInstance, source); }
//---------------------------------------------------------------------------- void RawTerrainPage::Load (InStream& source) { PX2_BEGIN_DEBUG_STREAM_LOAD(source); TerrainPage::Load(source); PX2_VERSION_LOAD(source); int readedVersion = GetReadedVersion(); if (0 == readedVersion) { source.ReadPointer(mMtlInst); source.ReadPointer(mTextureDefault); mTextureDefaultFilename = mTextureDefault->GetResourcePath(); source.ReadPointer(mTexture0); mTexture0Filename = mTexture0->GetResourcePath(); source.ReadPointer(mTextureAlphaVersion0); source.ReadPointer(mTexture1); mTexture1Filename = mTexture1->GetResourcePath(); source.ReadPointer(mTexture2); mTexture2Filename = mTexture2->GetResourcePath(); source.ReadPointer(mTexture3); mTexture3Filename = mTexture3->GetResourcePath(); source.ReadPointer(mTexture4); mTexture4Filename = mTexture4->GetResourcePath(); source.ReadAggregate(mUV01); source.ReadAggregate(mUV23); source.ReadAggregate(mUV4); source.ReadPointer(mUV01Float); source.ReadPointer(mUV23Float); source.ReadPointer(mUV4Float); } else if (1 == readedVersion) { source.ReadPointer(mMtlInst); source.ReadString(mTextureDefaultFilename); source.ReadString(mTexture0Filename); source.ReadPointer(mTextureAlpha); source.ReadString(mTexture1Filename); source.ReadString(mTexture2Filename); source.ReadString(mTexture3Filename); source.ReadString(mTexture4Filename); source.ReadAggregate(mUV01); source.ReadAggregate(mUV23); source.ReadAggregate(mUV4); source.ReadPointer(mUV01Float); source.ReadPointer(mUV23Float); source.ReadPointer(mUV4Float); } PX2_END_DEBUG_STREAM_LOAD(RawTerrainPage, source); }