bool CSpritePropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CSpriteProp* pEffectUnitProp = (CSpriteProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_BirthTime, sizeof(int) ); tData.SafeRead(&pEffectUnitProp->m_DeleteTime, sizeof(int) ); tData.SafeRead(&pEffectUnitProp->m_eTextOp, sizeof(SPR_BLENDOP) ); LoadMapValueSafe( tData, pEffectUnitProp->m_UVRCenter ); LoadMapValueSafe( tData, pEffectUnitProp->m_XYZcale ); tData.SafeRead(&pEffectUnitProp->m_fStartAngle, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fWidthRatio, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fZBias, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_vecRotate, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_vecNormal, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_fMinSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_eFaceType, sizeof(SPR_FACE) ); tData.SafeRead(&pEffectUnitProp->m_eBlendModel, sizeof(SPR_BLENDMODE) ); tData.SafeRead(&pEffectUnitProp->m_eZTest, sizeof(Z_TEST) ); tData.SafeRead(&pEffectUnitProp->m_bLightEnable, sizeof(BOOL) ); pEffectUnitProp->CaculateProp(); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CLightningPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CLightningProp* pEffectUnitProp = (CLightningProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_vecRotate, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_vecNormal, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_fStartAngle, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fWidthRatio, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMinSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_vecSrc, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_fDitherMax, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fDitherMin, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_nSubNum, sizeof(int) ); tData.SafeRead(&pEffectUnitProp->m_eFaceType, sizeof(SPR_FACE) ); tData.SafeRead(&pEffectUnitProp->m_eBlendModel, sizeof(SPR_BLENDMODE) ); tData.SafeRead(&pEffectUnitProp->m_eZTest, sizeof(Z_TEST) ); tData.SafeRead(&pEffectUnitProp->m_bLightEnable, sizeof(BOOL) ); tData.SafeRead(&pEffectUnitProp->m_fZBias, sizeof(float) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CModelRenderStylePropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CModelRenderStyleProp* pEffectUnitProp = (CModelRenderStyleProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); LoadMapValueSafe(tData, pEffectUnitProp->m_ClipDistMap); tData.SafeRead(&pEffectUnitProp->m_ClipPlane.originPlane, sizeof(CPlane)); pEffectUnitProp->CaculateProp(); int32 n = 0; tData.SafeRead( (char*)&n, sizeof(int32) ); pEffectUnitProp->m_ApplyClass.resize(n); for( int32 i = 0; i < n; ++i ) LoadStringSafeT( tData, pEffectUnitProp->m_ApplyClass[i] ); tData.SafeRead(&pEffectUnitProp->m_SpecularColor, sizeof(CColor) ); tData.SafeRead(&pEffectUnitProp->m_vecTextMoveVel, sizeof(CVector2f) ); tData.SafeRead(&pEffectUnitProp->m_fTextAngularVel, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_bDiffuseAmbient, sizeof(BOOL) ); tData.SafeRead(&pEffectUnitProp->m_bSpecular, sizeof(BOOL) ); tData.SafeRead(&pEffectUnitProp->m_bSetTextureMatrix, sizeof(BOOL) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CPolyTrailPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CPolyTrailProp* pEffectUnitProp = (CPolyTrailProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_eTextOp, sizeof(SPR_BLENDOP)); tData.SafeRead(&pEffectUnitProp->m_fRefractIndex, sizeof(float)); tData.SafeRead(&pEffectUnitProp->m_DeclTime, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_Smooth, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_sRefSkelatal, sizeof(IDNAME) ); tData.SafeRead(&pEffectUnitProp->m_bSingleSide, sizeof(BOOL) ); tData.SafeRead(&pEffectUnitProp->m_eStrip, sizeof(POLY_TRAIL_TYPE) ); tData.SafeRead(&pEffectUnitProp->m_vecRotate, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_MinTrailWidth, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_MaxTrailWidth, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_UnitLifeSpan, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_eBlendModel, sizeof(SPR_BLENDMODE) ); tData.SafeRead(&pEffectUnitProp->m_eZTest, sizeof(Z_TEST) ); tData.SafeRead(&pEffectUnitProp->m_bLightEnable, sizeof(BOOL) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CLeadingPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CLeadingProp* pEffectUnitProp = (CLeadingProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead( (char*)&pEffectUnitProp->m_eTextOp, sizeof(SPR_BLENDOP) ); tData.SafeRead( (char*)&pEffectUnitProp->m_JumpSpeed, sizeof(int32) ); tData.SafeRead( (char*)&pEffectUnitProp->m_JumpNum, sizeof(int32) ); tData.SafeRead( (char*)&pEffectUnitProp->m_eLType, sizeof(CLeadingProp::eLP_LKType) ); tData.SafeRead( (char*)&pEffectUnitProp->m_eSSType, sizeof(CLeadingProp::eLP_StartScr) ); tData.SafeRead( (char*)&pEffectUnitProp->m_fStartAngle, sizeof(float) ); tData.SafeRead( (char*)&pEffectUnitProp->m_fRotSpeed, sizeof(float) ); tData.SafeRead( (char*)&pEffectUnitProp->m_fUVSpeed, sizeof(float) ); tData.SafeRead( (char*)&pEffectUnitProp->m_nPieceCount, sizeof(uint32) ); tData.SafeRead( (char*)&pEffectUnitProp->m_nDouCount, sizeof(uint32) ); tData.SafeRead( (char*)&pEffectUnitProp->m_fDouPercent, sizeof(float) ); tData.SafeRead( (char*)&pEffectUnitProp->m_fDouInterval, sizeof(float) ); tData.SafeRead( (char*)&pEffectUnitProp->m_eBlendModel, sizeof(SPR_BLENDMODE) ); tData.SafeRead( (char*)&pEffectUnitProp->m_eZTest, sizeof(Z_TEST) ); tData.SafeRead( (char*)&pEffectUnitProp->m_bLightEnable, sizeof(BOOL) ); tData.SafeRead( (char*)&pEffectUnitProp->m_fZBias, sizeof(float) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CModelConsolePropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CModelConsoleProp* pEffectUnitProp = (CModelConsoleProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); LoadStringSafeT( tData, pEffectUnitProp->m_SkeName ); tData.SafeRead(&pEffectUnitProp->m_BirthTime, sizeof(int) ); tData.SafeRead(&pEffectUnitProp->m_DeleteTime, sizeof(int) ); LoadMapValueSafe(tData, pEffectUnitProp->m_ClipDistMap); tData.SafeRead(&pEffectUnitProp->m_bEnableShadow, sizeof(bool) ); if (pEffectUnitProp->m_ClipPlane.originPlane.IsValid() && pEffectUnitProp->m_ClipDistMap.empty()) { pEffectUnitProp->m_ClipDistMap[0.0f] = -pEffectUnitProp->m_ClipPlane.originPlane.m_Dist; pEffectUnitProp->m_ClipDistMap[1.0f] = -pEffectUnitProp->m_ClipPlane.originPlane.m_Dist; } LoadMapValue(tData, pEffectUnitProp->m_mapRefract); tData.SafeRead(&pEffectUnitProp->m_ClipPlane.originPlane, sizeof(CPlane)); LoadMapValue( tData, pEffectUnitProp->m_XYZcale ); tData.SafeRead(&pEffectUnitProp->m_eFaceType, sizeof(SPR_FACE) ); LoadStringSafeT( tData, pEffectUnitProp->m_szParentSk ); tData.SafeRead(&pEffectUnitProp->m_nSkIdx, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_fMinYSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxYSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMinZSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxZSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_vecTextMoveVel, sizeof(CVector2f) ); tData.SafeRead(&pEffectUnitProp->m_fTextAngularVel, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fTextMaxScale, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fTextMinScale, sizeof(float) ); LoadStringSafeT( tData, pEffectUnitProp->m_szARPName ); LoadStringSafeT( tData, pEffectUnitProp->m_szARAName ); tData.SafeRead(&pEffectUnitProp->m_vecRotate, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_nPiece0, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nRS0, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nPiece1, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nRS1, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nPiece2, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nRS2, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nPiece3, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nRS3, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nPiece4, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nRS4, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nPiece5, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nRS5, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_Animation, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_bSynch, sizeof(BOOL) ); tData.SafeRead(&pEffectUnitProp->m_fMinXSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxXSize, sizeof(float) ); if(pEffectUnitProp->CaculateProp()) return false; CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CCameraFilterPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CBufFile tData( inData.GetBuffer(), inData.GetSize() ); CCameraFilterProp* pEffectUnitProp = (CCameraFilterProp*)(handle); tData.SafeRead(&pEffectUnitProp->m_bFilterParent,sizeof(bool)); tData.SafeRead(&pEffectUnitProp->m_eBlendModel,sizeof(SPR_BLENDMODE)); tData.SafeRead(&pEffectUnitProp->m_eZTest,sizeof(Z_TEST)); tData.SafeRead(&pEffectUnitProp->m_xScale,sizeof(float)); tData.SafeRead(&pEffectUnitProp->m_yScale,sizeof(float)); tData.SafeRead(&pEffectUnitProp->m_zScale,sizeof(float)); _DoDecode(inData,pEffectUnitProp); return true; }
bool CDynamicLightPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CDynamicLightProp* pEffectUnitProp = (CDynamicLightProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_fRange, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMinStrong, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxStrong, sizeof(float) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CTDimAudioPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CTDimAudioProp* pEffectUnitProp = (CTDimAudioProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead( &pEffectUnitProp->m_bDelayStop, sizeof( bool ) ); tData.SafeRead( &pEffectUnitProp->m_fPlayProbability, sizeof( float ) ); LoadStringSafeT( tData, pEffectUnitProp->m_szAudioName ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CNullPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CNullProp* pEffectUnitProp = (CNullProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_bDelay, sizeof(bool) ); tData.SafeRead(&pEffectUnitProp->m_vecRotate, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_bFolowSpeed, sizeof(BOOL) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CCameraShakePropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CBufFile tData( inData.GetBuffer(), inData.GetSize() ); CCameraShakeProp* pEffectUnitProp = (CCameraShakeProp*)(handle); tData.SafeRead(&pEffectUnitProp->m_fFrequence, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fStrength, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMinRadius, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxRadius, sizeof(float) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CShakePropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CShakeProp* pEffectUnitProp = (CShakeProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_vecDirCtrl, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_vecFrequence, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_fStrength, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_isCtrlParent, sizeof(bool) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
int SImgX_WIC::LoadFromMemory(void *pBuf,size_t bufLen ) { SASSERT(m_pImgArray == NULL); IWICImagingFactory* factory = SImgDecoderFactory_WIC::s_wicImgFactory; CAutoRefPtr<IWICBitmapDecoder> decoder; CAutoRefPtr<IWICStream> stream ; if(FAILED(factory->CreateStream(&stream))) return 0; if(FAILED(stream->InitializeFromMemory((BYTE*)pBuf,(DWORD)bufLen))) return 0; if(FAILED(factory->CreateDecoderFromStream(stream,NULL,WICDecodeMetadataCacheOnDemand,&decoder))) return 0; return _DoDecode(decoder); }
bool CParticleSystemPropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CParticleSystemProp* pEffectUnitProp = (CParticleSystemProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead(&pEffectUnitProp->m_eTextOp, sizeof(SPR_BLENDOP) ); LoadMapValueSafe( tData, pEffectUnitProp->m_EmissionMinRadius ); LoadMapValueSafe( tData, pEffectUnitProp->m_EmissionMaxRadius ); LoadMapValueSafe(tData, pEffectUnitProp->m_ClipDistMap); tData.SafeRead(&pEffectUnitProp->m_ClipPlane.originPlane, sizeof(CPlane)); LoadMapValueSafe( tData, pEffectUnitProp->m_XYZcale ); tData.SafeRead(&pEffectUnitProp->m_fLongShortRadius, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fCornerDivision, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fLongShortDRadius, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fZBias, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_sRefSkelatal, sizeof(IDNAME) ); tData.SafeRead(&pEffectUnitProp->m_fWidthRatio, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fVelocityPercent, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_eTextDir, sizeof(CParticleSystemProp::ePS_TextureDir) ); tData.SafeRead(&pEffectUnitProp->m_nEmissionInterval, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nParticlesPerEmission, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_fMinSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxSize, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_vEmissionPlan, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_vMinVelocity, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_vMaxVelocity, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_vAcceleration, sizeof(CVector3f) ); tData.SafeRead(&pEffectUnitProp->m_fMinAngularVelocity, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxAngularVelocity, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_nMinLifeSpan, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_nMaxLifeSpan, sizeof(int32) ); tData.SafeRead(&pEffectUnitProp->m_fMinRadius, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_fMaxRadius, sizeof(float) ); tData.SafeRead(&pEffectUnitProp->m_eFollowType, sizeof(CParticleSystemProp::ePS_ParticlCoord) ); tData.SafeRead(&pEffectUnitProp->m_eEmissionType, sizeof(CParticleSystemProp::ePS_EMSType) ); tData.SafeRead(&pEffectUnitProp->m_eVelType, sizeof(CParticleSystemProp::ePS_VELType) ); tData.SafeRead(&pEffectUnitProp->m_eBlendModel, sizeof(SPR_BLENDMODE) ); tData.SafeRead(&pEffectUnitProp->m_eZTest, sizeof(Z_TEST) ); tData.SafeRead(&pEffectUnitProp->m_bLightEnable, sizeof(BOOL) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
bool CFlareSpritePropCoder::DeCode_EffectUnitProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CFlareSpriteProp* pEffectUnitProp = (CFlareSpriteProp*)(handle); CBufFile tData( inData.GetBuffer(), inData.GetSize() ); tData.SafeRead( &pEffectUnitProp->m_vecRotate, sizeof(CVector3f) ); tData.SafeRead( &pEffectUnitProp->m_vecNormal, sizeof(CVector3f) ); tData.SafeRead( &pEffectUnitProp->m_fMinSize, sizeof(float) ); tData.SafeRead( &pEffectUnitProp->m_fMaxSize, sizeof(float) ); tData.SafeRead( &pEffectUnitProp->m_eFaceType, sizeof(SPR_FACE) ); tData.SafeRead( &pEffectUnitProp->m_eBlendModel, sizeof(SPR_BLENDMODE) ); tData.SafeRead( &pEffectUnitProp->m_eZTest, sizeof(Z_TEST) ); tData.SafeRead( &pEffectUnitProp->m_bLightEnable, sizeof(BOOL) ); CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); return true; }
int SImgX_WIC::LoadFromFile( LPCWSTR pszFileName ) { SASSERT(m_pImgArray == NULL); IWICImagingFactory* factory = SImgDecoderFactory_WIC::s_wicImgFactory; CAutoRefPtr<IWICBitmapDecoder> decoder; HRESULT hr = factory->CreateDecoderFromFilename( pszFileName, NULL, GENERIC_READ, WICDecodeMetadataCacheOnLoad, &decoder ); if(FAILED(hr)) return 0; return _DoDecode(decoder); }
////////////////////////////////////////////////////////////////////////// // SImgX_PNG int SImgX_PNG::LoadFromMemory( void *pBuf,size_t bufLen ) { APNGDATA * pdata =LoadAPNG_from_memory((char*)pBuf,bufLen); return _DoDecode(pdata); }
bool CEffectPropCoder::DeCode_EffectProp( const CDataChunk& inData , OBJ_HANDLE handle ) { CBufFile tData( inData.GetBuffer(), inData.GetSize() ); CEffectGroup* pGroup = reinterpret_cast<CEffectGroup*>(handle); string strEffect; int Size; tData.SafeRead(&Size, sizeof(int)); EVector<char> temp(Size + 1, 0); tData.SafeRead(&temp.front(), Size); strEffect = &temp.front(); EMap< EString, CEffectProp* >::iterator iter = pGroup->m_EffectProps.find(strEffect.c_str()); if( iter == pGroup->m_EffectProps.end() ) pGroup->m_EffectProps[strEffect.c_str()] = pGroup->CreateEffectPropFun(strEffect.c_str()); else { EString Err = "特效文件:" + pGroup->m_szName + "存在同名轨道"; GfkLogErr(Err.c_str()); } CEffectProp* pEffectProp = pGroup->m_EffectProps[strEffect.c_str()]; int TrackSize = 0; tData.SafeRead( (char*)&TrackSize, sizeof(int) ); for( int i = 0; i < TrackSize; ++i )//每个特效里面有多少个轨道 { EMap< int, IEffectUnitProp* > CurTrack; int KeySize = 0; tData.SafeRead( (char*)&KeySize, sizeof(int) ); for( int j = 0; j < KeySize; ++j )//每个轨道里面有多少个特效单元 { int Pos = 0; tData.SafeRead( (char*)&Pos, sizeof(int) ); int Len = 0; GUID ClassID; UINT ID; char Desc[1024]; tData.SafeRead( (char*)&ClassID, sizeof(GUID) ); tData.SafeRead( (char*)&Len, sizeof(int) ); tData.SafeRead( (char*)Desc, Len ); tData.SafeRead( (char*)&ID, sizeof(UINT) ); Pos = max(0,Pos); IEffectUnitProp* pEffectUnitProp = ( (CEffectManager*)(pEffectProp->m_pEffectMgr) )->CreateEffectUnitProp( ClassID, ID ); if( pEffectUnitProp == NULL ) { Desc[Len] = 0; EString str = "无法找到相应的DLL,DLL描述:"; str += Desc; printf( ( str + "错误提示" ).c_str() ); return false; } static_cast<CEffectUnitProp*>(pEffectUnitProp)->m_pEffectProp = pEffectProp; CDataChunk tChunk; tData.SafeRead(&tChunk.GetHdr(),sizeof(CDataChunk::ChunkHdr)); ReadChunk(tData,tChunk); _DoDecode(tChunk,pEffectUnitProp); CurTrack[Pos] = pEffectUnitProp; tData.SafeRead( (char*)&pEffectProp->m_AttachKey[pEffectUnitProp].nTrack, sizeof(int) ); tData.SafeRead( (char*)&pEffectProp->m_AttachKey[pEffectUnitProp].nKeyStartTime, sizeof(int) ); } pEffectProp->m_Tracks.push_back(CurTrack); } tData.SafeRead(&pEffectProp->m_TimeRange, sizeof(int)); pEffectProp->m_AttachAniName.clear(); int Num = 0; tData.SafeRead(&Num, sizeof(int) ); for( int i = 0; i < Num; ++i ) { EString strTemp; LoadStringSafeT(tData,strTemp); pEffectProp->m_AttachAniName.push_back( strTemp ); } LoadStringSafeT( tData, pEffectProp->m_UserDesc ); tData.SafeRead(&pEffectProp->m_bFrameSynch,sizeof(bool)); pEffectProp->LoadFullRes(); return true; }
int SImgX_PNG::LoadFromFile( LPCWSTR pszFileName ) { APNGDATA * pdata =LoadAPNG_from_file(pszFileName); return _DoDecode(pdata); }