Exemplo n.º 1
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 2
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 3
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 4
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 5
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 8
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 9
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 10
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 11
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 12
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 13
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 15
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 16
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 17
0
    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;
    }
Exemplo n.º 18
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 19
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 20
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 21
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 22
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 23
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 24
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 26
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 27
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 28
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 29
0
//----------------------------------------------------------------------------
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);
}
Exemplo n.º 30
0
//----------------------------------------------------------------------------
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);
}