mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 02:35:16 +02:00
make readFromFileV2() return bool for file exists
This commit is contained in:
parent
89eefe461d
commit
6a32424fb2
2 changed files with 4 additions and 2 deletions
|
@ -865,7 +865,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
return bytesAtThisLevel;
|
return bytesAtThisLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelTree::readFromFileV2(const char* fileName, bool reset) {
|
bool VoxelTree::readFromFileV2(const char* fileName) {
|
||||||
std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate);
|
std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate);
|
||||||
if(file.is_open()) {
|
if(file.is_open()) {
|
||||||
printLog("loading file...\n");
|
printLog("loading file...\n");
|
||||||
|
@ -881,7 +881,9 @@ void VoxelTree::readFromFileV2(const char* fileName, bool reset) {
|
||||||
delete[] entireFile;
|
delete[] entireFile;
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelTree::writeToFileV2(const char* fileName) const {
|
void VoxelTree::writeToFileV2(const char* fileName) const {
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
|
|
||||||
// these will read/write files that match the wireformat, excluding the 'V' leading
|
// these will read/write files that match the wireformat, excluding the 'V' leading
|
||||||
void writeToFileV2(const char* filename) const;
|
void writeToFileV2(const char* filename) const;
|
||||||
void readFromFileV2(const char* filename, bool reset);
|
bool readFromFileV2(const char* filename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEncodeLevel,
|
int encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEncodeLevel,
|
||||||
|
|
Loading…
Reference in a new issue