summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/samples/vrml-server.scxml3
-rw-r--r--src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp10
2 files changed, 10 insertions, 3 deletions
diff --git a/apps/samples/vrml-server.scxml b/apps/samples/vrml-server.scxml
index bf0e4f6..7c257f5 100644
--- a/apps/samples/vrml-server.scxml
+++ b/apps/samples/vrml-server.scxml
@@ -21,7 +21,8 @@
'_' + numPattern + // z
'_' + numPattern + // width
'_' + numPattern + // height
- '_(off|on)' + ')\\..*$'); // autorotate
+ '_(off|on)' + // autorotate
+ ')\\.\\w+$'); // end
/**
* Transform a file we found into a processed or model struct
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp
index 2fa2877..fbc244a 100644
--- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp
+++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp
@@ -502,9 +502,15 @@ void OSGConverter::dumpMatrix(const osg::Matrix& m) {
}
void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image, const unsigned int context_id) {
- bool success = osgDB::writeImageFile(image, _filename);
+
+ bool success = osgDB::writeImageFile(image, _filename + ".tmp");
if (success) {
- _converter->reportSuccess(_req);
+ int err = rename(std::string(_filename + ".tmp").c_str(), _filename.c_str());
+ if (err) {
+ _converter->reportFailure(_req);
+ } else {
+ _converter->reportSuccess(_req);
+ }
} else {
_converter->reportFailure(_req);
}