//----------------------------------------------------------------------------
void RawTerrainPage::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	TerrainPage::Save(target);
	PX2_VERSION_SAVE(target);

	target.WritePointer(mMtlInst);

	target.WriteString(mTextureDefaultFilename);
	target.WriteString(mTexture0Filename);

	target.WritePointer(mTextureAlpha);

	target.WriteString(mTexture1Filename);
	target.WriteString(mTexture2Filename);
	target.WriteString(mTexture3Filename);
	target.WriteString(mTexture4Filename);

	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 UIButtonBase::Save(OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	UIFrame::Save(target);
	PX2_VERSION_SAVE(target);

	target.WriteEnum(mButType);

	target.WriteAggregate(mNormalColor);
	target.WriteAggregate(mHoveredColor);
	target.WriteAggregate(mPressedColor);
	target.WriteAggregate(mDisableColor);
	target.Write(mNormalAlpha);
	target.Write(mHoveredAlpha);
	target.Write(mPressedAlpha);
	target.Write(mDisableAlpha);
	target.Write(mNormalBrightness);
	target.Write(mHoveredBrightness);
	target.Write(mPressedBrightness);
	target.Write(mDisableBrightness);

	target.WritePointer(mPicBoxNormal);
	target.WritePointer(mPicBoxOver);
	target.WritePointer(mPicBoxDown);
	target.WritePointer(mPicBoxDisabled);
	target.WriteEnum(mButtonState);

	PX2_END_DEBUG_STREAM_SAVE(UIButtonBase, target);
}
Beispiel #3
0
//----------------------------------------------------------------------------
void Light::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	Object::Save(target);

	target.WriteEnum(mType);
	target.WriteAggregate(Ambient);
	target.WriteAggregate(Diffuse);
	target.WriteAggregate(Specular);
	target.Write(Constant);
	target.Write(Linear);
	target.Write(Quadratic);
	target.Write(Intensity);
	target.Write(Angle);
	target.Write(CosAngle);
	target.Write(SinAngle);
	target.Write(Exponent);
	target.WriteAggregate(Position);
	target.WriteAggregate(DVector);
	target.WriteAggregate(UVector);
	target.WriteAggregate(RVector);

	PX2_END_DEBUG_STREAM_SAVE(Light, 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);
}
Beispiel #5
0
//----------------------------------------------------------------------------
void Shine::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	Object::Save(target);

	target.WriteAggregate(Emissive);
	target.WriteAggregate(Ambient);
	target.WriteAggregate(Diffuse);
	target.WriteAggregate(Specular);

	PX2_END_DEBUG_STREAM_SAVE(Shine, 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);
}
Beispiel #7
0
//----------------------------------------------------------------------------
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);
}
Beispiel #8
0
//----------------------------------------------------------------------------
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);
}
Beispiel #9
0
//----------------------------------------------------------------------------
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 InputPushTransformController::Save(OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	PushTransformController::Save(target);
	PX2_VERSION_SAVE(target);

	target.WriteAggregate(mLockDir);
	target.Write(mPushTriggerSpeed);

	PX2_END_DEBUG_STREAM_SAVE(InputPushTransformController, target);
}
//----------------------------------------------------------------------------
void InterpCurveSpeedController::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	InterpCurveFloat3Controller::Save(target);
	PX2_VERSION_SAVE(target);

	target.Write(mMaxLength);
	target.WriteAggregate(mInitPos);

	PX2_END_DEBUG_STREAM_SAVE(InterpCurveSpeedController, target);
}
//----------------------------------------------------------------------------
void UIAnimPicBox::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	UIPicBox::Save(target);

	target.WritePointer(mAPBCtrl);
	target.WriteString(mFrameTexPack);
	target.Write(mIntervalTime);
	int numAnim = (int)mElements.size();
	target.Write(numAnim);
	for (int i=0; i<numAnim; i++)
	{
		target.Write(mElements[i].Index);
		target.WriteAggregate(mElements[i].UV0);
		target.WriteAggregate(mElements[i].UV1);
		target.WriteAggregate(mElements[i].UV2);
		target.WriteAggregate(mElements[i].UV3);
		target.WritePointer(mElements[i].Tex);
	}

	PX2_END_DEBUG_STREAM_SAVE(UIAnimPicBox, 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);
}
Beispiel #14
0
//----------------------------------------------------------------------------
void Renderable::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	Movable::Save(target);

	target.WriteEnum(mType);
	target.WriteAggregate(mModelBound);
	target.WritePointer(mVFormat);
	target.WritePointer(mVBuffer);
	target.WritePointer(mIBuffer);
	target.WritePointer(mMaterial);

	PX2_END_DEBUG_STREAM_SAVE(Renderable, target);
}
Beispiel #15
0
//----------------------------------------------------------------------------
void Visual::Save (OutStream& target) const
{
    WM5_BEGIN_DEBUG_STREAM_SAVE(target);

    Spatial::Save(target);

    target.WriteEnum(mType);
    target.WriteAggregate(mModelBound);
    target.WritePointer(mVFormat);
    target.WritePointer(mVBuffer);
    target.WritePointer(mIBuffer);
    target.WritePointer(mEffect);

    WM5_END_DEBUG_STREAM_SAVE(Visual, target);
}
Beispiel #16
0
//----------------------------------------------------------------------------
void DlodNode::Save (OutStream& target) const
{
    PX2_BEGIN_DEBUG_STREAM_SAVE(target);

    SwitchNode::Save(target);

    target.WriteAggregate(mModelLodCenter);
    target.WriteW(mNumLevelsOfDetail, mModelMinDist);
    target.WriteN(mNumLevelsOfDetail, mModelMaxDist);
    target.WriteN(mNumLevelsOfDetail, mWorldMinDist);
    target.WriteN(mNumLevelsOfDetail, mWorldMaxDist);

	// 模型世界中心为实时计算,不需要存储。

    PX2_END_DEBUG_STREAM_SAVE(DlodNode, target);
}
Beispiel #17
0
//----------------------------------------------------------------------------
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 TerrainPage::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	TriMesh::Save(target);
	PX2_VERSION_SAVE(target);

	target.Write(mSize);
	int numVertices = mSize*mSize;
	target.WriteN(numVertices, mHeights);
	target.WriteAggregate(mOrigin);
	target.Write(mSpacing);

	int numJunglers = (int)mJunglers.size();
	target.Write(numJunglers);
	for (int i=0; i<numJunglers; i++)
	{
		target.WritePointer(mJunglers[i]);
	}

	PX2_END_DEBUG_STREAM_SAVE(TerrainPage, target);
}
//----------------------------------------------------------------------------
void BoxSurface::Save (OutStream& target) const
{
	PX2_BEGIN_DEBUG_STREAM_SAVE(target);

	Node::Save(target);
	PX2_VERSION_SAVE(target);

	int numUCtrlPoints = mVolume->GetNumCtrlPoints(0);
	int numVCtrlPoints = mVolume->GetNumCtrlPoints(1);
	int numWCtrlPoints = mVolume->GetNumCtrlPoints(2);
	int uDegree = mVolume->GetDegree(0);
	int vDegree = mVolume->GetDegree(1);
	int wDegree = mVolume->GetDegree(2);
	target.Write(numUCtrlPoints);
	target.Write(numVCtrlPoints);
	target.Write(numWCtrlPoints);
	target.Write(uDegree);
	target.Write(vDegree);
	target.Write(wDegree);
	for (int u = 0; u < numUCtrlPoints; ++u)
	{
		for (int v = 0; v < numVCtrlPoints; ++v)
		{
			for (int w = 0; w < numWCtrlPoints; ++w)
			{
				Vector3f ctrl = mVolume->GetControlPoint(u, v, w);
				target.WriteAggregate(ctrl);
			}
		}
	}

	target.Write(mNumUSamples);
	target.Write(mNumVSamples);
	target.Write(mNumWSamples);
	target.WriteBool(mDoSort);

	PX2_END_DEBUG_STREAM_SAVE(BoxSurface, target);
}