Maded the image filename handling more consistent.

This commit is contained in:
Robert Osfield 2004-06-30 14:43:40 +00:00
parent ae3b1454e8
commit b22de2eba0

View File

@ -716,19 +716,19 @@ ViewerEventHandler::ViewerEventHandler(OsgCameraGroup* cg):
_statsAndHelpDrawCallback = new StatsAndHelpDrawCallback(this,0);
cam->addPostDrawCallback(_statsAndHelpDrawCallback);
std::string basename("saved_image");
std::string ext(".jpg");
if (cfg->getNumberOfCameras()==1)
{
SnapImageDrawCallback* snapImageDrawCallback = new SnapImageDrawCallback("saved_image.jpg");
SnapImageDrawCallback* snapImageDrawCallback = new SnapImageDrawCallback(basename+ext);
cam->addPostDrawCallback(snapImageDrawCallback);
_snapImageDrawCallbackList.push_back(snapImageDrawCallback);
}
else
{
std::string basename("saved_image_");
std::string ext(".rgb");
for(unsigned int i=0;i<cfg->getNumberOfCameras();++i)
{
std::string filename(basename);
std::string filename(basename+"_");
filename += ('0'+i);
filename += ext;
SnapImageDrawCallback* snapImageDrawCallback = new SnapImageDrawCallback(filename);