MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / LoadHRZ

Method LoadHRZ

src/Loaders/nfs3_loader.cpp:397–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397bool NFS3::LoadHRZ(std::string hrz_path, const std::shared_ptr<TRACK> &track) {
398 ifstream hrz(hrz_path, ios::in | ios::binary);
399 if(!hrz.is_open()) return false;
400 LOG(INFO) << "Loading HRZ File located at " << hrz_path;
401
402 std::string str, skyTopColour, skyBottomColour;
403
404 while (std::getline(hrz, str))
405 {
406 if(str.find("/* r,g,b value at top of Gourad shaded SKY area */") != std::string::npos){
407 std::getline(hrz, skyTopColour);
408 }
409 if(str.find("/* r,g,b values for base of Gourad shaded SKY area */") != std::string::npos){
410 std::getline(hrz, skyBottomColour);
411 }
412 }
413
414 track->sky_top_colour = parseRGBString(skyTopColour);
415 track->sky_bottom_colour = parseRGBString(skyBottomColour);
416
417 hrz.close();
418
419 return true;
420}
421
422std::vector<TrackBlock> NFS3::ParseTRKModels(const std::shared_ptr<TRACK> &track) {
423 LOG(INFO) << "Parsing TRK file into ONFS GL structures";

Callers

nothing calls this directly

Calls 1

parseRGBStringFunction · 0.85

Tested by

no test coverage detected