Skip to content

Commit 2cca680

Browse files
committed
Meshes won't crash if file is not found on loading
1 parent ff845aa commit 2cca680

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Core/Contents/Source/PolyMesh.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ Vertex *Mesh::addVertex(Number x, Number y, Number z, Number u, Number v) {
342342
void Mesh::saveToFile(const String& fileName, bool writeNormals, bool writeTangents, bool writeColors, bool writeBoneWeights, bool writeUVs, bool writeSecondaryUVs) {
343343
OSFILE *outFile = OSBasics::open(fileName, "wb");
344344
if(!outFile) {
345-
Logger::log("Error opening mesh file for saving: %s", fileName.c_str());
345+
Logger::log("Error opening mesh file for saving: %s\n", fileName.c_str());
346+
return;
346347
}
347348
saveToFile(outFile, writeNormals, writeTangents, writeColors, writeBoneWeights, writeUVs, writeSecondaryUVs);
348349
OSBasics::close(outFile);
@@ -352,7 +353,8 @@ void Mesh::saveToFile(const String& fileName, bool writeNormals, bool writeTange
352353
void Mesh::loadMesh(const String& fileName) {
353354
OSFILE *inFile = OSBasics::open(fileName, "rb");
354355
if(!inFile) {
355-
Logger::log("Error opening mesh file %s", fileName.c_str());
356+
Logger::log("Error opening mesh file %s\n", fileName.c_str());
357+
return;
356358
}
357359
loadFromFile(inFile);
358360
OSBasics::close(inFile);

Modules/Contents/OculusVR/PolycodeOVR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void PolycodeOVR::setEyeDistanceScale(Number scale) {
141141
float halfIPD = interpupilaryDistance * 0.5f * eyeDistanceScale;
142142
leftCamera->setPosition(-halfIPD, 0.0, 0.0);
143143
rightCamera->setPosition(halfIPD, 0.0, 0.0);
144+
144145

145146
}
146147

0 commit comments

Comments
 (0)