type = notextype;
color = 0;
- tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" );
+ tfile = Folders::openMandatoryFile( Folders::getResourcePath(filename), "rb" );
+
// read model settings
fseek(tfile, 0, SEEK_SET);
}
boundingsphereradius = fast_sqrt(boundingsphereradius);
- return 1;
+ return true;
}
type = normaltype;
color = 0;
- tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" );
- // read model settings
+ tfile = Folders::openMandatoryFile( Folders::getResourcePath(filename), "rb" );
+ // read model settings
fseek(tfile, 0, SEEK_SET);
funpackf(tfile, "Bs Bs", &vertexNum, &TriangleNum);
}
boundingsphereradius = fast_sqrt(boundingsphereradius);
- return 1;
+ return true;
}
bool Model::loaddecal(const char *filename, bool texture )
numdecals = 0;
color = 0;
- tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" );
- // read model settings
+ tfile = Folders::openMandatoryFile( Folders::getResourcePath(filename), "rb" );
+ // read model settings
fseek(tfile, 0, SEEK_SET);
funpackf(tfile, "Bs Bs", &vertexNum, &TriangleNum);
decalposition = (XYZ*)malloc(sizeof(XYZ) * max_model_decals);
}
- return 1;
+ return true;
}
bool Model::loadraw(char *filename )
type = rawtype;
color = 0;
- tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" );
- // read model settings
+ tfile = Folders::openMandatoryFile( Folders::getResourcePath(filename), "rb" );
+ // read model settings
fseek(tfile, 0, SEEK_SET);
funpackf(tfile, "Bs Bs", &vertexNum, &TriangleNum);
owner[i] = -1;
}
- return 1;
+ return true;
}