Fixed incorrect messages about temp files not being deleted.
This commit is contained in:
parent
4779f91787
commit
880dcd8645
@ -50,7 +50,7 @@ const int32_t g_uVolumeSideLength = 128;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FilePager<MaterialDensityPair88>* pager = new FilePager<MaterialDensityPair88>("./");
|
||||
FilePager<MaterialDensityPair88>* pager = new FilePager<MaterialDensityPair88>(".");
|
||||
LargeVolume<MaterialDensityPair88> volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager);
|
||||
|
||||
//Make our volume contain a sphere in the center.
|
||||
|
@ -46,10 +46,17 @@ namespace PolyVox
|
||||
{
|
||||
public:
|
||||
/// Constructor
|
||||
FilePager(const std::string& strFolderName)
|
||||
FilePager(const std::string& strFolderName = ".")
|
||||
:Pager<VoxelType>()
|
||||
,m_strFolderName(strFolderName)
|
||||
{
|
||||
// Add the trailing slash, assuming the user dind't already do it.
|
||||
if ((m_strFolderName.back() != '/') && (m_strFolderName.back() != '\\'))
|
||||
{
|
||||
m_strFolderName.append("/");
|
||||
}
|
||||
|
||||
// Build a unique prefix to avoid multiple pagers using the same filenames.
|
||||
srand(static_cast<unsigned int>(time(0)));
|
||||
int iRandomValue = rand();
|
||||
|
||||
@ -63,7 +70,7 @@ namespace PolyVox
|
||||
{
|
||||
for(std::vector<std::string>::iterator iter = m_vecCreatedFiles.begin(); iter < m_vecCreatedFiles.end(); iter++)
|
||||
{
|
||||
POLYVOX_LOG_WARNING_IF(!std::remove(iter->c_str()), "Failed to delete '" << *iter << "' when destroying FilePager");
|
||||
POLYVOX_LOG_WARNING_IF(std::remove(iter->c_str()) != 0, "Failed to delete '" << *iter << "' when destroying FilePager");
|
||||
}
|
||||
|
||||
m_vecCreatedFiles.clear();
|
||||
|
@ -102,7 +102,7 @@ VolumeType* createAndFillVolume(void)
|
||||
{
|
||||
const int32_t uVolumeSideLength = 64;
|
||||
|
||||
FilePager<VolumeType::VoxelType>* pager = new FilePager<VolumeType::VoxelType>("./");
|
||||
FilePager<VolumeType::VoxelType>* pager = new FilePager<VolumeType::VoxelType>(".");
|
||||
|
||||
//Create empty volume
|
||||
VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager);
|
||||
@ -139,7 +139,7 @@ float randomFloat(float a, float b)
|
||||
template <typename VolumeType>
|
||||
VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minValue, float maxValue)
|
||||
{
|
||||
FilePager<float>* pager = new FilePager<float>("./");
|
||||
FilePager<float>* pager = new FilePager<float>(".");
|
||||
|
||||
//Create empty volume
|
||||
VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager);
|
||||
|
@ -269,7 +269,7 @@ TestVolume::TestVolume()
|
||||
{
|
||||
Region region(-57, -31, 12, 64, 96, 131); // Deliberatly awkward size
|
||||
|
||||
m_pFilePager = new FilePager<int32_t>("./");
|
||||
m_pFilePager = new FilePager<int32_t>(".");
|
||||
|
||||
//Create the volumes
|
||||
m_pRawVolume = new RawVolume<int32_t>(region);
|
||||
|
Loading…
x
Reference in New Issue
Block a user