bool _saveTextureToLocal(Ogre::TexturePtr texPtr, const Ogre::String& fileName)
{
Ogre::HardwarePixelBufferSharedPtr tmpTexBuf = texPtr->getBuffer();
int width = texPtr->getWidth();
int height= texPtr->getHeight();
char* tmpBuf = new char[width*height*4];
Ogre::PixelBox tmpBox(width,
height,
texPtr->getDepth(),
texPtr->getFormat(),
tmpBuf);
tmpTexBuf->blitToMemory(tmpBox);
TexturePtr tmpTexPtr = TextureManager::getSingleton().createManual ( fileName, "General",
TEX_TYPE_2D, texPtr->getWidth(), texPtr->getHeight(), 1, 0, PF_A8B8G8R8 );
tmpTexPtr->load();
HRESULT hr;
IDirect3DSurface9 *pDstSurface = 0;
Ogre::D3D9Texture *d3dTex = reinterpret_cast&