コード例 #1
0
//----------------------------------------------------------------------------
void KeyframeController::Load (InStream& source)
{
    WM5_BEGIN_DEBUG_STREAM_LOAD(source);

    TransformController::Load(source);

    source.Read(mNumCommonTimes);
    if (mNumCommonTimes > 0)
    {
        source.ReadVR(mNumCommonTimes, mCommonTimes);
        source.ReadAggregateRR(mNumTranslations, mTranslations);
        source.ReadAggregateRR(mNumRotations, mRotations);
        source.ReadRR(mNumScales, mScales);
    }
    else
    {
        source.ReadRR(mNumTranslations, mTranslationTimes);
        source.ReadAggregateVR(mNumTranslations, mTranslations);
        source.ReadRR(mNumRotations, mRotationTimes);
        source.ReadAggregateVR(mNumRotations, mRotations);
        source.ReadRR(mNumScales, mScaleTimes);
        source.ReadVR(mNumScales, mScales);
    }

    WM5_END_DEBUG_STREAM_LOAD(KeyframeController, source);
}
コード例 #2
0
ファイル: Wm5Shader.cpp プロジェクト: bhlzlx/WildMagic
//----------------------------------------------------------------------------
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);
}