//---------------------------------------------------------------------------- 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 RawTerrainPage::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); TriMesh::Save(target); target.Write(mSize); int numVertices = mSize*mSize; target.WriteN(numVertices, mHeights); target.WriteAggregate(mOrigin); target.Write(mSpacing); target.WritePointer(mMaterialInstance); target.WritePointer(mTextureDefault); target.WritePointer(mTexture0); target.WritePointer(mTextureAlpha); target.WritePointer(mTexture1); target.WritePointer(mTexture2); target.WritePointer(mTexture3); target.WritePointer(mTexture4); target.WriteAggregate(mUV01); target.WriteAggregate(mUV23); target.WriteAggregate(mUV4); target.WritePointer(mUV01Float); target.WritePointer(mUV23Float); target.WritePointer(mUV4Float); PX2_END_DEBUG_STREAM_SAVE(RawTerrainPage, target); }
//---------------------------------------------------------------------------- void RawTerrain::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Node::Save(target); target.WriteEnum(mMode); target.Write(mNumRows); target.Write(mNumCols); target.Write(mSize); target.Write(mMinElevation); target.Write(mMaxElevation); target.Write(mSpacing); target.Write(mCameraRow); target.Write(mCameraCol); target.WritePointer(mVFormat); target.WritePointer(mCamera); target.WritePointer(mShine); for (int row = 0; row < mNumRows; ++row) { for (int col = 0; col < mNumCols; ++col) { target.WritePointer(mPages[row][col]); } } PX2_END_DEBUG_STREAM_SAVE(RawTerrain, 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 BspNode::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Node::Save(target); target.Write(ModelPlane); target.Write(mWorldPlane); WM5_END_DEBUG_STREAM_SAVE(BspNode, target); }
//---------------------------------------------------------------------------- void UISizeExtendControl::Save(OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Controller::Save(target); PX2_VERSION_SAVE(target); target.Write(mWidthOverHeightPercent); target.Write(mOriginHeight); PX2_END_DEBUG_STREAM_SAVE(Controller, target); }
//---------------------------------------------------------------------------- void GroupBuf::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Buf::Save(target); PX2_VERSION_SAVE(target); target.Write(mToGroupCharacterID); target.Write(mBeforeGroup); PX2_END_DEBUG_STREAM_SAVE(GroupBuf, target); }
//---------------------------------------------------------------------------- void SimpleSegment::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); CurveSegment::Save(target); target.Write(mAmplitude); target.Write(mFrequency); target.Write(mHeight); WM5_END_DEBUG_STREAM_SAVE(CurveSegment, target); }
//---------------------------------------------------------------------------- void Particles::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); TriMesh::Save(target); target.WriteW(mNumParticles, mPositionSizes); target.Write(mSizeAdjust); target.Write(mNumActive); WM5_END_DEBUG_STREAM_SAVE(Particles, target); }
//---------------------------------------------------------------------------- void ClodMesh::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); TriMesh::Save(target); PX2_VERSION_SAVE(target); target.Write(mCurrentRecord); target.Write(mTargetRecord); target.WritePointer(mRecordArray); PX2_END_DEBUG_STREAM_SAVE(ClodMesh, 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 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 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 PushTransformController::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Controller::Save(target); PX2_VERSION_SAVE(target); target.WriteEnum(mTransType); target.Write(mMaxVelocity); target.Write(mFriction); target.WriteAggregate(mVelocity); PX2_END_DEBUG_STREAM_SAVE(PushTransformController, 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 KeyframeController::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); TransformController::Save(target); target.Write(mNumCommonTimes); if (mNumCommonTimes > 0) { target.WriteN(mNumCommonTimes, mCommonTimes); target.WriteAggregateW(mNumTranslations, mTranslations); target.WriteAggregateW(mNumRotations, mRotations); target.WriteW(mNumScales, mScales); } else { target.WriteW(mNumTranslations, mTranslationTimes); target.WriteAggregateN(mNumTranslations, mTranslations); target.WriteW(mNumRotations, mRotationTimes); target.WriteAggregateN(mNumRotations, mRotations); target.WriteW(mNumScales, mScaleTimes); target.WriteN(mNumScales, mScales); } WM5_END_DEBUG_STREAM_SAVE(KeyframeController, target); }
EpadResult ExtractFromWad(RandomInStream &in, OutStream &out, std::string &key_file) { WadMetadata metadata; auto result = ExtractWadMetadata(in, in.GetCount(), metadata); in.Seek(metadata.payload_offset); if(result != EpadResult::Success) return result; Botan::SecureVector<byte> buffer; buffer.resize(metadata.payload_size != 0 ? metadata.payload_size : in.GetCount()); in.Read(buffer.data(), buffer.size()); out.Write(buffer.data(), buffer.size()); key_file.clear(); if(metadata.key_file_offset != kInvalid) { key_file.resize(metadata.key_file_size); in.Seek(metadata.key_file_offset); in.Read(reinterpret_cast<byte *>(&*key_file.begin()), metadata.key_file_size); } return EpadResult::Success; }
//---------------------------------------------------------------------------- void Scene::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Netable::Save(target); target.Write<int>(mSceneID); target.WritePointer(mSceneNode); const int numActors = (int)mActors.size(); target.Write(numActors); for (int i=0; i<numActors; ++i) { if (mActors[i]) { target.WritePointer(mActors[i]); } else { target.WritePointer((Actor*)0); } } target.WritePointer(mTerrainActor); target.WritePointer(mDefaultLight); target.WritePointer(mDefaultCameraActor); target.WritePointer(mDefaultARActor); PX2_END_DEBUG_STREAM_SAVE(Scene, target); }
//---------------------------------------------------------------------------- void SkinController::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Controller::Save(target); target.Write(mNumVertices); target.Write(mNumBones); int numWeightsOffsets = mNumVertices*mNumBones; target.WriteN(numWeightsOffsets, mWeights[0]); target.WriteAggregateN(numWeightsOffsets, mOffsets[0]); target.WritePointerN(mNumBones, mBones); PX2_END_DEBUG_STREAM_SAVE(SkinController, 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 IndexBuffer::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Buffer::Save(target); target.Write(mOffset); PX2_END_DEBUG_STREAM_SAVE(IndexBuffer, target); }
//---------------------------------------------------------------------------- void Polypoint::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Visual::Save(target); target.Write(mNumPoints); WM5_END_DEBUG_STREAM_SAVE(Polypoint, target); }
//---------------------------------------------------------------------------- void SwitchNode::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Node::Save(target); target.Write(mActiveChild); WM5_END_DEBUG_STREAM_SAVE(SwitchNode, target); }
//---------------------------------------------------------------------------- void CurveSegment::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.Write(mUMin); target.Write(mUMax); WM5_END_DEBUG_STREAM_SAVE(CurveSegment, target); }
//---------------------------------------------------------------------------- void Polypoint::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Renderable::Save(target); PX2_VERSION_SAVE(target); target.Write(mNumPoints); PX2_END_DEBUG_STREAM_SAVE(Polypoint, 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 MorphController::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); Controller::Save(target); target.Write(mNumVertices); target.Write(mNumTargets); target.Write(mNumKeys); int numTotalVertices = mNumVertices*mNumTargets; target.WriteAggregateN(numTotalVertices, mVertices[0]); target.WriteN(mNumKeys, mTimes); int numTotalWeights = mNumKeys*(mNumTargets - 1); target.WriteN(numTotalWeights, mWeights[0]); WM5_END_DEBUG_STREAM_SAVE(MorphController, 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 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 ParticleEvent_Alpha::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); EffectEvent::Save(target); target.Write(mAlpha.Value0); target.Write(mAlpha.Value1); PX2_END_DEBUG_STREAM_SAVE(ParticleEvent_Alpha, target); }