From 95fb92195356ed3b0c0b1c80adf5b11d0f6b9a90 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 6 Feb 2002 08:57:06 +0000 Subject: [PATCH] Compile fixes. --- src/osgDB/FileUtils.cpp | 4 ++-- src/osgUtil/Optimizer.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index c7f00716e..5635cb9d2 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -357,14 +357,14 @@ osgDB::DirectoryContents osgDB::getDirectoryContents(const std::string& dirName) osgDB::DirectoryContents contents; struct _finddata_t data; - long handle = _findfirst((dirName + "\\*").c_str(), &data); + long handle = FindFirstFile((dirName + "\\*").c_str(), &data); if (handle != -1) { do { contents.push_back(data.name); } - while (_findnext(handle, &data) != -1); + while (FindNextFile(handle, &data) != -1); _findclose(handle); } diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 09cf2df15..9fd3f432c 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -328,14 +328,14 @@ void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Transform& transform) } else { - if (_matrixStack.empty()) + osg::ref_ptr matrix = new osg::Matrix; + transform.getLocalToWorldMatrix(*matrix,this); + + if (!_matrixStack.empty()) { - _matrixStack.push_back(transform.getLocalToWorldMatrix()); - } - else - { - _matrixStack.push_back(transform.getLocalToWorldMatrix()*_matrixStack.back()); + matrix->postMult(_matrixStack.back()); } + _matrixStack.push_back(*matrix); _transformStack.push_back(&transform);