jake_
18-12-2008 22:50:25
Hello,
Calling SplattingManager::saveMapToImage() doesn't actually copy the coverage map into the given image. Instead, it makes the data pointer inside the image point to the coverage map in memory.
Therefore, if I do something like this...
...I would expect my newly-created "saved" copy to stay the same even if the coverage map is changed, but it does not -- since the data was never actually copied and all I have is a pointer, any subsequent painting also alters all copies.
Is this the desired functionality? If so, it might be better to rename saveMapToImage() to be something more like getMapDataPointer(). Personally, I'd rather have a function that does an actual copy.
Calling SplattingManager::saveMapToImage() doesn't actually copy the coverage map into the given image. Instead, it makes the data pointer inside the image point to the coverage map in memory.
Therefore, if I do something like this...
Ogre::Image splatmap;
mSplatMgr->saveMapToImage(0, splatmap);
...I would expect my newly-created "saved" copy to stay the same even if the coverage map is changed, but it does not -- since the data was never actually copied and all I have is a pointer, any subsequent painting also alters all copies.
Is this the desired functionality? If so, it might be better to rename saveMapToImage() to be something more like getMapDataPointer(). Personally, I'd rather have a function that does an actual copy.