| 23 | } |
| 24 | |
| 25 | std::shared_ptr<TRACK> NFS4::LoadTrack(const std::string &track_base_path) { |
| 26 | std::cout << "--- Loading NFS4 Track ---" << std::endl; |
| 27 | auto track = make_shared<TRACK>(TRACK()); |
| 28 | |
| 29 | boost::filesystem::path p(track_base_path); |
| 30 | track->name = p.filename().string(); |
| 31 | stringstream frd_path, can_path; |
| 32 | |
| 33 | frd_path << track_base_path << "/TR.frd"; |
| 34 | can_path << track_base_path << "/TR00A.CAN"; |
| 35 | |
| 36 | ASSERT(ExtractTrackTextures(track_base_path, track->name, NFSVer::NFS_4), "Could not extract " << track->name << " QFS texture pack."); |
| 37 | ASSERT(LoadFRD(frd_path.str(), track->name, track), "Could not load FRD file: " << frd_path.str()); // Load FRD file to get track block specific data |
| 38 | ASSERT(LoadCAN(can_path.str(), track->cameraAnimation), "Could not load CAN file (camera animation): " << can_path.str()); // Load camera intro/outro animation data |
| 39 | |
| 40 | track->textureArrayID = MakeTextureArray(track->textures, false); |
| 41 | track->track_blocks = ParseTRKModels(track); |
| 42 | |
| 43 | std::cout << "Successful track load!" << std::endl; |
| 44 | return track; |
| 45 | } |
| 46 | |
| 47 | void parsePolygonFlags(int triangle, uint32_t polygonFlags) { |
| 48 | std::bitset<32> bits(polygonFlags); |
nothing calls this directly
no test coverage detected